Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Classifieds Extracter
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description Extract all of the ncessary information from Classifieds as to create a suggestion with.
- // @author MenghFacepalms
- // @match http://backpack.tf/classifieds?item=*
- // @grant none
- // ==/UserScript==
- var shot = "<div id='simplify' style='width: 100%; min-height: 60px; background-color: white; padding: 20px; font-size: 12px; border-radius: 3px;'></div><br>";
- document.getElementById('page-content').insertAdjacentHTML("afterbegin", shot);
- var check_sell = 1;
- var data2_check = -1;
- document.getElementById('simplify').innerHTML += "[b]Classifieds:[/b] " + window.location.href + "<br>";
- document.getElementById('simplify').innerHTML += "[b]Screenshot(s) of Classifieds:[/b] <br><br>";
- document.getElementById('simplify').innerHTML += "[b]<Sellers>[/b]<br>";
- for (i = 0; i < 20; i++) {
- var arrow = document.querySelectorAll('.fa-arrow-right , .fa-arrow-left')[i].className;
- if (arrow.indexOf('fa-arrow-left') > -1) {
- if (check_sell) {
- check_sell = 0;
- document.getElementById('simplify').innerHTML += "<br>[b]<Buyers>[/b]</br>";
- }
- }
- var price = document.getElementsByClassName('tag bottom-right')[i].textContent;
- document.getElementById('simplify').innerHTML += price + " | ";
- if (check_sell) {
- var item_history = document.querySelectorAll('.item')[i].getAttribute("data-original_id");
- document.getElementById('simplify').innerHTML += "http://backpack.tf/item/" + item_history + " | ";
- }
- var owner = document.getElementsByClassName('user-link')[i].getAttribute("data-id");
- document.getElementById('simplify').innerHTML += "http://backpack.tf/u/" + owner + " | ";
- var shown_time_text = document.querySelectorAll('span.text-muted')[i].className;
- if (shown_time_text.indexOf('click-data-toggle') > -1) {
- data2_check++;
- var listed_time = document.getElementsByClassName('data2')[data2_check].textContent;
- document.getElementById('simplify').innerHTML += listed_time + " [i][Bumped][/i] <br>";
- } else {
- var listing_time = document.querySelectorAll('.timeago')[i].textContent;
- document.getElementById('simplify').innerHTML += "Listed " + listing_time + "<br>";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement