1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Author: Gustavo Gonçalves

(function() {
var fogapp = new fogger.Fogger();
var started = 0;

var setupFogger = function(fogapp) {

  fogapp.quicklist.addItem({name: 'Play/Pause', callback: function() { window.Grooveshark.togglePlayPause() }});
  fogapp.quicklist.addItem({name: 'Next', callback: function() { window.Grooveshark.next() }});
  fogapp.quicklist.addItem({name: 'Previous', callback: function() { window.Grooveshark.previous() }});
 
  window.Grooveshark.setSongStatusCallback(songstatus);

  //removing the ads 
  //--> insert here the code for remove ads (For me it's not necessary)

  started = 1;
}; //setup Fogger

function songstatus(currentStatus, playingOnly) {
   var song = currentStatus.song;
   var status = currentStatus.status;

   if (status == 'playing') { fogapp.notify(song.artistName, song.songName); };
   if (status == 'completed') { fogapp.notify('Grooveshark', 'The current list ended'); };
};

function loadscript() {
   if(window.Grooveshark) {
      if (started==0) {
         setupFogger(fogapp); 
       }
   } else { 
      setTimeout(loadscript, 1000);
   }
};

loadscript();

})();