RSS
 

Attn Hackers: Opening up Grooveshark

21 Dec

At Grooveshark, we get a lot of requests for features that aren’t possible to create in Adobe Flash/Flex/Air or that we just plain don’t have time to do.

In that vein, we’re working on opening up Grooveshark to make it a bit more extensible.

The first thing we’re doing is making the player status really easy to get to. People want their chat clients to be able to reflect what’s playing in the status when they are listening to the desktop app. We can’t do that through AIR directly, and we’re not going to have time to learn about and write special code for each chat client out there, but now anyone who already knows about that stuff or just really wants to put the time into it can do it.
There is a file that we are storing in documentsDirectory\Grooveshark\currentSong.txt
documentsDirectory is defined by Adobe to be the current users’ documents directory. In windows that’s %HOMEPATH%\Documents\Grooveshark\currentSong.txt

The format of the file is pretty obvious if you open it up, but I’ll spell it out here:
SongName\tAlbumName\tArtistName\tStatus
where \t is a hard tab (note: names are guaranteed not to have tabs in them)
Valid statuses are “playing,” “paused” and “stopped” – we may add others later if it makes sense to do so. Note that if a user clears their queue or quits Grooveshark, the last song to play will still be listed with a status of “stopped”.

Other ways we plan to open up Grooveshark to 3rd party developers includes creating an external interface through javascript for the web client so people can make Firefox or Chromium extensions to control playback, and creating something similar that can allow the desktop app to accept connections from 3rd party apps running on the desktop alongside, so for example someone could write a plugin that registers global keybaord shortcuts for play/pause, back and next. Again, AIR will not allow us to register those shortcuts directly.

 
 

Leave a Reply

 

 
  1. glow

    December 25, 2009 at 7:56 am

    This is wonderful news! Maybe now i’ll be finally able to hack something up to scrobble the stuff i play on grooveshark to my last.fm profile.
    Oh, and Merry Christmas!

     
  2. Jay

    December 26, 2009 at 1:42 am

    Merry Christmas to you too. :)

    I wouldn’t work toooo hard on making a scrobbler, we have working scrobbling code in the app now, the only piece missing (aside from lots of testing) is a UI to control the settings.

    Of course it’s still low on the priority list as far as the boss is concerned, so I still don’t know when it will be *done*, but just a heads up so you don’t spend a couple of weeks writing a really nice scrobbler. ;)

     
  3. noiz

    December 30, 2009 at 3:17 am

    I too would like a temporary solution to scrobble all the songs that I play on grooveshark even if you guys are working up an official way to do that. Scrobbling is one of the things that holds me back from using grooveshark even more and if I could get something working that would be great. Also, I’m able to find the file on my windows machine, but can’t for the life of me find where the file is store on my linux machine, any ideas?

     
  4. Mic

    January 9, 2010 at 11:16 am

    Are you planning to publish that file (currentSong.txt), for any user, in the api path (api.grooveshark…) or anywhere else? (So also non-vip can have they status up?).

    @noiz: in this post they tolk about my scrobbler, it’s far from being perfect but you can try it! (as a plus, you don’t need command-line interaction as they wrote)

     
  5. Jay

    January 10, 2010 at 3:05 am

    At this time there are no plans to do something like that (our servers are a bit overloaded as it is). To be honest last.fm scrobbling will probably be pushed out before we have a chance to add that functionality.

    Of course either way the feature will start out as VIP-only because all new features start out that way and only get released to the general public when we have something even more awesome to release to our VIP users.

     
  6. Keyboard Shortcuts for Grooveshark Desktop « Jay Paroline – Grooveshark Dev

    June 5, 2010 at 1:45 am

    […] a further effort to open Grooveshark to 3rd party developers, we have added an External Player Control API. (Side note: yes, it’s a hack to be polling a […]

     
  7. Justin

    December 22, 2010 at 1:52 am

    So where does this leave me for wanting to write a command line client for grooveshark? Would the javascript interface allow for adding songs, searching, etc? Or will it only accept player controls?

     
  8. Jay

    December 22, 2010 at 4:32 am

    Justin,

    You can remotely control the desktop app through a console application or anything else you wish to develop, by simply writing to a file. See:
    http://grooveshark.wikia.com/wiki/External_Player_Control_API_Docs

    I don’t know of any way to allow OS console -> site communication without a custom plugin, but there is a JS API for controlling the site from a plugin, so theoretically you could develop such a thing.

     
  9. Diego Peralta

    February 2, 2011 at 12:46 am

    Hey Jay,

    I made a small script on ruby for mac os x users that allow you to update your IM status (Adium or iChat) with the current song of Grooveshark: https://github.com/kerberoS/Grooveshark-Status-AIM.

    I hope you like it!

    Cheers,

     
  10. Jay

    February 2, 2011 at 3:14 am

    Awesome, thanks for sharing! :)

     
  11. Diego Peralta

    February 2, 2011 at 3:36 pm

    Your welcome!

     
  12. MusicMan

    March 16, 2011 at 11:37 pm

    Thanks for the informative blog. How can we get the recently streamed items with the new html5 player?