UserScript name Steam Check namespace http steamcommunity com version

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// ==UserScript==
// @name Steam Check
// @namespace http://steamcommunity.com/
// @version 0.1
// @author Efog
// @match http://steamcommunity.com/*
// @match https://steamcommunity.com/*
// @grant GM_xmlhttpRequest
// @grant GM_setClipboard
// ==/UserScript==
setTimeout(function() {
if (/steamcommunity\.com\/market\/listings\//gim.test(location.href)) {
var exterior = document.body.innerHTML.match(/<div class="descriptor">Exterior: (.+?)<\/div>/im)[1];
var block = document.querySelector("#largeiteminfo_item_name");
block.innerHTML += " (" + exterior + ")";
block.addEventListener("click", function () { GM_setClipboard(block.innerHTML); });
}
}, 20);
setInterval(function() {
var myid = document.body.innerHTML.match(/steamcommunity\.com\/id\/(.+?)\//im)[1];
GM_xmlhttpRequest({
url: "http://steamcommunity.com/id/" + myid + "/home/invites/",
method: "GET",
onload: function (data) {
data = data.responseText.replace(/(\r\n|\r|\n)/gim, "");
var page = new Image();
page.innerHTML = data;
if (/\/home\/invites\//gim.test(location.href))
document.querySelector("#BG_bottom").innerHTML = page.querySelector("#BG_bottom").innerHTML;
var invites = page.querySelectorAll(".invite_row");
if (invites.length > 0) {
for (var i = 0; i < invites.length; i++) {
var invite = invites[i];
var level = parseInt(invite.querySelector(".friendPlayerLevelNum").innerHTML);
if (level == 0) {
var links = invite.querySelectorAll("a");
for (var j = 0; j < links.length; j++) {
if (links[j].innerHTML == "Block")
links[j].click();
}
} else {
var inviteUrl = invite.querySelector(".linkTitle").href;
GM_xmlhttpRequest({
url: inviteUrl,
method: "GET",
onload: function (mydata) {
mydata = mydata.responseText.replace(/(\r\n|\r|\n)/gim, "");
var mypage = new Image();
page.innerHTML = mydata;
if (page.querySelectorAll(".profile_private_info").length > 0) {
var links = invite.querySelectorAll("a");
for (var j = 0; j < links.length; j++) {
if (links[j].innerHTML == "Block")
links[j].click();
}
}
}
});
}
}
}
var con = '<div id="header_notification_area">' + data.match(/<div id="header_notification_area">(.+?)<span class="pulldown global_action_link" id="account_pulldown"/im)[1];
document.querySelector("#header_notification_area").outerHTML = con;
var new_invites = data.match(/<a class="popup_menu_item header_notification_invites active_inbox_item" href="http:\/\/steamcommunity.com\/id\/efogtrader\/home\/invites\/">(.+?)<span class="notification_icon"><\/span>(.+?)<\/a>/im);
if (new_invites != undefined) {
var quantity = new_invites.last().split(" ").first();
GM_xmlhttpRequest({url: "http://steam.monitor/?invites=" + quantity, method: "GET"});
} else {
GM_xmlhttpRequest({url: "http://steam.monitor/?invites=" + 0, method: "GET"});
}
if (/<a class="popup_menu_item header_notification_tradeoffers active_inbox_item" href="http:\/\/steamcommunity.com\/id\/efogtrader\/tradeoffers\/">/gim.test(data)) {
GM_xmlhttpRequest({url: "http://steam.monitor/?offers=yes", method: "GET"});
} else {
GM_xmlhttpRequest({url: "http://steam.monitor/?offers=no", method: "GET"});
}
}
});
}, 3000);