steamutils 1.1.18 → 1.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +45 -0
- package/package.json +1 -1
package/index.js
CHANGED
@@ -18,6 +18,7 @@ import url from 'url'
|
|
18
18
|
import * as cherrio from "cheerio";
|
19
19
|
|
20
20
|
const MAX_RETRY = 10
|
21
|
+
let requestTimestamp = 0
|
21
22
|
export const MatchHistoryType = {
|
22
23
|
matchhistoryscrimmage: 'matchhistoryscrimmage',
|
23
24
|
matchhistorycompetitive: 'matchhistorycompetitive',
|
@@ -1502,6 +1503,14 @@ class SteamUser {
|
|
1502
1503
|
maxRedirects: 0,
|
1503
1504
|
url: redirectURL || params.url
|
1504
1505
|
}
|
1506
|
+
|
1507
|
+
|
1508
|
+
let now = 0
|
1509
|
+
let diff = 0
|
1510
|
+
while ((diff = (now = new Date().getTime()) - requestTimestamp) < 200) {
|
1511
|
+
await sleep(diff + 50)
|
1512
|
+
}
|
1513
|
+
requestTimestamp = new Date().getTime()
|
1505
1514
|
response = await axios.request(config)
|
1506
1515
|
|
1507
1516
|
this._cookies.setCookies(response.headers["set-cookie"])
|
@@ -5077,6 +5086,39 @@ class SteamUser {
|
|
5077
5086
|
case "Earned due to game play time": {
|
5078
5087
|
break
|
5079
5088
|
}
|
5089
|
+
case "Listed on the Steam Community Market": {
|
5090
|
+
break
|
5091
|
+
}
|
5092
|
+
case "Turned into Gems": {
|
5093
|
+
break
|
5094
|
+
}
|
5095
|
+
case "Unpacked a booster pack": {
|
5096
|
+
break
|
5097
|
+
}
|
5098
|
+
case "Purchased with Gems": {
|
5099
|
+
break
|
5100
|
+
}
|
5101
|
+
case "Unpacked Gems from Sack": {
|
5102
|
+
break
|
5103
|
+
}
|
5104
|
+
case "Earned by crafting": {
|
5105
|
+
break
|
5106
|
+
}
|
5107
|
+
case "Used": {
|
5108
|
+
break
|
5109
|
+
}
|
5110
|
+
case "Unsealed": {
|
5111
|
+
break
|
5112
|
+
}
|
5113
|
+
case "Earned by sale purchases": {
|
5114
|
+
break
|
5115
|
+
}
|
5116
|
+
case "Unlocked a container": {
|
5117
|
+
break
|
5118
|
+
}
|
5119
|
+
case "Purchased from the store": {
|
5120
|
+
break
|
5121
|
+
}
|
5080
5122
|
default: {
|
5081
5123
|
if (description.startsWith("You traded with ")) {
|
5082
5124
|
const peopleEl = tradehistory_event_description_el.find('a[href]')
|
@@ -5102,6 +5144,9 @@ class SteamUser {
|
|
5102
5144
|
} else if (description.startsWith("You listed an item on the Community Market. The listing was placed on hold until")) {
|
5103
5145
|
//You listed an item on the Community Market. The listing was placed on hold until 24 Jan @ 3:06am.
|
5104
5146
|
description = "You listed an item on the Community Market. The listing was placed on hold until"
|
5147
|
+
} else if (description.startsWith("Earned in ")) {
|
5148
|
+
//Earned in PUBG: BATTLEGROUNDS
|
5149
|
+
description = "Earned in game"
|
5105
5150
|
} else {
|
5106
5151
|
console.log(description);
|
5107
5152
|
}
|