-
Notifications
You must be signed in to change notification settings - Fork 9.5k
求添加Animen的RSS推送 #664
Copy link
Copy link
Closed
Labels
RSS proposalNew RSS wantedNew RSS wanted
Description
根据群里大佬的建议仿照sspai的js写了一个 但很奇怪的是和sspai都一样 在自己服务器上显示Not Found
实在没有能力只好在这里求添加Animen的RSS了
下面是自己写的js内容 但没有测试过...
网址:https://www.animen.com.tw/animen_web/web/news_index
麻烦了!谢谢!
以下为向router.js添加的内容
//Animen新闻
router.get('/animen/news',require('./routes/animen/news'));
以下为RSSHub/routes/animen/news.js的内容
const cheerio = require('cheerio');
const url = require('url');
module.exports = async (ctx) => {
const getPage = await require('../../utils/puppeteer');
const page = await getPage();
const link = 'https://www.animen.com.tw/animen_web/web/news_index';
await page.goto(link);
// eslint-disable-next-line no-undef
const html = await page.evaluate(() => document.querySelector('div.new-series-wrapper').innerHTML);
const $ = cheerio.load(html);
const list = $('div.col-md-6 col-sm-6 col-xs-12 one_listbox');
ctx.state.data = {
title: 'Animen 动漫新闻',
link,
description: 'Animen 动漫新闻',
item: list
.map((i, item) => ({
title: $(item)
.find('.title a')
.text()
.trim(),
link: url.resolve(
link,
$(item)
.find('.title a')
.attr('href')
),
/* author: $(item)
.find('.item-author')
.text()
.trim(), */
}))
.get(),
};
};
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
RSS proposalNew RSS wantedNew RSS wanted