in reply to Personal stats

I haven't looked at the code closely, but i have a feeling that you might find The XP xml ticker and 'node_id=USERID;displaytype=xml' useful to avoid the HTML parsing.

See also What XML generators are currently available on PerlMonks?

Don't take this note in a negative way, I liked your little info message in the CB the other day, its just that if you use the XML your code will most likely never stop working because of site modifications wheras scraping the HTML means that your client could break if we ever change the layout of the user page.

---
$world=~s/war/peace/g

Replies are listed 'Best First'.
Re^2: Personal stats
by Tanktalus (Canon) on Jan 14, 2006 at 23:54 UTC

    You're right - had I known within the first 2 weeks of joining PM, I probably would have done it with XML rather than HTML - the HTML parsing is kinda ugly. ;-) That said, it works at the moment, and I'm not exactly one to change things that are working. If it stops working, I'll take a look at which is easier - ripping out the HTML::Parser and replacing it with XML::Twig (my favourite XML handler), or just tweaking it. :-)

    As for the XML xml ticker - given how frequently that changes, I think I'm doing both of us a favour by not using it. As in, I try not to hit the monastary for anything I don't need ;-)

    ... ok, I tried the conversion quickly. Of course, XML::Twig overwhelms the whole process to take longer ...

    I'm sure there's a faster way ... but whatever, it's just a cheap parlour trick anyway :-)

    Updated: one line in the code still had the old HTML field of "User since" rather than the xml field name of "created". Fixed. Output looks better, too.