Displaying results in terminal table with select, scroll and experimental search. Expanded broken character handling for PervCity scraper.
This commit is contained in:
@@ -9,9 +9,9 @@ function scrape(html, site) {
|
||||
|
||||
const sceneLinkElement = $('#scene_title_border a');
|
||||
const url = `${site.url}/${sceneLinkElement.attr('href')}`;
|
||||
const title = sceneLinkElement.attr('title');
|
||||
const title = sceneLinkElement.attr('title').replace(/\u00E2\u0080\u0099/g, '\''); // replace weird apostrophes
|
||||
|
||||
const actors = $('.home_model_name a').toArray().map(element => $(element).text().replace(/,[\u0020\u00A0\u202F]/, ''));
|
||||
const actors = $('.home_model_name a').toArray().map(element => $(element).text().replace(/,[\u0020\u00A0\u202F]/, '')); // replace weird commas
|
||||
const date = moment.utc($('.add_date').text(), 'DD-MM-YYYY').toDate();
|
||||
|
||||
const stars = $('img[src*="/star.png"]').toArray().map(element => $(element).attr('src')).length || null;
|
||||
@@ -26,11 +26,10 @@ function scrape(html, site) {
|
||||
dislikes: null,
|
||||
stars,
|
||||
},
|
||||
siteId: site.id,
|
||||
site,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
async function fetchReleases(site) {
|
||||
// const session = bhttp.session();
|
||||
|
||||
@@ -39,9 +38,7 @@ async function fetchReleases(site) {
|
||||
|
||||
const latest = elements.total_arr.map(html => scrape(html, site));
|
||||
|
||||
return {
|
||||
latest,
|
||||
};
|
||||
return latest;
|
||||
}
|
||||
|
||||
module.exports = fetchReleases;
|
||||
|
||||
Reference in New Issue
Block a user