forked from DebaucheryLibrarian/traxxx
Added teaser support. Added Score network with scraper for Scoreland. Improved q. Added assets.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user