Files
RSSHub/lib/routes/iplay/home.js
T
Sukka d82847f541 style/chore(eslint): enforce new rules (#8040)
* style: prefer object shorthand syntax
* refactor: prefer Array#map over Array#forEach
* style: prefer arrow callback
* chore(eslint): update rules
* style: auto fix by eslint
2021-08-17 22:23:23 +08:00

27 lines
661 B
JavaScript

const got = require('@/utils/got');
const cheerio = require('cheerio');
const util = require('./utils');
module.exports = async (ctx) => {
const url = `https://www.iplaysoft.com/`;
const response = await got({
method: 'get',
url,
headers: {
Referer: url,
},
});
const $ = cheerio.load(response.data);
const list = $('#postlist .entry').get();
const result = await util.ProcessFeed(list, ctx.cache);
ctx.state.data = {
title: $('title').text().split('-')[0],
link: url,
description: $('meta[name="description"]').attr('content'),
item: result,
};
};