FDZ Get Free Space Links

// ==UserScript==
// @name           FDZ Get Free Space Links
// @description    抓取主題內免空連結
// @include        http://forum.*.fdzone.org/viewthread.php?tid=*
// @include        http://forum.fdzone.org/viewthread.php?tid=*
// ==/UserScript==
var LinkButton = document.createElement("a");
LinkButton.setAttribute("onclick", "getFreeSpaceLinks();");
LinkButton.setAttribute("style", "font-size:2em;font-weight:bold;position:fixed;right:50px;top:300px;");
LinkButton.innerHTML = "抓取免空連結";
document.getElementsByTagName("body")[0].appendChild(LinkButton);
var scriptElement = document.createElement('script');
scriptElement.type = 'text/javascript';
//注意"\n"跳脫字元,要取代成"\\n"
scriptElement.innerHTML = "function getFreeSpaceLinks(){var patt1=/j\.php.*(fileserve|multiupload|megaupload|filesonic|freakshare).*/gi;var tmp='';for(var i=0;i<document.links.length;i++){if(patt1.test(document.links[i].href)){tmp+=decodeURIComponent(document.links[i].href.match(patt1)[0].replace('j.php?u=',''))+'\\n';}}alert(tmp);}";
document.getElementsByTagName("head")[0].appendChild(scriptElement);