User API

Published by: Truth, on 09:04 pm Monday April 16th, 2007 - Source: http://

I wrote a sweet and short 'API' kind of thing that allows you to get the missions that a user has done.

It can be accessed at http://hackthissite.org/user_api/ and I wrote some documentation at
http://hackthissite.org/pages/user/user_api_docs.txt

But for the sake of laziness I'll reproduce it here.

"User API Documentation:

For a while there was an excellent bot in #help (on irc.hackthissite.org) that would allow you to see how many missions a user has completed.

You can access the the 'API' at the following URL:
http://hackthissite.org/user_api/

The way you can access data is by using data requests, like most other user_apis.

The first variable you MUST define is the user, with a URL such as
http://hackthissite.org/user_api/?user=MYUSER

The second optional variable is the datatype that you need, which can
be "xml" "html" or "plain", with a URL such as
http://hackthissite.org/user_api/?user=USER&type=xml

The default datatype is plain.

A URL would be something like this
http://hackthissite.org/user_api/?user=ace&type=html
http://hackthissite.org/user_api/?user=saxdax&type=plain

It's free for anyone to use, but I would appreciate you guys linking the project in the comments so I can see the cool shit you guys are doing. =D

599 views / 11 comments reply - tell a friend - printer version

Comments: Published: 10 comments.
By: doob - 09:09 pm Monday April 16th, 2007
--------------------------------------------------------------------------------
lawl.
By: Wells - 10:34 pm Monday April 16th, 2007
--------------------------------------------------------------------------------
For the record, you should use mod_rewrite and hide server-specific details like .php. This makes urls more future proof and abstract, which is especially important for a public API.
By: epoch_qwert - 11:02 pm Monday April 16th, 2007
--------------------------------------------------------------------------------
Oh, cool, I'm going to add that to my bot. I was thinking of doing it myself with a lot of regular expressions, but this makes it a lot easier. :D
By: epoch_qwert - 01:55 am Tuesday April 17th, 2007
--------------------------------------------------------------------------------
Okay, my bot works with that. Though I noticed that the page didn't display points. :-/
By: the13ghost - 03:16 am Tuesday April 17th, 2007
--------------------------------------------------------------------------------
Hmmm, pretty cool. Should display points too though. lol
By: Truth - 05:05 am Tuesday April 17th, 2007
--------------------------------------------------------------------------------
Displays points now, in all formats.
By: Truth - 09:42 pm Tuesday April 17th, 2007
--------------------------------------------------------------------------------
Fixed it, re Wells' input of using mod_rewrite.
By: thepowersgang - 06:55 am Wednesday April 18th, 2007
--------------------------------------------------------------------------------
Very Good, Can you put in an image version for insertion into profiles?
By: Acrylic76 - 08:43 am Sunday April 22nd, 2007
--------------------------------------------------------------------------------
That's pretty cool, good job Truth.
By: Covurok - 12:19 am Monday April 23rd, 2007
--------------------------------------------------------------------------------
yep, gotta hand it to him, good job.