SingSnap Duet Finder

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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;
        } 
    }
}
)();