Pound Adopt Linker

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

当前为 2015-06-20 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Pound Adopt Linker
  3. // @version 0.0.1
  4. // @description When you adopt a adoptable, it links to the adoptable page.
  5. // @author Seiryuu
  6. // @author Richard Min
  7. // @match http://*.clickcritters.com/pound.php?act=adopt*
  8. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js
  9. // @namespace https://greasyfork.org/users/12560
  10. // ==/UserScript==
  11. var f = $("td:contains('from your account and given you the following adoptable:')"); //find the div where the image is located
  12.  
  13.  
  14. if(f.length) //if the page is the adopt page
  15. {
  16. var img = f.find('img');
  17. var id = img.attr('src');
  18. id = id.substring(47,id.length-4); //extract the adopt id
  19.  
  20. var url = '<a href="http://www.clickcritters.com/youradoptables.php?act=code&id='+id+'">'+'</a>';
  21. img.wrap(url);
  22.  
  23. }