Pound Adopt Linker

When you adopt a adoptable, it links to the adoptable page.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Pound Adopt Linker
// @version      0.0.1
// @description  When you adopt a adoptable, it links to the adoptable page.
// @author 		 Seiryuu
// @author       Richard Min
// @match        http://*.clickcritters.com/pound.php?act=adopt*
// @require       http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js
// @namespace https://greasyfork.org/users/12560
// ==/UserScript==
var f = $("td:contains('from your account and given you the following adoptable:')"); //find the div where the image is located


if(f.length) //if the page is the adopt page
{
	var img = f.find('img');
	var id = img.attr('src');
	id = id.substring(47,id.length-4); //extract the adopt id

	var url = '<a href="http://www.clickcritters.com/youradoptables.php?act=code&id='+id+'">'+'</a>';
	img.wrap(url);

}