Created
December 8, 2010 20:35
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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