furtrack-api 1.0.1 → 1.0.2
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 +8 -1
- package/package.json +1 -1
- package/src/index.js +8 -1
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
An unofficial Node.js package for accessing the Furtrack API.
|
|
4
4
|
|
|
5
|
+
> ⚠️ **Warning**: This package was built by **reverse engineering the FurTrack frontend**, and it is a **best-effort implementation**. FurTrack's internal API may change at any time, which can cause this package to break or behave unexpectedly.
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
## Features
|
|
7
9
|
|
|
@@ -75,6 +77,11 @@ api.getAlbum('username', 'albumid').then(album => {
|
|
|
75
77
|
console.log(album)
|
|
76
78
|
})
|
|
77
79
|
|
|
80
|
+
// Fetch all tags
|
|
81
|
+
api.getTags().then(tags => {
|
|
82
|
+
console.log(tags);
|
|
83
|
+
})
|
|
84
|
+
|
|
78
85
|
```
|
|
79
86
|
|
|
80
87
|
Functions which return a list of arrays additional support a page argument, FurTrack generally paginates albums longer than 200 images, by default only the first page is retrieved.
|
|
@@ -94,4 +101,4 @@ const characters = FurtrackAPI.getTagsByType(tags, FurtrackAPI.TagTypes.Characte
|
|
|
94
101
|
|
|
95
102
|
---
|
|
96
103
|
|
|
97
|
-
MIT License © 2025 blumlaut
|
|
104
|
+
MIT License © 2025 blumlaut
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -29,6 +29,9 @@ const https = require('https');
|
|
|
29
29
|
* @param {Object} [options] - Additional fetch options.
|
|
30
30
|
* @returns {Promise<Object>} The parsed JSON response.
|
|
31
31
|
*
|
|
32
|
+
* @method getTags Fetches all tags from FurTrack.
|
|
33
|
+
* @returns {Promise<Object>} Tags data with success flag and tags array.
|
|
34
|
+
*
|
|
32
35
|
* @method getTag Fetches information about a specific tag.
|
|
33
36
|
* @param {string} tag - The tag to fetch.
|
|
34
37
|
* @returns {Promise<Object>} Tag information.
|
|
@@ -142,6 +145,10 @@ class FurtrackAPI {
|
|
|
142
145
|
return res.json();
|
|
143
146
|
}
|
|
144
147
|
|
|
148
|
+
getTags() {
|
|
149
|
+
return this.fetchJSON(`/get/tags/all`);
|
|
150
|
+
}
|
|
151
|
+
|
|
145
152
|
getTag(tag) {
|
|
146
153
|
return this.fetchJSON(`/get/index/${encodeURIComponent(tag)}`);
|
|
147
154
|
}
|
|
@@ -155,7 +162,7 @@ class FurtrackAPI {
|
|
|
155
162
|
}
|
|
156
163
|
|
|
157
164
|
async getPostsByTag(tag, page = 0) {
|
|
158
|
-
const response = await this.fetchJSON(`/
|
|
165
|
+
const response = await this.fetchJSON(`/view/index/${encodeURIComponent(tag)}${page > 0 ? `/${page}` : ''}`);
|
|
159
166
|
return response.posts || [];
|
|
160
167
|
}
|
|
161
168
|
|