osrs-json-hiscores 2.10.1 → 2.11.0

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![npm](https://img.shields.io/npm/v/osrs-json-hiscores.svg?style=flat-square)](https://www.npmjs.com/package/osrs-json-hiscores)
4
4
  [![downloads](https://img.shields.io/npm/dm/osrs-json-hiscores.svg?style=flat-square)](https://npm-stat.com/charts.html?package=osrs-json-hiscores)
5
5
  [![types](https://img.shields.io/npm/types/osrs-json-hiscores.svg?style=flat-square)](https://github.com/maxswa/osrs-json-hiscores/blob/master/src/types.ts)
6
- [![build](https://img.shields.io/github/workflow/status/maxswa/osrs-json-hiscores/CI?style=flat-square)](https://github.com/maxswa/osrs-json-hiscores/actions/workflows/main.yml?query=branch%3Amain)
6
+ [![build](https://img.shields.io/github/actions/workflow/status/maxswa/osrs-json-hiscores/main.yml?style=flat-square&branch=main)](https://github.com/maxswa/osrs-json-hiscores/actions/workflows/main.yml?query=branch%3Amain)
7
7
 
8
8
  **The Old School Runescape API wrapper that does more!**
9
9
 
@@ -154,6 +154,7 @@ Activities consist of all levels of clue scrolls as well as minigames and bosses
154
154
  | The Nightmare of Ashihama | `nightmare` |
155
155
  | Phosani's Nightmare | `phosanisNightmare` |
156
156
  | Obor | `obor` |
157
+ | Phantom Muspah | `phantomMuspah` |
157
158
  | Sarachnis | `sarachnis` |
158
159
  | Scorpia | `scorpia` |
159
160
  | Skotizo | `skotizo` |
package/lib/hiscores.js CHANGED
@@ -58,7 +58,7 @@ var utils_1 = require("./utils");
58
58
  */
59
59
  function getRSNFormat(rsn) {
60
60
  return __awaiter(this, void 0, void 0, function () {
61
- var url, response, dom, spans, nameSpan, _a;
61
+ var url, response, dom, anchor, _a;
62
62
  return __generator(this, function (_b) {
63
63
  switch (_b.label) {
64
64
  case 0:
@@ -79,10 +79,9 @@ function getRSNFormat(rsn) {
79
79
  case 2:
80
80
  response = _b.sent();
81
81
  dom = new jsdom_1.JSDOM(response.data);
82
- spans = dom.window.document.querySelectorAll('span[style="color:#AA0022;"]');
83
- if (spans.length >= 2) {
84
- nameSpan = spans[1];
85
- return [2 /*return*/, utils_1.rsnFromElement(nameSpan)];
82
+ anchor = dom.window.document.querySelector('.personal-hiscores__row.personal-hiscores__row--type-highlight a');
83
+ if (anchor) {
84
+ return [2 /*return*/, utils_1.rsnFromElement(anchor)];
86
85
  }
87
86
  throw Error('Player not found');
88
87
  case 3:
@@ -105,7 +104,8 @@ function parseStats(csv) {
105
104
  .split('\n')
106
105
  .filter(function (entry) { return !!entry; })
107
106
  .map(function (stat) { return stat.split(','); });
108
- if (splitCSV.length !== utils_1.SKILLS.length + utils_1.BH_MODES.length + utils_1.CLUES.length + utils_1.BOSSES.length + 5) {
107
+ if (splitCSV.length !==
108
+ utils_1.SKILLS.length + utils_1.BH_MODES.length + utils_1.CLUES.length + utils_1.BOSSES.length + 5) {
109
109
  throw Error(utils_1.INVALID_FORMAT_ERROR);
110
110
  }
111
111
  var skillObjects = splitCSV
package/lib/types.d.ts CHANGED
@@ -20,7 +20,7 @@ export declare type BHType = 'rogue' | 'hunter';
20
20
  export declare type BH = {
21
21
  [Type in BHType]: Activity;
22
22
  };
23
- export declare type Boss = 'abyssalSire' | 'alchemicalHydra' | 'barrows' | 'bryophyta' | 'callisto' | 'cerberus' | 'chambersOfXeric' | 'chambersOfXericChallengeMode' | 'chaosElemental' | 'chaosFanatic' | 'commanderZilyana' | 'corporealBeast' | 'crazyArchaeologist' | 'dagannothPrime' | 'dagannothRex' | 'dagannothSupreme' | 'derangedArchaeologist' | 'generalGraardor' | 'giantMole' | 'grotesqueGuardians' | 'hespori' | 'kalphiteQueen' | 'kingBlackDragon' | 'kraken' | 'kreeArra' | 'krilTsutsaroth' | 'mimic' | 'nex' | 'nightmare' | 'phosanisNightmare' | 'obor' | 'sarachnis' | 'scorpia' | 'skotizo' | 'tempoross' | 'gauntlet' | 'corruptedGauntlet' | 'theatreOfBlood' | 'theatreOfBloodHardMode' | 'thermonuclearSmokeDevil' | 'tombsOfAmascut' | 'tombsOfAmascutExpertMode' | 'tzKalZuk' | 'tzTokJad' | 'venenatis' | 'vetion' | 'vorkath' | 'wintertodt' | 'zalcano' | 'zulrah';
23
+ export declare type Boss = 'abyssalSire' | 'alchemicalHydra' | 'barrows' | 'bryophyta' | 'callisto' | 'cerberus' | 'chambersOfXeric' | 'chambersOfXericChallengeMode' | 'chaosElemental' | 'chaosFanatic' | 'commanderZilyana' | 'corporealBeast' | 'crazyArchaeologist' | 'dagannothPrime' | 'dagannothRex' | 'dagannothSupreme' | 'derangedArchaeologist' | 'generalGraardor' | 'giantMole' | 'grotesqueGuardians' | 'hespori' | 'kalphiteQueen' | 'kingBlackDragon' | 'kraken' | 'kreeArra' | 'krilTsutsaroth' | 'mimic' | 'nex' | 'nightmare' | 'phosanisNightmare' | 'obor' | 'phantomMuspah' | 'sarachnis' | 'scorpia' | 'skotizo' | 'tempoross' | 'gauntlet' | 'corruptedGauntlet' | 'theatreOfBlood' | 'theatreOfBloodHardMode' | 'thermonuclearSmokeDevil' | 'tombsOfAmascut' | 'tombsOfAmascutExpertMode' | 'tzKalZuk' | 'tzTokJad' | 'venenatis' | 'vetion' | 'vorkath' | 'wintertodt' | 'zalcano' | 'zulrah';
24
24
  export declare type Bosses = {
25
25
  [Type in Boss]: Activity;
26
26
  };
@@ -95,6 +95,7 @@ exports.BOSSES = [
95
95
  'nightmare',
96
96
  'phosanisNightmare',
97
97
  'obor',
98
+ 'phantomMuspah',
98
99
  'sarachnis',
99
100
  'scorpia',
100
101
  'skotizo',
@@ -163,6 +164,7 @@ exports.FORMATTED_BOSS_NAMES = {
163
164
  nightmare: 'The Nightmare of Ashihama',
164
165
  phosanisNightmare: "Phosani's Nightmare",
165
166
  obor: 'Obor',
167
+ phantomMuspah: 'Phantom Muspah',
166
168
  sarachnis: 'Sarachnis',
167
169
  scorpia: 'Scorpia',
168
170
  skotizo: 'Skotizo',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osrs-json-hiscores",
3
- "version": "2.10.1",
3
+ "version": "2.11.0",
4
4
  "description": "The Old School Runescape API wrapper that does more!",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",