Sleazy Fork is available in English.

hash2magnet for hacg

琉璃神社hash转磁链

Version vom 28.01.2015. Aktuellste Version

// ==UserScript==
// @name        hash2magnet for hacg
// @namespace   https://greasyfork.org/zh-CN/scripts/7762
// @description 琉璃神社hash转磁链
// @author      http://t.qq.com/HeartBlade
// @include     http://www.hacg.in/wordpress/*
// @include     http://www.hacg.me/wordpress/*
// @include     http://hacg.riwee.com/wordpress/*
// @version     1.0
// @grant       none
// ==/UserScript==
(function(){
	var oldDriver = document.getElementsByClassName('entry-content')[0];
	var regArray=[/(\w{40})()/,/(\w{5,})\W{14,16}(\w{5,})/];
	var magnetLink="<a href='magnet:?xt=urn:btih:$1$2'>磁链:$1$2</a>";
	var txt=oldDriver.innerHTML.toString();
	for(i in regArray){
		txt=txt.replace(regArray[i],magnetLink);
	}
	oldDriver.innerHTML=txt;
})();