Neopets - Add Shop Till

Adds amount of np in shop till to top of page

  1. // ==UserScript==
  2. // @name Neopets - Add Shop Till
  3. // @namespace userscripts.org
  4. // @description Adds amount of np in shop till to top of page
  5. // @include http://www.neopets.com/*
  6. // @include www.neopets.com/*
  7. // @include *neopets.com/*
  8. // @require http://code.jquery.com/jquery-latest.min.js
  9. // @version 1.5
  10. // ==/UserScript==
  11.  
  12. GM_xmlhttpRequest({
  13. method: "GET",
  14. url: "http://www.neopets.com/market.phtml?type=till",
  15. onload: function(response) {
  16. GM_setValue("tillSource",response.responseText);
  17. }
  18. });
  19.  
  20. $source = GM_getValue("tillSource");
  21.  
  22. $start = $source.indexOf("You currently have ");
  23. $start = $start + 19;
  24. $end = $source.indexOf(" in your till.");
  25.  
  26. $till = $source.substring($start,$end);
  27. $till = $till.replace('<b>','');
  28. $till = $till.replace(' NP</b>','');
  29.  
  30. $("span:contains('|'):eq(1)").prepend(" | ST: <a href='/market.phtml?type=till'>" + $till+ "</a> ");