Now Playing for Grooveshark Desktop

By aimeels on Jul 10, 2010

This NP script will read the currentSong.txt file that Grooveshark Desktop generates, and output to an IRC channel.

USAGE:
.np (Returns the active playing song from Grooveshark)
.np(off/on) (Sets a timer to automatically scan for changes to the song and messages the channel if the song changes)

HOW TO:

  1. To use this script, simply load it. (/load -rs X:\Path\to\script.mrc)
  2. Change the path to currentSong.txt within the script.
    That file can be found in one of two locations, depending on OS:
    XP: X:\Documents and Settings(Your User\My Documents\Grooveshark\
    Vista/7: X:\Users(Your User)\Documents\Grooveshark\

To modify the output, modify this line of code in your file:
msg $chan [Grooveshark] %np.artist with %np.song from %np.album

Where %np.artist is the artist, %np.song is the song name and %np.album is the album name.

DEPENDENCIES:

  • You MUST have an active Grooveshark Anywhere account.
  • Adobe AIR is required to use Grooveshark Desktop.

If you need support, please see Ae6 or Konata @ ##mirc on freenode.

;----------------------------------------------------------------------------------------------------;
;- AimeeGSNP.mrc - Aimee's Grooveshark Nowplaying script
;- This script will parse a Grooveshark currentsong.txt file, and post the results in the channel.
;- script will post each song only once, and allows for automatic posting of new songs.
;-
;- made in ##mirc on irc.freenode.net by AeSix for Aimee - modifications welcome!
;-
;- REMEMBER TO EDIT THE DIRECTORY PATH TO THE LOCATION OF currentSong.txt !!!!!!
;----------------------------------------------------------------------------------------------------;

on 1:TEXT:.np*:#:{
  if ( $1 == .np ) {
    .nowplaying
  }
  if ( $1 == .npon ) {
    .nowplaying
    .timernowplaying1 0 10 .nowplaying
  }
  if ( $1 == .npoff ) {
    .timernowplaying1 off
  }
}
alias nowplaying {
  ;- change C:\path\to\currentSong.txt to your path - can this be fixed to be universal?
  var %x = $qt(C:\path\to\currentSong.txt)
  if ( $token($read(%x,1),1,9) $+ . $+ $token($read(%x,1),3,9) != %np.song $+ . $+ %np.artist ) {
    set %np.artist $token($read(%x,1),3,9)
    set %np.song $token($read(%x,1),1,9)
    set %np.album $token($read(%x,1),2,9)
    msg $chan [Grooveshark] %np.artist with %np.song from %np.album
  }
  elseif ( $token($read(%x,1),1,9) $+ . $+ $token($read(%x,1),3,9) == %np.song $+ . $+ %np.artist ) {
    halt
  }
}

Comments

Sign in to comment.
carmellia   -  Dec 18, 2011

PS: I would like it if we could also type !song and it would show Artist-Song that is playing whether we have a live dj or if it is auto dj.

 Respond  
carmellia   -  Dec 18, 2011

Is there a way you could write this so that it would show what song SAM Broadcaster is playing? I've asked for help with a script I can put in my bot to show what songs either myself or my dj's are playing in the rooms the bot is in but so far have had no luck getting help.

Thank you.

 Respond  
WorldDMT   -  Jul 12, 2010

;- change C:\path\to\currentSong.txt to your path - can this be fixed to be universal?
use $scriptdir

u can use tokenize 9 $read(%x,1)

the elseif is useless u can use only else halt or remove it

so i think your code can be like this

on *:TEXT:*:#:{
  if ($strip($1) == .np) .nowplaying
  elseif $istok(.npon|.npoff,$strip($1),124) {
    .timernowplaying1 $iif($strip($1) == .npon,0 10 .nowplaying,off)
    if ($strip($1) == .npon) .nowplaying
  }
}
alias nowplaying {
  tokenize 9 $read($qt($scriptdircurrentSong.txt),1)
  if $1 $3 != %np.song %np.artist {
    set %np.artist $3
    set %np.song $1
    set %np.album $2
    msg # [Grooveshark] %np.artist with %np.song from %np.album
  }
}
 Respond  
Jethro   -  Jul 10, 2010

You must be an oldie. The $token identifier has been superseded by $gettok(), but they're the same.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.