Added teaser support. Added Score network with scraper for Scoreland. Improved q. Added assets.

This commit is contained in:
2020-02-02 05:14:58 +01:00
parent 14e5695b6e
commit a97c6defca
52 changed files with 4291 additions and 3435 deletions

View File

@@ -5,7 +5,7 @@ const bhttp = require('bhttp');
const { ex } = require('../utils/q');
function scrapeProfile(html) {
const { q, qa, qd, qi, qu } = ex(html); /* eslint-disable-line object-curly-newline */
const { q, qa, qd, qi, qus } = ex(html); /* eslint-disable-line object-curly-newline */
const profile = {};
const bio = qa('.infobox tr[valign="top"]')
@@ -59,19 +59,15 @@ function scrapeProfile(html) {
if (bio.Blood_group) profile.blood = bio.Blood_group;
if (bio.Also_known_as) profile.aliases = bio.Also_known_as.split(', ');
const avatars = qi('.image img');
const avatarThumbPath = qi('.image img');
if (avatars.length > 0) {
const [avatarThumbPath] = avatars;
if (avatarThumbPath && !/NoImageAvailable/.test(avatarThumbPath)) {
const avatarPath = avatarThumbPath.slice(0, avatarThumbPath.lastIndexOf('/')).replace('thumb/', '');
if (!/NoImageAvailable/.test(avatarThumbPath)) {
const avatarPath = avatarThumbPath.slice(0, avatarThumbPath.lastIndexOf('/')).replace('thumb/', '');
profile.avatar = `http://www.boobpedia.com${avatarPath}`;
}
profile.avatar = `http://www.boobpedia.com${avatarPath}`;
}
profile.social = qu('.infobox a.external');
profile.social = qus('.infobox a.external');
return profile;
}