steamutils 1.0.47 → 1.0.49

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.
Files changed (3) hide show
  1. package/example.js +1 -0
  2. package/index.js +18 -0
  3. package/package.json +1 -1
package/example.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import SteamUser from "./index.js";
2
+ import Steamutils from "./index.js";
2
3
 
3
4
  (async function () {
4
5
  const loginResult = await SteamUser.communityLogin({
package/index.js CHANGED
@@ -4363,6 +4363,24 @@ class SteamUser {
4363
4363
  daysSinceLastBan
4364
4364
  }
4365
4365
  }
4366
+
4367
+ async getAccountEmail() {
4368
+ const result = await this._httpRequest('https://store.steampowered.com/account/')
4369
+ if (!result.data) {
4370
+ return
4371
+ }
4372
+ const $ = result._$()
4373
+ let email = ''
4374
+ $('.account_setting_block').each(function () {
4375
+ if (email) return
4376
+ const account_setting_block = $(this)
4377
+ const account_data_field = account_setting_block.find('.account_manage_label + span.account_data_field')
4378
+ if (account_data_field.prev().text()?.trim() == 'Email address:') {
4379
+ email = account_data_field.text()
4380
+ }
4381
+ })
4382
+ return email
4383
+ }
4366
4384
  }
4367
4385
 
4368
4386
  export default SteamUser
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "dependencies": {
5
5
  "axios": "^1.3.4",
6
6
  "cheerio": "^1.0.0-rc.12",