Explocivo808

Steam Community Market Sales Script

Sep 19th, 2024
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Steam Market History Button
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Adds a button below steam market price graphs to open the sale json.
  6. // @author jh34ghu43gu
  7. // @match https://steamcommunity.com/market/listings/440/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @require http://code.jquery.com/jquery-latest.js
  10. // @require https://gist.github.com/raw/2625891/waitForKeyElements.js
  11. // @grant GM_getValue
  12. // ==/UserScript==
  13.  
  14. console.log("History Button Script Active");
  15.  
  16. var urlStart = "https://steamcommunity.com/market/pricehistory/?appid=440&market_hash_name=";
  17.  
  18. waitForKeyElements(".jqplot-target", addButton);
  19.  
  20. function addButton(jNode) {
  21. console.log(urlStart + document.getElementsByClassName("market_listing_nav")[0].childElements()[1].innerText);
  22. var button = document.createElement("a");
  23. button.href = urlStart + document.getElementsByClassName("market_listing_nav")[0].childElements()[1].innerText;
  24. button.id = "pricehistory_button";
  25. button.innerText = "Price History JSON";
  26. jNode[0].parentNode.insertBefore(document.createElement("br"), jNode[0]);
  27. jNode[0].parentNode.insertBefore(button, jNode[0]);
  28. }
Add Comment
Please, Sign In to add comment