steamutils 1.3.68 → 1.3.69
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 +38 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -6581,6 +6581,44 @@ export default class SteamUser {
|
|
|
6581
6581
|
}
|
|
6582
6582
|
return { error };
|
|
6583
6583
|
}
|
|
6584
|
+
|
|
6585
|
+
async getHelpRequests() {
|
|
6586
|
+
const result = await this._httpRequest({
|
|
6587
|
+
url: "https://help.steampowered.com/en/wizard/HelpRequests",
|
|
6588
|
+
});
|
|
6589
|
+
if (result instanceof ResponseError) {
|
|
6590
|
+
return result;
|
|
6591
|
+
}
|
|
6592
|
+
const $ = cheerio.load(result?.data);
|
|
6593
|
+
const help_request_table = $(".help_request_table");
|
|
6594
|
+
const help_request_row = [...help_request_table.find("a.help_request_row")].map(function (el) {
|
|
6595
|
+
el = $(el);
|
|
6596
|
+
const status = el.find(".help_request_columns .status").text();
|
|
6597
|
+
const link = el.attr("href");
|
|
6598
|
+
const title = el.find(".help_request_name").text().trim();
|
|
6599
|
+
const date_created = el.find(".help_request_columns .date_created").text().trim();
|
|
6600
|
+
return {
|
|
6601
|
+
status,
|
|
6602
|
+
link,
|
|
6603
|
+
title,
|
|
6604
|
+
date_created,
|
|
6605
|
+
};
|
|
6606
|
+
});
|
|
6607
|
+
|
|
6608
|
+
return help_request_row;
|
|
6609
|
+
}
|
|
6610
|
+
|
|
6611
|
+
async getHelpRequestDetail(url) {
|
|
6612
|
+
const result = await this._httpRequest({
|
|
6613
|
+
url,
|
|
6614
|
+
});
|
|
6615
|
+
if (result instanceof ResponseError) {
|
|
6616
|
+
return result;
|
|
6617
|
+
}
|
|
6618
|
+
const $ = cheerio.load(result?.data);
|
|
6619
|
+
const help_request_page = $(".help_request_page");
|
|
6620
|
+
return help_request_page.html();
|
|
6621
|
+
}
|
|
6584
6622
|
}
|
|
6585
6623
|
|
|
6586
6624
|
SteamUser.MAX_RETRY = 10;
|