Add Xiaomi.eu (#1580)
This commit is contained in:
parent
e1d91a591e
commit
a4db3d51b6
|
|
@ -1318,6 +1318,10 @@ GitHub 官方也提供了一些 RSS:
|
|||
|
||||
<route name="镜像有新 Build" author="HenryQW" example="/dockerhub/build/wangqiru/ttrss" path="/dockerhub/build/:owner/:image/:tag?" :paramsDesc="['镜像作者', '镜像名称', '镜像标签,默认 latest']"/>
|
||||
|
||||
### Xiaomi.eu
|
||||
|
||||
<route name="ROM Releases" author="maple3142" example="/xiaomieu/releases" path="/xiaomieu/releases"/>
|
||||
|
||||
## 大学通知
|
||||
|
||||
### 上海海事大学
|
||||
|
|
|
|||
|
|
@ -1068,6 +1068,9 @@ router.get('/hupu/bxj/:id/:order?', require('./routes/hupu/bxj'));
|
|||
// 牛客网
|
||||
router.get('/nowcoder/discuss/:type/:order', require('./routes/nowcoder/discuss'));
|
||||
|
||||
// Xiaomi.eu
|
||||
router.get('/xiaomieu/releases', require('./routes/xiaomieu/releases'));
|
||||
|
||||
// 每日安全
|
||||
router.get('/security/pulses', require('./routes/security/pulses'));
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
const axios = require('../../utils/axios');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const res = await axios.get('https://xiaomi.eu/community/forums/miui-rom-releases.103/');
|
||||
const $ = cheerio.load(res.data);
|
||||
const threads = await Promise.all(
|
||||
$('.structItem--thread')
|
||||
.map(async (idx, th) => {
|
||||
const $th = $(th);
|
||||
const $ver = $th.find('.structItem-title>a:nth-child(1)');
|
||||
const $title = $th.find('.structItem-title>a:nth-child(2)');
|
||||
const title = `[${$ver.text()}] ${$title.text()}`;
|
||||
const link = `https://xiaomi.eu${$title.attr('href')}`;
|
||||
const res = await axios.get(link);
|
||||
const $$ = cheerio.load(res.data);
|
||||
const description = $$('.bbWrapper').html();
|
||||
const pubDate = new Date($$('time').attr('datetime')).toUTCString();
|
||||
return { title, description, link, pubDate };
|
||||
})
|
||||
.toArray()
|
||||
);
|
||||
ctx.state.data = {
|
||||
title: 'Xiaomi.eu ROM Releases',
|
||||
link: 'https://xiaomi.eu/community/forums/miui-rom-releases.103/',
|
||||
item: threads,
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue