SongFight! Web Service

Use this forum for title suggestions, bitching at moderators, whining about phpBB, and grand ideas that will solve all of Song Fight's problems.
Post Reply
Lunkhead
Gorilla
Posts: 6076
Joined: Sat Sep 25, 2004 12:14 pm
Instruments: many
Recording Method: cubase/reason/mac/tascam4x4
Submitting as: Berkeley Social Scene, Merisan, Tiny Robots
Pronouns: he/him
Location: Berkeley, CA
Contact:

SongFight! Web Service

Post by Lunkhead » Tue Dec 11, 2007 12:21 pm

OK, this is real pie in the sky stuff, but I think it be awesome if there were a SongFight! Web service. Lots of ideas have been floated about uses for the vast excellent SF! archive, but for those of us who don't have direct access to the SF! database it seems like we'd have to first crawl the SF! archive on the Web and duplicate the database of links in order to build anything interesting. That's probably a barrier to entry for some developers, like me for example, though obviously it's not for others, like Plat for example.

Anyway, if there were an SF! Web service, people could build all sorts of cool apps on top of the SF! content. We could have SongFight! Radio again. Somebody could build SongFight! Pandora. Or a SongFight!/SomeSongs hybrid, etc.

The simple part would be exposing the current archive pages via Web service, since that would just involve formatting the data as XML instead of HTML. The interesting bit would be providing an API for querying the archive via a Web service, so you could do things like select fights/artists/songs by date range, vote count range, song count range, or get a random fight/artists/song, etc.

Any thoughts?
User avatar
drë
Loris
Posts: 1197
Joined: Sun Sep 26, 2004 12:24 am
Instruments: guitar
Recording Method: protools
Submitting as: Andre was here at Midnight
Location: Seattle, Wa
Contact:

Post by drë » Fri Jan 11, 2008 5:39 pm

funny you mention this.. i had started something similar to this back in august 06...

http://fvs.blaststream.com/testapp/shar ... ons/sf.xml

Pretty much created a coldfusion parser for the archive page, to create an archive.xml (above), that apps can access. the xml would only get bigger and bigger with time, but its not too bad. (400+KB since last time it was parse "ALL TAN" fight.)

the parser was also counting the votes, and then i was going to give songs a 5 star rating using the vote count...

ultimate i was thinking flash app, that would load the xml, and play random songs (radio style) or filter the songs by the star rating 1-5 ( a simplified vote count)...and so on, i even had an interface drawn out.. this was back in late 06, who knows if i ever have the time or energy to undertake such a massive project...but at least is noted here.



Image
Lunkhead
Gorilla
Posts: 6076
Joined: Sat Sep 25, 2004 12:14 pm
Instruments: many
Recording Method: cubase/reason/mac/tascam4x4
Submitting as: Berkeley Social Scene, Merisan, Tiny Robots
Pronouns: he/him
Location: Berkeley, CA
Contact:

Post by Lunkhead » Fri Jan 11, 2008 6:55 pm

Cool stuff, dre. I've sent you a PM. Things are afoot.
User avatar
Generic
Gorilla
Posts: 5421
Joined: Sat Sep 25, 2004 11:45 am
Instruments: Piano, Guitar, Harmonica, Mandolin, Accordion, Bass
Recording Method: Cubase 5AI, Cubase 6
Submitting as: Jon Eric, Hunky
Location: Pittsburgh, PA
Contact:

Re: SongFight! Web Service

Post by Generic » Thu Jan 17, 2008 11:29 am

Lunkhead wrote:Or a SongFight!/SomeSongs hybrid, etc.
That would be a pretty cool site. Like, the same songs on display as Songfight at a given time, but with the Somesongs good/okay/bad system and comments enabled... might help bridge the review gap, too. Sweet.

If I knew the first thing about web developing, I'd help. I really would. Good luck to you guys.
"Warren Zevon would be proud." -Reve Mosquito

Jon Eric - Get your feel on.
Website powered by Spud's Amazing Website Machine.

Circle of Titles!!!!!!
Lunkhead
Gorilla
Posts: 6076
Joined: Sat Sep 25, 2004 12:14 pm
Instruments: many
Recording Method: cubase/reason/mac/tascam4x4
Submitting as: Berkeley Social Scene, Merisan, Tiny Robots
Pronouns: he/him
Location: Berkeley, CA
Contact:

Post by Lunkhead » Thu Jan 17, 2008 12:46 pm

dre, or anybody, I'm looking for someone with some Flash coding experience. I've been playing around with a couple variants of an open source Flash MP3 player. There are two different versions which have slightly different feature sets. What I'd really like is one version that has all the features of both. However, I don't really know how to work with Flash code. Also, it would be great to have an interface more like the one you've come up with, dre. The interface for the player I'm using is pretty bland.

http://musicplayer.sourceforge.net/

The specific issues are that the above original version of the player doesn't support skipping around in a song, which I think is pretty important. It does support "radio mode", though, where the last track of a playlist can be a URL to another playlist, so that you can hook playlists together ad infinitum. This is necessary for something like a SongFight! radio player that streams sets of random songs from the archive, for example.

http://www.boutell.com/xspf/

This is an enhanced version, with skipping around in a track, better display of the time info, and shuffle and repeat. However it doesn't have the "radio mode" support for some reason. Also you can't disable shuffle/repeat, which would be necessary for radio mode.

EDIT: I'm going to investigate using Air:

http://labs.adobe.com/technologies/air/
Lunkhead
Gorilla
Posts: 6076
Joined: Sat Sep 25, 2004 12:14 pm
Instruments: many
Recording Method: cubase/reason/mac/tascam4x4
Submitting as: Berkeley Social Scene, Merisan, Tiny Robots
Pronouns: he/him
Location: Berkeley, CA
Contact:

Re: SongFight! Web Service

Post by Lunkhead » Fri Dec 11, 2009 10:09 am

I've got a new version of my unofficial SF! jukebox webapp up:

http://www.bozos.com/sf/

FIREFOX ONLY (the Flash MP3 player I use on the main pages doesn't seem to be able to play songs from the SF! archive in IE, unfortunately, and also the player that's used in the popup windows can't seem to load the songs anymore either even in FF)

It should be pretty straightforward for me to add XML and JSON output to this, at which point it will be a RESTful Web service for the archive data.
User avatar
Paco Del Stinko
Lemur
Posts: 3198
Joined: Fri Apr 07, 2006 11:20 am
Instruments: Basic rock, at a basic level.
Recording Method: Roland 2480
Submitting as: Paco del Stinko
Location: Massachusetts. God save the Commonwealth!

Re: SongFight! Web Service

Post by Paco Del Stinko » Fri Dec 11, 2009 10:30 am

I love the jukebox. I can't listen at work, but play it on random every Sunday while I iron clothes. If it could transmit to my car, I'd listen while driving, as you can not make me put the radio on. Anyway, good work, Sam!
Bringin' the stink since 2006.
Lunkhead
Gorilla
Posts: 6076
Joined: Sat Sep 25, 2004 12:14 pm
Instruments: many
Recording Method: cubase/reason/mac/tascam4x4
Submitting as: Berkeley Social Scene, Merisan, Tiny Robots
Pronouns: he/him
Location: Berkeley, CA
Contact:

Re: SongFight! Web Service

Post by Lunkhead » Sat Dec 12, 2009 1:34 pm

Thanks Paco! I'm glad to hear somebody else is using it. If you've got any feedback about it, or suggestions or bug reports, feel free to shoot me a PM or whatever.

I just added JSON output. Here are some example URLs, in case anybody wants to try doing some mashups:

http://www.bozos.com/sf/fights/.json?title=red+robot
http://www.bozos.com/sf/songs/.json?fig ... =red+robot
http://www.bozos.com/sf/artists/.json?a ... e=Lunkhead
http://www.bozos.com/sf/songs/.json?artistName=Lunkhead

This is now pretty much what I was describing in my first post in this thread. And it only took two years! ;)
HeuristicsInc
Gorilla
Posts: 5236
Joined: Sat Sep 25, 2004 6:14 pm
Instruments: Synths
Recording Method: Windows computer, Acid, Synths etc.
Submitting as: Heuristics Inc. (duh) + collabs
Location: Maryland USA
Contact:

Re: SongFight! Web Service

Post by HeuristicsInc » Sun Dec 13, 2009 9:20 am

my browser (firefox) wants me to save those files. is that expected behavior? i don't know json...
left hand type while young sir chews on my thumb
-bill

ps ah, a generic data interchange format
152612141617123326211316121416172329292119162316331829382412351416132117152332252921
http://heuristicsinc.com
Liner Notes
SF Lyric Ideas
Lunkhead
Gorilla
Posts: 6076
Joined: Sat Sep 25, 2004 12:14 pm
Instruments: many
Recording Method: cubase/reason/mac/tascam4x4
Submitting as: Berkeley Social Scene, Merisan, Tiny Robots
Pronouns: he/him
Location: Berkeley, CA
Contact:

Re: SongFight! Web Service

Post by Lunkhead » Sun Dec 13, 2009 10:09 am

That was the default behavior with the tools I used. I could probably change it, but those "pages" are not really meant for human consumption anyway. They're more for consumption by computer code.

JSON = JavaScript Object Notation, by the way. It's a data format that's very easy to consume using JavaScript, the programming language that runs natively in Web browsers. It's also become very popular as a simple lightweight format for data exchange on the Web (especially in "mashups" where somebody combines data from different sites in some novel way). You could now use those JSON links in Yahoo! Pipes, for example. http://pipes.yahoo.com/pipes/
Lunkhead
Gorilla
Posts: 6076
Joined: Sat Sep 25, 2004 12:14 pm
Instruments: many
Recording Method: cubase/reason/mac/tascam4x4
Submitting as: Berkeley Social Scene, Merisan, Tiny Robots
Pronouns: he/him
Location: Berkeley, CA
Contact:

Re: SongFight! Web Service

Post by Lunkhead » Tue Jan 12, 2010 11:27 pm

In case anybody noticed it I just fixed the problem with the popup window mp3 players on that site. They use the XSPF playlist format and I had forgotten to output the URLs for the songs in the .xspf playlists. Oops! So the players would appear to load normally but none of the songs would play. Fixed now...
User avatar
Ross
Chimpanzee
Posts: 2730
Joined: Sun Feb 27, 2005 3:27 pm
Instruments: Guitar, Vox, Bass, Tuned glasses, etc...
Recording Method: Logic on a Macbook.
Submitting as: Ross Durand
Location: Orange CA
Contact:

Re: SongFight! Web Service

Post by Ross » Tue Jan 12, 2010 11:49 pm

Funny - I was just there 2 days ago and noticed I couldn't get it to play. I figured it had to do with chrome and left.
"I don't like this song, but at least it's good." - veGetar Ianra Ge
http://www.rossdurandmusic.com
Lunkhead
Gorilla
Posts: 6076
Joined: Sat Sep 25, 2004 12:14 pm
Instruments: many
Recording Method: cubase/reason/mac/tascam4x4
Submitting as: Berkeley Social Scene, Merisan, Tiny Robots
Pronouns: he/him
Location: Berkeley, CA
Contact:

Re: SongFight! Web Service

Post by Lunkhead » Tue Feb 02, 2010 1:20 pm

I just updated my archive jukebox site in case anyone is interested. It's mostly an under-the-hood update to a new version of a code library I'm using, but I also added CSV output to the song, artist, and fight list pages, for those of you who might want to dump that data into Excel and have some fun with it. I also added m3u and xspf output to the song list page, so you can get a playlist of songs from search results (e.g. all the winning songs, all the songs with a certain number of votes, all songs in a certain date range, etc.). And now there is JSON output for all the lists and the individual artist and fight pages as well, for anybody wanting to use the data in a Web service or mashup.

Oh, I still have some data cleanup to do, doh. I forgot about that. I'll get to that at some point...

EDIT: My sites have been moved to spiffy new 2GHz quad-core servers with 8GB of RAM and 2TB RAIDs, so they should be a little zippier feeling. ;)

EDIT 2: Aargh, broke the mp3 player by accident, fixed.
Lunkhead
Gorilla
Posts: 6076
Joined: Sat Sep 25, 2004 12:14 pm
Instruments: many
Recording Method: cubase/reason/mac/tascam4x4
Submitting as: Berkeley Social Scene, Merisan, Tiny Robots
Pronouns: he/him
Location: Berkeley, CA
Contact:

Re: SongFight! Web Service

Post by Lunkhead » Sat Mar 06, 2010 12:41 pm

I changed the URLs for individual song pages from, for example:

http://www.bozos.com/sf/songs/fight/dou ... cial+Scene

... to, for example:

http://www.bozos.com/sf/songs/double_ta ... cial+Scene

I see in my logs some requests to the old URL format. Those are now returning an error as I did not put in backward compatibility, so whoever you are please update your bookmarks or links.

I also increased the width and font size of the MP3 player, and I added an option to have the player start playing automatically when the page loads by adding "?autoplay=1" to the URL, such as:

http://www.bozos.com/sf/songs/double_ta ... autoplay=1

I'm working on adding the ability to create an account with the site, log in, edit your account info, log out, retrieve a forgotten password, etc. Once that is done, I am aiming to add Twitter integration as the first feature available to people who sign up. You'll be able to tweet about individual songs at first, probably from the pop-up random player. I'm primarily doing this to make it easier for me to tweet songs I like to http://twitter.com/sfarchivist .
Post Reply