BZLookup, because I can...

Make suggestions for improving one of the best games on the net!
Post Reply
F687/s
Private First Class
Private First Class
Posts: 369
Joined: Sun Dec 31, 2006 8:30 pm

BZLookup, because I can...

Post by F687/s »

Just for fun, I decided to hack up a Perl script that can look up any person's data on my.bzflag.org.

I have attached the script below. Usage is

./bzlookup.pl [callsign] [-v|-rv]

The callsign is the person you want to look up. -v (verbatim) is the munged HTML data that was used in the last step before parsing (for development). -rv (really verbatim) is the web page in its entirety.

I'm thinking about wrapping this inside a module. If anyone cares, the %stats hash includes the final stats, they are just printed out.

Let me know what you think.

Bugs:

-Hash elements may be missing if one of the slots is set to 0 (I ran this on a low-ranking person, and found this flaw)
Attachments
bzlookup.pl.txt
bzlookup.pl
(1.41 KiB) Downloaded 95 times
User avatar
AAA
Private First Class
Private First Class
Posts: 79
Joined: Sat Aug 07, 2004 3:36 pm
Contact:

Post by AAA »

It seems hacky. Then again, Perl is a hack.
I don't know what to say if you are serious about pulling data off of stats.bzflag.org. (Edit) There is nothing wrong with hacks, though. At least in a non-production environment.

I have my own bot that scans the list server and compiles data on http://bzflag.redjacket.ws/ , the same way s.b.o does. If you are interested I can create an XML feed that you can use. It can supply more detailed data like the player's history and scores.
Admin and Senior Vice Executive Administrator of Network and System Architecture @ BZFX -- Core Admin @ CAN -- SF.net user diamondmagic -- irc.freenode.net nickname AAA_awright (#bzfx if not #bzflag)
Post Reply