Added Bang! actor scraper. Fixed date interpolation. Showing date and age of death on profile (only if actor has already died).

This commit is contained in:
2020-05-17 04:59:09 +02:00
parent 7f86399033
commit f42ca7bd52
10 changed files with 183 additions and 18 deletions

View File

@@ -4,6 +4,7 @@
const { JSDOM } = require('jsdom');
const cheerio = require('cheerio');
const moment = require('moment');
// const bhttp = require('bhttp');
const { get } = require('../utils/http');
@@ -233,7 +234,26 @@ async function fetchScene(url, site) {
return res.code;
}
/* API protected
async function fetchProfile(actorName, scraperSlug, site) {
const session = bhttp.session();
await session.get(`https://tour.${site.slug}.com`);
const url = `https://tour.${site.slug}.com/search-preview`;
const res = await session.post(url, { q: actorName }, {
headers: {
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36',
origin: `https://tour.${site.slug}.com`,
},
});
console.log(res.body.toString());
}
*/
module.exports = {
fetchLatest,
// fetchProfile,
fetchScene,
};