Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2017
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Classifieds Extracter
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Extract all of the ncessary information from Classifieds as to create a suggestion with.
  6. // @author MenghFacepalms
  7. // @match http://backpack.tf/classifieds?item=*
  8. // @grant none
  9. // ==/UserScript==
  10. var shot = "<div id='simplify' style='width: 100%; min-height: 60px; background-color: white; padding: 20px; font-size: 12px; border-radius: 3px;'></div><br>";
  11. document.getElementById('page-content').insertAdjacentHTML("afterbegin", shot);
  12.  
  13. var check_sell = 1;
  14. var data2_check = -1;
  15. document.getElementById('simplify').innerHTML += "[b]Classifieds:[/b] " + window.location.href + "<br>";
  16. document.getElementById('simplify').innerHTML += "[b]Screenshot(s) of Classifieds:[/b] <br><br>";
  17. document.getElementById('simplify').innerHTML += "[b]&lt;Sellers&gt;[/b]<br>";
  18. for (i = 0; i < 20; i++) {
  19. var arrow = document.querySelectorAll('.fa-arrow-right , .fa-arrow-left')[i].className;
  20. if (arrow.indexOf('fa-arrow-left') > -1) {
  21. if (check_sell) {
  22. check_sell = 0;
  23. document.getElementById('simplify').innerHTML += "<br>[b]&lt;Buyers&gt;[/b]</br>";
  24. }
  25. }
  26. var price = document.getElementsByClassName('tag bottom-right')[i].textContent;
  27. document.getElementById('simplify').innerHTML += price + " | ";
  28. if (check_sell) {
  29. var item_history = document.querySelectorAll('.item')[i].getAttribute("data-original_id");
  30. document.getElementById('simplify').innerHTML += "http://backpack.tf/item/" + item_history + " | ";
  31. }
  32. var owner = document.getElementsByClassName('user-link')[i].getAttribute("data-id");
  33. document.getElementById('simplify').innerHTML += "http://backpack.tf/u/" + owner + " | ";
  34. var shown_time_text = document.querySelectorAll('span.text-muted')[i].className;
  35. if (shown_time_text.indexOf('click-data-toggle') > -1) {
  36. data2_check++;
  37. var listed_time = document.getElementsByClassName('data2')[data2_check].textContent;
  38. document.getElementById('simplify').innerHTML += listed_time + " [i][Bumped][/i] <br>";
  39. } else {
  40. var listing_time = document.querySelectorAll('.timeago')[i].textContent;
  41. document.getElementById('simplify').innerHTML += "Listed " + listing_time + "<br>";
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement