Radio Reddit API Documentation
For mobile application devs we are providing a simple interface to the current state of the Radio Reddit stream.
The resources are available as XML and JSON:
http://radioreddit.com/api/status.xml
http://radioreddit.com/api/status.json
Exmple XML (formatted for readability):
<?xml version="1.0" encoding="UTF-8"?> <radioreddit> <online>TRUE</online> <playlist>metal / hard rock</playlist> <songs> <song> <title>Illumineye</title> <artist>American Hollow</artist> <redditor>playbass</redditor> <genre>Metal</genre> <reddit_title>Illumineye by American Hollow (playbass)</reddit_title> <reddit_url>http://www.radioreddit.com/songs/?song=American_Hollow_%28playbass%29_Illumineye</reddit_url> <download_url>http://radioreddit.com/audio/American_Hollow_(playbass)_Illumineye.mp3</download_url> </song> <song> <title>Bounce Per Ounce</title> <artist>Ruin</artist> <redditor>Psyingo</redditor> <genre>Electronic</genre> <reddit_title>Bounce Per Ounce by Ruin (Psyingo)</reddit_title> <reddit_url>http://www.radioreddit.com/songs/?song=Ruin_%28Psyingo%29_Bounce_Per_Ounce</reddit_url> </song> <song> <title>Obie the Overlord</title> <artist>DAE</artist> <redditor>Jimmy8DMT</redditor> <genre>Electronic</genre> <reddit_title>Obie the Overlord by DAE (Jimmy8DMT)</reddit_title> <reddit_url>http://www.radioreddit.com/songs/?song=DAE_%28Jimmy8DMT%29_Obie_the_Overlord</reddit_url> </song> ... </songs> </radioreddit>
The root tag radioreddit has just a few children:
- online - returns TRUE when the main stream is online, FALSE when the stream is offline.
- playlist (or dj) - defines the name of the playlist that is currently active or the name of the DJ currently logged in
- and songs - has children of type song that defines several attributes of the currently playing song as well as previous songs.
The songs tag has several (8-10 depending on recent IDs and PSAs) children of type song with the following important children:
- reddit_title - is the title we use for vote tracking via Reddit's dynamic JS buttons
- reddit_url - is the permalink we use for vote tracking via Reddit's dynamic JS buttons
- download_url - if the song is download enabled by the artist, this element gives the download location
How we track votes on Radio Reddit
The following JS code is shown to illustrate how we use reddit_title, reddit_url and reddit_target to track song up/down votes:
<script type="text/javascript"> reddit_url = "http://www.radioreddit.com/songs/?song=Voodoo_Pharmacology_%28voodoopharm%29_The_Wind_from_Space"; reddit_title = "The Wind from Space by Voodoo Pharmacology (voodoopharm)"; reddit_target = "radioreddit"; reddit_bgcolor = "f4f2f2"; </script> <script type="text/javascript" src="http://www.reddit.com/static/button/button3.js">
Comments
how does this track songs
I still don't really understand how this keeps track of votes. In the example code, I don't see any reference to up/down of votes.
Also, Is it possible to vote songs up or down on the upcoming playlist.