tiktok-stats
Advanced tools
Comparing version 1.7.1 to 1.7.2
const fetch = require('node-fetch'); | ||
const entities = require("entities"); | ||
module.exports.Stats = require('./src/stats'); |
{ | ||
"name": "tiktok-stats", | ||
"version": "1.7.1", | ||
"version": "1.7.2", | ||
"description": "This package gives you the statistics of which user tiktok !", | ||
@@ -17,4 +17,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"node-fetch": "^2.6.1" | ||
"node-fetch": "^2.6.1", | ||
"entities": "^2.2.0" | ||
} | ||
} |
@@ -62,2 +62,5 @@ # tiktok-stats | ||
● **Patch the bug with html entities.** | ||
## Credits | ||
@@ -64,0 +67,0 @@ Made by Pioupia with ❤️ |
const fetch = require('node-fetch'); | ||
const entities = require("entities"); | ||
@@ -32,17 +33,2 @@ module.exports = class Greeting { | ||
const entities = { | ||
" ": "", | ||
"<": "<", | ||
">": ">", | ||
"&": "&", | ||
""": '"', | ||
"'": "'", | ||
"¢": "¢", | ||
"£": "£", | ||
"¥": "¥", | ||
"€": "€", | ||
"©": "©", | ||
"®": "®" | ||
} | ||
fetch(`https://www.tiktok.com/@${this.user}?lang=fr`).then(res => res.text()).then(data => { | ||
@@ -116,21 +102,4 @@ if (!data || data == " ") { | ||
function entitiesDetect(data) { | ||
const entities = { | ||
" ": "", | ||
"<": "<", | ||
">": ">", | ||
"&": "&", | ||
""": '"', | ||
"'": "'", | ||
"¢": "¢", | ||
"£": "£", | ||
"¥": "¥", | ||
"€": "€", | ||
"©": "©", | ||
"®": "®" | ||
} | ||
data = entities.decodeHTML(data); | ||
for (const res in entities) { | ||
if (data.includes(res)) data = data.replace(res, entities[res]); | ||
} | ||
return data; | ||
@@ -137,0 +106,0 @@ } |
75
6485
2
93
+ Addedentities@^2.2.0
+ Addedentities@2.2.0(transitive)