PingPawn API

On of my side projects, a Social Quotefile named PingPawn, fuels an irc bot named sexymans. Amoung other places, it sits in my IRC channel, #sancho (irc.lunarnet.org). The denizens of that channel liked to point out that sexymans was, quite often, broken.

And broken he should be, because he was a 30-minute phenny hack until the last straw broke tonight and I tore out the old guts, built a proper json-spewing, RESTful HTTP API on the website, and made the bot consume said API.

I did this mainly because I wanted to, but slightly because after a few googles I couldn’t find an elegant way to write preparedStatements for mysql in python. Fuck the MySQLDB module.

Anyways, here’s the current API. (only GET requests as of this writing.)
http://pingpawn.com/api/rand – Get a random quote
http://pingpawn.com/api/rand/grue – Get a random quote from a specific quotefile (in this case the ‘grue’ quotefile (mine))
http://pingpawn.com/api/search?q=ATTEMPT+to+not+be+a+chump – Search for quotes that match a certain phrase (a random quote from the set of all that match).
http://pingpawn.com/api/search/grue?q=fire – Search for quotes that match a certain phrase from a certain quotefile (a random quote from the set of all that match).
http://pingpawn.com/api/search/grue/2?q=fire – Search for quotes that match a certain phrase from a certain quotefile, deterministically (this is the second quote in this quotefile that matches, and always will be.)

So that’s that.

I also deployed a new version of VERGE-RPG.com last night, and fixed up a few of the bug reports this evening. Yay Gravitars and BBCode!

As far as GrueDorf goes, I think this is my third successive night in a row of posting and of doing far more than an hour’s worth of work. Meanwhile, my arch-nemesis Kildorf appears to have failed to do a single hour’s worth of project work all week…

Also read...

Leave a Reply

Your email address will not be published. Required fields are marked *