Skip to content

Instantly share code, notes, and snippets.

@edgargoncalves
Created December 8, 2010 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edgargoncalves/733874 to your computer and use it in GitHub Desktop.
Save edgargoncalves/733874 to your computer and use it in GitHub Desktop.
Userscript to search for videoclips of the currently playing song on youtube, on 'v' keypress
// ==UserScript==
// @name Grooveshark Videoclip lookup
// @namespace http://sites.google.com/site/edgargoncalves/
// @description Searches for videoclips of the currently playing song on youtube, on 'v' keypress
// @include http://listen.grooveshark.com/*
// ==/UserScript==
function getNowPlaying(e){
if (e.which === 86) { // 'v'
var row = $("#playerDetails_nowPlaying");
if (row.children().length === 0)
return false;
var song = $("a.song", row).text();
var artist = $("a.artist", row).text();
var album = $("a.album", row).text();
if (confirm("Search for videclips for '"+ song + "', from " + artist + "?")) {
window.open("http://www.youtube.com/results?search_query="+ song
+"+" + artist + "&aq=f");
return true;
}
};
return false;
}
$(document).keyup(getNowPlaying);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment