您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds links to blip.fm for each song from the fm4.orf.at playlist and in the daily program/track summary
// ==UserScript== // @name blip.fm4 // @version 1.0 // @namespace http://alphabeter.at/greasemonkey // @include http://fm4.orf.at/* // @description Adds links to blip.fm for each song from the fm4.orf.at playlist and in the daily program/track summary // @grant none // ==/UserScript== (function () { // track service page if (document.URL.indexOf("/trackservicepopup")>0) { var els = document.getElementsByTagName('b'); for (i=0; i<els.length; i++) { song = els[i]; group = els[i].nextSibling.nextSibling.textContent; title = song.textContent; link = '<a href="http://blip.fm/home?q='+escape(group+" - "+title)+'">'; song.innerHTML=link+song.textContent+'</a>'; } } // all other fm4 pages including <td class="track"> else { //getElementsByClassName() var els = document.getElementsByClassName('title'); for (i=0; i<els.length; i++) { song = els[i]; if (song.nodeName!="TD") continue; group = song.previousSibling.previousSibling.textContent; title = song.textContent; //if parenthesis exist - remove pyear = title.lastIndexOf('('); if (pyear > 0 && pyear < title.lastIndexOf(')')) { title = title.substring(0,pyear); } link = '<a href="http://blip.fm/home?q='+escape(group+" - "+title)+'">'; song.innerHTML=link+song.textContent+'</a>'; } } })();