getHiscores now returns rsns with spaces

This commit is contained in:
maxswa
2018-05-15 17:51:33 -04:00
parent 969f6e8d90
commit dda170ac38

View File

@@ -188,7 +188,7 @@ async function getHiscores (mode, category, page) {
players.push({
category: category,
rank: attributes[0].innerHTML.slice(1, -1),
rsn: attributes[1].childNodes[1].innerHTML,
rsn: attributes[1].childNodes[1].innerHTML.replace(/\uFFFD/g, ' '),
level: attributes[2].innerHTML.slice(1, -1),
xp: attributes[3].innerHTML.slice(1, -1),
mode: mode
@@ -198,7 +198,7 @@ async function getHiscores (mode, category, page) {
players.push({
category: category,
rank: attributes[0].innerHTML.slice(1, -1),
rsn: attributes[1].childNodes[1].innerHTML,
rsn: attributes[1].childNodes[1].innerHTML.replace(/\uFFFD/g, ' '),
score: attributes[2].innerHTML.slice(1, -1),
mode: mode
})
@@ -291,4 +291,7 @@ let parseStats = (csv) => {
return stats
}
getHiscores('main', 'overall', 1)
.then(res => console.log(res))
module.exports = {getStats, getHiscores}