Fix banner scraping

pull/73/head
MillenniumEarl 2021-03-02 21:09:33 +01:00
parent b9de6e1838
commit 0855e88550
1 changed files with 3 additions and 2 deletions

View File

@ -108,11 +108,11 @@ export default class PlatformUser {
if (htmlResponse.isSuccess()) { if (htmlResponse.isSuccess()) {
// Prepare cheerio // Prepare cheerio
const $ = cheerio.load(htmlResponse.value); const $ = cheerio.load(htmlResponse.value);
// Parse the elements // Parse the elements
this._name = $(MEMBER.NAME).text(); this._name = $(MEMBER.NAME).text();
this._title = $(MEMBER.TITLE).text(); this._title = $(MEMBER.TITLE).text();
this._banners = $(MEMBER.BANNERS).toArray().map((idx, el) => $(el).text().trim()).filter(el => !el); this._banners = $(MEMBER.BANNERS).toArray().map((el, idx) => $(el).text().trim()).filter(el => el);
this._avatar = $(MEMBER.AVATAR).attr("src"); this._avatar = $(MEMBER.AVATAR).attr("src");
this._followed = $(MEMBER.FOLLOWED).text() === "Unfollow"; this._followed = $(MEMBER.FOLLOWED).text() === "Unfollow";
this._ignored = $(MEMBER.IGNORED).text() === "Unignore"; this._ignored = $(MEMBER.IGNORED).text() === "Unignore";
@ -136,4 +136,5 @@ export default class PlatformUser {
} }
//#endregion Public method //#endregion Public method
} }