Add image for anigamer,apkpure and facebook (#1274)
This commit is contained in:
parent
3713d33cae
commit
a1e8632d1f
|
|
@ -5,7 +5,7 @@ module.exports = async (ctx) => {
|
|||
ctx.state.data = {
|
||||
title: anime.title,
|
||||
link: `https://ani.gamer.com.tw/animeRef.php?sn=${anime.anime_sn}`,
|
||||
description: anime.content,
|
||||
description: `<img src="${anime.cover}"> ` + anime.content.trim(),
|
||||
item: anime.volumes[0].map((item) => ({
|
||||
title: `${anime.title} 第 ${item.volume} 集`,
|
||||
link: `https://ani.gamer.com.tw/animeVideo.php?sn=${item.video_sn}`,
|
||||
|
|
|
|||
|
|
@ -8,11 +8,13 @@ module.exports = async (ctx) => {
|
|||
let $ = await axios.get(`${prefix}/search?q=${pkg}`).then((r) => cheerio.load(r.data));
|
||||
const apppage = $('.search-title:nth-child(1)>a').attr('href');
|
||||
const link = `https://apkpure.com${apppage}/versions`;
|
||||
console.log(link);
|
||||
|
||||
$ = await axios.get(link).then((r) => cheerio.load(r.data));
|
||||
const img = new URL($('.ver-top img').attr('src'));
|
||||
img.searchParams.delete('w'); // get full resolution icon
|
||||
ctx.state.data = {
|
||||
title: $('.ver-top-h1').text(),
|
||||
description: $('.ver-top-title>h2').text(),
|
||||
description: `<img src="${img.href}"> ` + $('.ver-top-title>h2').text(),
|
||||
link: decodeURI(link),
|
||||
item: $('.ver li')
|
||||
.toArray()
|
||||
|
|
|
|||
|
|
@ -10,6 +10,12 @@ module.exports = async (url) => {
|
|||
.map((i, p) => $(p).text())
|
||||
.toArray()
|
||||
.join('\n');
|
||||
const imgs = $ct
|
||||
.parent()
|
||||
.next()
|
||||
.find('img')
|
||||
.toArray()
|
||||
.map((img) => $(img).attr('src'));
|
||||
const { searchParams: q } = new URL(url);
|
||||
return { url: `https://www.facebook.com/story.php?story_fbid=${q.get('story_fbid')}&id=${q.get('id')}`, html, title: $($('h3 strong a').get(0)).text(), content };
|
||||
return { url: `https://www.facebook.com/story.php?story_fbid=${q.get('story_fbid')}&id=${q.get('id')}`, html, title: $($('h3 strong a').get(0)).text(), content, imgs };
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ module.exports = async (ctx) => {
|
|||
const d = await getArticle('https://mbasic.facebook.com' + url);
|
||||
return {
|
||||
title: d.title,
|
||||
description: d.content.replace(/\n/g, '<br>'),
|
||||
description: d.imgs.map((u) => `<img src="${u}">`).join('\n') + d.content.replace(/\n/g, '<br>'),
|
||||
link: d.url,
|
||||
};
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue