gj-boomlings-api 0.2.0 → 0.3.0

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/README.md CHANGED
@@ -10,7 +10,7 @@ So basically this function downloads the entire level and converts the response
10
10
 
11
11
  ```js
12
12
  const gd = require("gj-boomlings-api");
13
- gd.dlLevel(58825144).then(console.log);
13
+ gd.dlLevel(58825144).then(console.log); // returns "xo"
14
14
  ```
15
15
 
16
16
  Returns:
@@ -59,7 +59,7 @@ With this function, you can get somebody's profile info. You can use a player ID
59
59
 
60
60
  ```js
61
61
  const gd = require("gj-boomlings-api");
62
- gd.getProfile(16).then(console.log);
62
+ gd.getProfile(16).then(console.log); // returns RobTop's info
63
63
  ```
64
64
 
65
65
  Returns:
@@ -86,48 +86,8 @@ Returns:
86
86
  }
87
87
  ```
88
88
 
89
- ### getSongInfo(song)
89
+ Check out [docs](./docs/) for more info.
90
90
 
91
- With this function, you can get an info about a custom song by its ID (but only if it's on Newgrounds).
92
-
93
- ```js
94
- const gd = require("gj-boomlings-api");
95
- gd.getSongInfo(1099128).then(console.log);
96
- ```
97
-
98
- Returns:
99
-
100
- ```
101
- {
102
- name: 'Dynamics',
103
- id: 1099128,
104
- artist: 'shikoshib',
105
- artistId: 10001037,
106
- fileSize: '5.74 MB',
107
- link: 'https://audio.ngfiles.com/1099000/1099128_Dynamics.mp3?f1640426773'
108
- }
109
- ```
110
-
111
- ### getOfficialSongInfo(song)
112
-
113
- Basically the same thing as ```getSongInfo()```, but for official songs.
114
-
115
- ```js
116
- const gd = require("gj-boomlings-api");
117
- const song = gd.getOfficialSongInfo(14);
118
- console.log(song);
119
- ```
120
-
121
- Returns:
122
-
123
- ```
124
- {
125
- name: 'Clubstep',
126
- id: 'Level 14',
127
- artist: 'DJ-Nate',
128
- fileSize: '0 MB',
129
- link: 'https://www.newgrounds.com/audio/listen/396093'
130
- }
131
- ```
91
+ ---
132
92
 
133
93
  Inspired by [GDBrowser](https://github.com/GDColon/GDBrowser/). Thanks to [Wireshark](https://www.wireshark.org/) and [GDDocs](https://github.com/gd-programming/gd.docs/) for helping me in creating this package.
package/config.json CHANGED
@@ -1 +1 @@
1
- {"headers":{"Content-Type":"application/x-www-form-urlencoded","user-agent":""}}
1
+ {"headers":{"Content-Type":"application/x-www-form-urlencoded","user-agent":"","Accept-Encoding":"*","Accept":"*/*"},"server":"http://www.boomlings.com/database/"}
@@ -0,0 +1,52 @@
1
+ # dlLevel()
2
+
3
+ Downloads a level and decodes it.
4
+
5
+ ## Parameters
6
+ `level` - the level ID.
7
+
8
+ ## Example
9
+ ```js
10
+ const gd = require("gj-boomlings-api");
11
+ gd.dlLevel(58825144).then(console.log);
12
+ ```
13
+
14
+ ## Response
15
+ ```
16
+ {
17
+ id: 58825144,
18
+ name: 'xo',
19
+ description: 'stream vertigo',
20
+ creator: 'KrmaL',
21
+ level_version: 2,
22
+ difficulty: 'Extreme Demon',
23
+ stars: 10,
24
+ downloads: 2587512,
25
+ likes: 106611,
26
+ disliked: false,
27
+ length: 'XL',
28
+ password: '000007',
29
+ demon: true,
30
+ featured: false,
31
+ epic: false,
32
+ objects: 37838,
33
+ uploaded: '2 years',
34
+ updated: '2 years',
35
+ stars_requested: 10,
36
+ game_version: '2.1',
37
+ ldm: false,
38
+ copied: 0,
39
+ two_p: false,
40
+ coins: 0,
41
+ verified_coins: false,
42
+ song: {
43
+ name: 'XO (Eden Cover & Remake)',
44
+ id: 766165,
45
+ artist: 'aaronmusslewhite',
46
+ artistId: 2130,
47
+ fileSize: '6.1 MB',
48
+ link: 'http://audio.ngfiles.com/766000/766165_XO-Eden-Cover-amp-Remake.mp3'
49
+ }
50
+ }
51
+ ```
52
+ Returns a [level object](./objects/level.md).
@@ -0,0 +1,121 @@
1
+ # getCommentHistory()
2
+
3
+ Gets a comment history from a specified player.
4
+
5
+ ## Parameters
6
+ `user` - the player's username or a player ID.
7
+ `page` (optional) - the page of the comment history. Defaults to 1.
8
+ `mode` (optional) - the mode of fetching the comment history. `1` is the most liked and `0` is the most recent. Defaults to 1.
9
+
10
+ ## Example
11
+ ```js
12
+ const gd = require("gj-boomlings-api");
13
+ gd.getCommentHistory("robtop").then(console.log);
14
+ ```
15
+
16
+ ## Response
17
+ ```
18
+ [
19
+ {
20
+ username: 'RobTop',
21
+ content: 'Like or dislike this comment, it will add 10 likes either way. Check. Mate.',
22
+ levelID: 66715392,
23
+ playerID: 16,
24
+ likes: 733980,
25
+ percent: 0,
26
+ id: 11005139,
27
+ age: '1 year'
28
+ },
29
+ {
30
+ username: 'RobTop',
31
+ content: 'Can you handle the Kappa?',
32
+ levelID: 7485599,
33
+ playerID: 16,
34
+ likes: 115556,
35
+ percent: 0,
36
+ id: 42602304,
37
+ age: '5 years'
38
+ },
39
+ {
40
+ username: 'RobTop',
41
+ content: 'All demons default to hard when first rated, they get the real rating from votes later :)',
42
+ levelID: 42584142,
43
+ playerID: 16,
44
+ likes: 72069,
45
+ percent: 0,
46
+ id: 12967791,
47
+ age: '4 years'
48
+ },
49
+ {
50
+ username: 'RobTop',
51
+ content: ':)',
52
+ levelID: 10565740,
53
+ playerID: 16,
54
+ likes: 57919,
55
+ percent: 0,
56
+ id: 53363972,
57
+ age: '5 years'
58
+ },
59
+ {
60
+ username: 'RobTop',
61
+ content: 'Love it :)',
62
+ levelID: 29424929,
63
+ playerID: 16,
64
+ likes: 55456,
65
+ percent: 0,
66
+ id: 42731804,
67
+ age: '5 years'
68
+ },
69
+ {
70
+ username: 'RobTop',
71
+ content: 'Good enough for me Kappa',
72
+ levelID: 26681070,
73
+ playerID: 16,
74
+ likes: 51795,
75
+ percent: 1,
76
+ id: 53375227,
77
+ age: '5 years'
78
+ },
79
+ {
80
+ username: 'RobTop',
81
+ content: 'Getting 7 stars doesnt exclude it from the gauntlet competition dont worry :)',
82
+ levelID: 43908596,
83
+ playerID: 16,
84
+ likes: 43546,
85
+ percent: 0,
86
+ id: 15614671,
87
+ age: '4 years'
88
+ },
89
+ {
90
+ username: 'RobTop',
91
+ content: 'I like this level, you guys prefer newer ones? Almost felt like putting Nine Circles :D',
92
+ levelID: 17235008,
93
+ playerID: 16,
94
+ likes: 38313,
95
+ percent: 0,
96
+ id: 61915039,
97
+ age: '4 years'
98
+ },
99
+ {
100
+ username: 'RobTop',
101
+ content: 'Kappa',
102
+ levelID: 19759411,
103
+ playerID: 16,
104
+ likes: 37952,
105
+ percent: 0,
106
+ id: 22802511,
107
+ age: '6 years'
108
+ },
109
+ {
110
+ username: 'RobTop',
111
+ content: 'You know you are getting old when you can only get 2% on an easy demon',
112
+ levelID: 27690100,
113
+ playerID: 16,
114
+ likes: 37144,
115
+ percent: 2,
116
+ id: 87255259,
117
+ age: '1 year'
118
+ }
119
+ ]
120
+ ```
121
+ Returns an array of [comment objects](./objects/comment.md).
@@ -0,0 +1,111 @@
1
+ # getComments()
2
+
3
+ Gets a list of comments from a specified level.
4
+
5
+ ## Parameters
6
+ `level` - the level whose comments we want to check.
7
+ `page` (optional) - the page of the comments. Defaults to 1.
8
+ `mode` (optional) - the mode of fetching the comments. `1` is the most liked and `0` is the most recent. Defaults to 1.
9
+
10
+ ## Example
11
+ ```js
12
+ const gd = require("gj-boomlings-api");
13
+ gd.getComments(42584142).then(console.log);
14
+ ```
15
+
16
+ ## Response
17
+ ```
18
+ [
19
+ {
20
+ username: 'RobTop',
21
+ content: 'All demons default to hard when first rated, they get the real rating from votes later :)',
22
+ playerID: 16,
23
+ likes: 72069,
24
+ percent: 0,
25
+ id: 12967791,
26
+ age: '4 years'
27
+ },
28
+ {
29
+ username: 'Knobbelboy',
30
+ content: 'IT IS FINALLY OVER!!!!!!!!!!!!!! THIS IS IT!!! THANK YOU ALL!!!!',
31
+ playerID: 4214375,
32
+ likes: 71760,
33
+ percent: 0,
34
+ id: 12958654,
35
+ age: '4 years'
36
+ },
37
+ {
38
+ username: 'shaggy23',
39
+ content: 'Zobros: Easy Insane 9',
40
+ playerID: 1995959,
41
+ likes: 31953,
42
+ percent: 0,
43
+ id: 12968377,
44
+ age: '4 years'
45
+ },
46
+ {
47
+ username: 'IInfinityy',
48
+ content: "pro tip : don't play bloodlust on phone",
49
+ playerID: 15630652,
50
+ likes: 30194,
51
+ percent: 1,
52
+ id: 12960792,
53
+ age: '4 years'
54
+ },
55
+ {
56
+ username: 'RobTop',
57
+ content: '1% :O :O :O :O',
58
+ playerID: 16,
59
+ likes: 29497,
60
+ percent: 0,
61
+ id: 16183012,
62
+ age: '4 years'
63
+ },
64
+ {
65
+ username: 'AdvyStyles',
66
+ content: 'ok',
67
+ playerID: 2434963,
68
+ likes: 16910,
69
+ percent: 0,
70
+ id: 13190982,
71
+ age: '4 years'
72
+ },
73
+ {
74
+ username: 'SerSerpent',
75
+ content: 'Guess now Knobbelboy evolved to Knobbelman',
76
+ playerID: 19203596,
77
+ likes: 15362,
78
+ percent: 0,
79
+ id: 12962171,
80
+ age: '4 years'
81
+ },
82
+ {
83
+ username: 'GDWindex',
84
+ content: 'Pass is 121296, now like this comment so others can see',
85
+ playerID: 78434904,
86
+ likes: 14567,
87
+ percent: 0,
88
+ id: 13250862,
89
+ age: '4 years'
90
+ },
91
+ {
92
+ username: 'Juniper',
93
+ content: 'PRESS F TO RESPECT THE H*CK OUT OF KNOBBELBOY',
94
+ playerID: 2614903,
95
+ likes: 14115,
96
+ percent: 0,
97
+ id: 12970170,
98
+ age: '4 years'
99
+ },
100
+ {
101
+ username: 'lSunix',
102
+ content: 'aoc',
103
+ playerID: 14251090,
104
+ likes: 6437,
105
+ percent: 100,
106
+ id: 14252314,
107
+ age: '4 years'
108
+ }
109
+ ]
110
+ ```
111
+ Returns an array of [comment objects](./objects/comment.md).
@@ -0,0 +1,17 @@
1
+ # getDailyLevel()
2
+
3
+ Downloads a daily level and decodes it.
4
+
5
+ ## Parameters
6
+ No parameters!
7
+
8
+ ## Example
9
+ ```js
10
+ const gd = require("gj-boomlings-api");
11
+ gd.getDailyLevel().then(console.log);
12
+ ```
13
+
14
+ ## Response
15
+ Returns a [level object](./objects/level.md).
16
+
17
+ Basically it's same thing as `dlLevel()`, but for daily levels.
@@ -0,0 +1,80 @@
1
+ # getGauntlets()
2
+
3
+ Gets the list of gauntlets and decodes it.
4
+
5
+ ## Parameters
6
+ No parameters!
7
+
8
+ ## Example
9
+ ```js
10
+ const gd = require("gj-boomlings-api");
11
+ gd.getGauntlets().then(console.log);
12
+ ```
13
+
14
+ ## Response
15
+ ```
16
+ [
17
+ {
18
+ name: 'Fire Gauntlet',
19
+ levels: [ '27732941', '28200611', '27483789', '28225110', '27448202' ]
20
+ },
21
+ {
22
+ name: 'Ice Gauntlet',
23
+ levels: [ '20635816', '28151870', '25969464', '24302376', '27399722' ]
24
+ },
25
+ {
26
+ name: 'Poison Gauntlet',
27
+ levels: [ '28179535', '29094196', '29071134', '26317634', '12107595' ]
28
+ },
29
+ {
30
+ name: 'Shadow Gauntlet',
31
+ levels: [ '26949498', '26095850', '27973097', '27694897', '26070995' ]
32
+ },
33
+ {
34
+ name: 'Lava Gauntlet',
35
+ levels: [ '18533341', '28794068', '28127292', '4243988', '28677296' ]
36
+ },
37
+ {
38
+ name: 'Bonus Gauntlet',
39
+ levels: [ '28255647', '27929950', '16437345', '28270854', '29394058' ]
40
+ },
41
+ {
42
+ name: 'Chaos Gauntlet',
43
+ levels: [ '25886024', '4259126', '26897899', '7485599', '19862531' ]
44
+ },
45
+ {
46
+ name: 'Demon Gauntlet',
47
+ levels: [ '18025697', '23189196', '27786218', '27728679', '25706351' ]
48
+ },
49
+ {
50
+ name: 'Time Gauntlet',
51
+ levels: [ '40638411', '32614529', '31037168', '40937291', '35165900' ]
52
+ },
53
+ {
54
+ name: 'Crystal Gauntlet',
55
+ levels: [ '37188385', '35280911', '37187779', '36301959', '36792656' ]
56
+ },
57
+ {
58
+ name: 'Magic Gauntlet',
59
+ levels: [ '37269362', '29416734', '36997718', '39853981', '39853458' ]
60
+ },
61
+ {
62
+ {
63
+ name: 'Monster Gauntlet',
64
+ levels: [ '43908596', '41736289', '42843431', '44063088', '44131636' ]
65
+ },
66
+ {
67
+ name: 'Doom Gauntlet',
68
+ levels: [ '38427291', '38514054', '36966088', '38398923', '36745142' ]
69
+ },
70
+ {
71
+ name: 'Death Gauntlet',
72
+ levels: [ '44121158', '43923301', '43537990', '33244195', '35418014' ]
73
+ }
74
+ ]
75
+ ```
76
+ This function returns an array of gauntlets.
77
+
78
+ ### Properties
79
+ `name` - the gauntlet name.
80
+ `levels` - the array of levels in a gauntlet.
@@ -0,0 +1,25 @@
1
+ # getOfficialSongInfo()
2
+
3
+ Gets an info about an official song by its ID.
4
+
5
+ ## Parameters
6
+ `song` - the official song ID.
7
+
8
+ ## Example
9
+ ```js
10
+ const gd = require("gj-boomlings-api");
11
+ const song = gd.getOfficialSongInfo(14);
12
+ console.log(song);
13
+ ```
14
+
15
+ ## Response
16
+ ```
17
+ {
18
+ name: 'Clubstep',
19
+ id: 'Level 14',
20
+ artist: 'DJ-Nate',
21
+ link: 'https://www.newgrounds.com/audio/listen/396093'
22
+ }
23
+ ```
24
+
25
+ Returns a [song object](./objects/song.md), except for the `artistId` and `fileSize` properties.
@@ -0,0 +1,36 @@
1
+ # getProfile()
2
+
3
+ Gets someone's profile and decodes it.
4
+
5
+ ## Parameters
6
+ `user` - the player's username or a player ID.
7
+
8
+ ## Example
9
+ ```js
10
+ const gd = require("gj-boomlings-api");
11
+ gd.getProfile("robtop").then(console.log);
12
+ ```
13
+
14
+ ## Response
15
+ ```
16
+ {
17
+ username: 'RobTop',
18
+ playerID: 16,
19
+ accountID: 71,
20
+ rank: 219796,
21
+ stars: 2375,
22
+ diamonds: 2170,
23
+ secretCoins: 3,
24
+ userCoins: 140,
25
+ demons: 5,
26
+ creatorPoints: 0,
27
+ messages: 'none',
28
+ friendRequests: 'none',
29
+ commentHistory: 'all',
30
+ mod: 'elder',
31
+ youtube: 'https://youtube.com/channel/UCz_yk8mDSAnxJq0ar66L4sw',
32
+ twitter: 'https://twitter.com/RobTopGames',
33
+ twitch: 'https://twitch.tv/robtopgames'
34
+ }
35
+ ```
36
+ Returns a [user object](./objects/user.md).
@@ -0,0 +1,26 @@
1
+ # getSongInfo()
2
+
3
+ Gets a song on Newgrounds by its ID and returns info about it.
4
+
5
+ ## Parameters
6
+ `song` - the song ID.
7
+
8
+ ## Example
9
+ ```js
10
+ const gd = require("gj-boomlings-api");
11
+ gd.getSongInfo(1099128).then(console.log);
12
+ ```
13
+
14
+ ## Response
15
+ ```
16
+ {
17
+ name: 'Dynamics',
18
+ id: 1099128,
19
+ artist: 'shikoshib',
20
+ artistId: 10001037,
21
+ fileSize: '5.74 MB',
22
+ link: 'https://audio.ngfiles.com/1099000/1099128_Dynamics.mp3?f1640426773'
23
+ }
24
+ ```
25
+
26
+ Returns a [song object](./objects/song.md).
@@ -0,0 +1,17 @@
1
+ # getWeeklyDemon()
2
+
3
+ Downloads a weekly demon and decodes it.
4
+
5
+ ## Parameters
6
+ No parameters!
7
+
8
+ ## Example
9
+ ```js
10
+ const gd = require("gj-boomlings-api");
11
+ gd.getWeeklyDemon().then(console.log);
12
+ ```
13
+
14
+ ## Response
15
+ Returns a [level object](./objects/level.md).
16
+
17
+ Basically it's same thing as `dlLevel()`, but for weekly demons.
@@ -0,0 +1,27 @@
1
+ # Comment object
2
+
3
+ Used by `getComments()` and `getCommentHistory()`.
4
+
5
+ ## Example
6
+ ```
7
+ {
8
+ username: 'RobTop',
9
+ content: ':)',
10
+ levelID: 10565740,
11
+ playerID: 16,
12
+ likes: 57919,
13
+ percent: 0,
14
+ id: 53363972,
15
+ age: '5 years'
16
+ }
17
+ ```
18
+
19
+ ## Properties
20
+ ```username``` - the comment author's username.
21
+ ```content``` - the actual content of a comment.
22
+ ```levelID``` - the ID of a level, on which the comment was sent.
23
+ ```playerID``` - the comment author's player ID.
24
+ ```likes``` - the amount of likes on a comment.
25
+ ```percent``` - the percentage that has been put on this comment. Returns `0` if the percentage checkbox hadn't been checked.
26
+ ```id``` - the ID of a comment.
27
+ ```age``` - the age of a comment.
@@ -0,0 +1,70 @@
1
+ # Level object
2
+
3
+ Used by ```dlLevel()```.
4
+
5
+ ## Example
6
+ ```
7
+ {
8
+ id: 58825144,
9
+ name: 'xo',
10
+ description: 'stream vertigo',
11
+ creator: 'KrmaL',
12
+ level_version: 2,
13
+ difficulty: 'Extreme Demon',
14
+ stars: 10,
15
+ downloads: 2587512,
16
+ likes: 106611,
17
+ disliked: false,
18
+ length: 'XL',
19
+ password: '000007',
20
+ demon: true,
21
+ featured: false,
22
+ epic: false,
23
+ objects: 37838,
24
+ uploaded: '2 years',
25
+ updated: '2 years',
26
+ stars_requested: 10,
27
+ game_version: '2.1',
28
+ ldm: false,
29
+ copied: 0,
30
+ two_p: false,
31
+ coins: 0,
32
+ verified_coins: false,
33
+ song: {
34
+ name: 'XO (Eden Cover & Remake)',
35
+ id: 766165,
36
+ artist: 'aaronmusslewhite',
37
+ artistId: 2130,
38
+ fileSize: '6.1 MB',
39
+ link: 'http://audio.ngfiles.com/766000/766165_XO-Eden-Cover-amp-Remake.mp3'
40
+ }
41
+ }
42
+ ```
43
+
44
+ ## Properties
45
+ ```id``` - the level ID.
46
+ ```name``` - the level name.
47
+ ```description``` - the level description.
48
+ ```creator``` - the level creator.
49
+ ```level_version``` - the version of a level.
50
+ ```difficulty``` - the level difficulty.
51
+ ```stars``` - the amount of stars you get from beating the level.
52
+ ```downloads``` - the amount of level downloads.
53
+ ```likes``` - the amount of level likes.
54
+ ```disliked``` - a boolean that shows if the level is disliked. Returns ```true``` if the like amount is negative, otherwise it's ```false```.
55
+ ```length``` - the level length.
56
+ ```password``` - the level password. It may return ```'Non-copyable'``` if the level is not copyable, or ```'1'``` if the level is free to copy.
57
+ ```demon``` - a boolean that shows if the level is demon.
58
+ ```featured``` - a boolean that shows if the level has been featured.
59
+ ```epic``` - a boolean that shows if the level is epic-rated.
60
+ ```objects``` - the amount of level objects. However, this property has a cap of 65535 objects (it's RobTop's problem).
61
+ ```uploaded``` - when the level has been uploaded.
62
+ ```updated``` - when the level has been last updated.
63
+ ```stars_requested``` - basically how many stars the creator has requested. Returns ```0``` if no stars have been requested.
64
+ ```game_version``` - the version required to play the level.
65
+ ```ldm``` - a boolean that shows if the level has a "Low Detail Mode" checkbox.
66
+ ```copied``` - the original level ID, that got copied. Returns ```0``` if the level is already original.
67
+ ```two_p``` - a boolean that shows if the level is in the 2-player mode.
68
+ ```coins``` - the amount of coins in the level.
69
+ ```verified_coins``` - a boolean that shows if the coins are verified (silver coins).
70
+ ```song``` - a [song object](./song.md).
@@ -0,0 +1,23 @@
1
+ # Song object
2
+
3
+ Used by `getOfficialSongInfo()` and `getSongInfo()`.
4
+
5
+ ## Example
6
+ ```
7
+ {
8
+ name: 'Dynamics',
9
+ id: 1099128,
10
+ artist: 'shikoshib',
11
+ artistId: 10001037,
12
+ fileSize: '5.74 MB',
13
+ link: 'https://audio.ngfiles.com/1099000/1099128_Dynamics.mp3?f1640426773'
14
+ }
15
+ ```
16
+
17
+ ## Properties
18
+ ```name``` - the song name.
19
+ ```id``` - the song ID.
20
+ ```artist``` - the song artist.
21
+ ```artistId``` - the artist's Newgrounds ID.
22
+ ```fileSize``` - the size of the song in megabytes, rounded to two decimals.
23
+ ```link``` - the link to a file of the song.