SingSnap Duet Finder

Puts a link to the original recording allowing you to comment on it. Original recording opens in a new tab / window.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name		SingSnap Duet Finder
// @namespace	http://www.manlymen.org/
// @author		Anthony F. Miller
// @version		0.1
// @description	Puts a link to the original recording allowing you to comment on it.  Original recording opens in a new tab / window.
// @license		GNU GPL v3 (http://www.gnu.org/copyleft/gpl.html) 
// @match		http://www.singsnap.com/karaoke/record/record?duet_id=*
// ==/UserScript==

(function(){
    var recordURL = window.location.href;
    var recordURLArray = recordURL.split("?");
    for (var i=recordURLArray.length-1; i>0; i--) {
        urlElement = recordURLArray[i];
        // Only run this if it's a duet (has a duet ID)
        if(urlElement.search("duet_id") != -1) {
            urlElementArray=urlElement.split("=");
            duetID = urlElementArray[1]
            // Create the link
            var a = document.createElement('a');
            a.setAttribute('href','http://www.singsnap.com/karaoke/watchandlisten/play/' + duetID);
            a.innerHTML = 'Go to original link';
            a.target = '_blank';
            // Append the anchor to the chosen element ID
            document.getElementById('recording_step_display').appendChild(a);
            break;
        } 
    }
}
)();