2019-03-24 04:28:18 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
/* eslint-disable */
|
|
|
|
const bhttp = require('bhttp');
|
|
|
|
const cheerio = require('cheerio');
|
|
|
|
const moment = require('moment');
|
|
|
|
|
2019-04-01 00:45:15 +00:00
|
|
|
const { matchTags } = require('../tags');
|
2019-03-24 04:28:18 +00:00
|
|
|
|
|
|
|
function scrapeLatest(html, site) {
|
|
|
|
const $ = cheerio.load(html, { normalizeWhitespace: true });
|
|
|
|
}
|
|
|
|
|
|
|
|
function scrapeUpcoming(html, site) {
|
|
|
|
const $ = cheerio.load(html, { normalizeWhitespace: true });
|
|
|
|
}
|
|
|
|
|
|
|
|
function scrapeScene(html, url, site) {
|
|
|
|
const $ = cheerio.load(html, { normalizeWhitespace: true });
|
|
|
|
}
|
|
|
|
|
|
|
|
async function fetchLatest(site) {
|
|
|
|
const res = await bhttp.get(`${site.url}/url`);
|
|
|
|
|
|
|
|
return scrapeLatest(res.body.toString(), site);
|
|
|
|
}
|
|
|
|
|
|
|
|
async function fetchUpcoming(site) {
|
|
|
|
const res = await bhttp.get(`${site.url}/url`);
|
|
|
|
|
|
|
|
return scrapeUpcoming(res.body.toString(), site);
|
|
|
|
}
|
|
|
|
|
|
|
|
async function fetchScene(url, site) {
|
|
|
|
const res = await bhttp.get(url);
|
|
|
|
|
|
|
|
return scrapeScene(res.body.toString(), url, site);
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
fetchLatest,
|
|
|
|
fetchUpcoming,
|
|
|
|
fetchScene,
|
|
|
|
};
|