Skip to content
This repository was archived by the owner on Nov 6, 2021. It is now read-only.

HTTP commands

sharedferret edited this page Apr 11, 2012 · 3 revisions

##Usage These commands are accessed by sending a query to the bot:

http://[bot address]:[bot ip]/?command=[command]

command is required by all calls, but some calls may require additional parameters. Most commands can also return a JSON-formatted object by adding the format=json parameter.

##List of commands

###ping Description: Pings the bot.

Parameters: format (optional)

Sample response: Pong!

Sample response (json): {"response":"ping","value":"2012-04-11T00:46:34.196Z"}

JSON Response: response - The issued command (ping), value - A datetime object of when the bot instance was started

###online Description: Returns the number of users online in the room

Parameters: format (optional)

Sample response: There are 10 users online.

Sample response (json): {"response":"online","value":10}

JSON Response: response - The issued command (online), value - An integer value of people in the room

###users Description: Returns a list of users in the room

Parameters: format (optional)

Sample response: Users online: SearsTower, DocHoop, ilovewub, DJ Rainbow Dash, Tetsuo Shima, Unfathomable, xlSMALLd, Sally Y, sk8rgrl

Sample response (json): {"response":"users","value":{"4f679a04a3f751580d0206e5":{"name":"SearsTower","created":1332189700.88,"laptop":"linux", "userid":"4f679a04a3f751580d0206e5","acl":0,"fans":18,"points":271,"avatarid":16}, "4df0443f4fe7d0631905d6a8":{"name": "DJ Rainbow Dash","created":1307591743.11,"laptop":"mac","userid":"4df0443f4fe7d0631905d6a8","acl":0,"fans":317, "points":23218,"avatarid":18}}}

JSON Response: response - The issued command (online), value - The usersList JSON object

JSON Response (value): {userid:{name, created, laptop, userid, acl, fans, points, avatarid}} (Note: acl is a superuser flag)

###nowplaying

Description: Returns the song currently playing, along with the DJ and current vote count.

Parameters: format (optional)

Sample response: Current song: Spice Girls - Wannabe DJ xlSMALLd (+4/-0)

Sample response (json): {"response":"nowplaying","value":{"artist":"Spice Girls","song":"Wannabe","djname":"xlSMALLd", "djid":"4f2c73b2a3f75176c00101a4","up":6,"down":0,"listeners":12,"snags":0,"started":1334149583.65}}

JSON Response: response - The issued command (online), value - The currentsong JSON object

JSON Response (currentsong): artist, song, djname, djid, up - Awesomes, down - Lames, listeners, snags, started

###djs.info

###djs.wait

###queue.print

###queue.add Not implemented yet.

Clone this wiki locally