Skip to content

Instantly share code, notes, and snippets.

@DioVayne
Last active August 29, 2015 14:24
Show Gist options
  • Save DioVayne/db7f3779bf511b844d5f to your computer and use it in GitHub Desktop.
Save DioVayne/db7f3779bf511b844d5f to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name What CD video/ last.fm search
// @namespace http://diovayne.nl/
// @version 0.31
// @description To directly search for video on google of the album or artist on last.fm
// @author Dio Vayne
// @match https://what.cd/*
// @grant none
// ==/UserScript==
$('.dioSearchAlbum').remove();
$('.group_info').each(function(){
var vT = $(this);
var vArtist = encodeURIComponent(vT.find('strong').first().find('a').first().text());
var vAlbum = encodeURIComponent(vT.find('strong').first().find('a:nth-child(2)').text());
vT.append("<a class='dioSearchAlbum' target='_blank' href='https://www.google.nl/search?q=\""+vArtist+"\"+\""+vAlbum+"\"+album&tbm=vid'>search video</a> | <a class='dioSearchLastfm' target='_blank' href='http://www.last.fm/music/"+vArtist+"'>search last.fm</a>");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment