mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-01 14:57:14 +08:00
fix(route/*): previously forgotten migrations (#14778)
Signed-off-by: Rongrong <i@rong.moe>
This commit is contained in:
@@ -55,5 +55,5 @@ async function handler(ctx) {
|
||||
|
||||
const currentUrl = `${rootUrl}/albums${category === 'all' ? '' : `/${category}`}${keyword ? `?screen=${keyword}` : '?'}${time === 'a' ? '' : `&t=${time}`}${order === 'mr' ? '' : `&o=${order}`}`;
|
||||
|
||||
ctx.set('data', await ProcessItems(ctx, currentUrl, rootUrl));
|
||||
return await ProcessItems(ctx, currentUrl, rootUrl);
|
||||
}
|
||||
|
||||
@@ -44,5 +44,5 @@ async function handler(ctx) {
|
||||
|
||||
const currentUrl = `${rootUrl}/search/${option}${category === 'all' ? '' : `/${category}`}${keyword ? `?search_query=${keyword}` : '?'}${time === 'a' ? '' : `&t=${time}`}${order === 'mr' ? '' : `&o=${order}`}`;
|
||||
|
||||
ctx.set('data', await ProcessItems(ctx, currentUrl, rootUrl));
|
||||
return await ProcessItems(ctx, currentUrl, rootUrl);
|
||||
}
|
||||
|
||||
@@ -33,5 +33,5 @@ async function handler(ctx) {
|
||||
|
||||
const currentUrl = new URL(`class/${category}.html`, rootUrl).href;
|
||||
|
||||
ctx.set('data', await fetchItems(limit, currentUrl, cache.tryGet));
|
||||
return await fetchItems(limit, currentUrl, cache.tryGet);
|
||||
}
|
||||
|
||||
@@ -29,5 +29,5 @@ async function handler(ctx) {
|
||||
|
||||
const currentUrl = new URL(`top/${category.split(/_/)[0]}_1.html`, rootUrl).href;
|
||||
|
||||
ctx.set('data', await fetchItems(limit, currentUrl, cache.tryGet));
|
||||
return await fetchItems(limit, currentUrl, cache.tryGet);
|
||||
}
|
||||
|
||||
@@ -42,5 +42,5 @@ async function handler(ctx) {
|
||||
|
||||
const currentUrl = `${rootUrl}/category-${category}/list-1/index.html?page=1`;
|
||||
|
||||
ctx.set('data', await ProcessItems(ctx, categories[category], currentUrl));
|
||||
return await ProcessItems(ctx, categories[category], currentUrl);
|
||||
}
|
||||
|
||||
@@ -30,5 +30,5 @@ async function handler(ctx) {
|
||||
|
||||
const currentUrl = `${rootUrl}/home-ajax/index.html?tabcid=${tab}&page=1`;
|
||||
|
||||
ctx.set('data', await ProcessItems(ctx, tab, currentUrl));
|
||||
return await ProcessItems(ctx, tab, currentUrl);
|
||||
}
|
||||
|
||||
@@ -28,5 +28,5 @@ async function handler(ctx) {
|
||||
|
||||
const currentUrl = `${rootUrl}/tag-${tag}/page-1/index.html`;
|
||||
|
||||
ctx.set('data', await ProcessItems(ctx, tag, currentUrl));
|
||||
return await ProcessItems(ctx, tag, currentUrl);
|
||||
}
|
||||
|
||||
+14
-17
@@ -46,21 +46,18 @@ async function handler(ctx) {
|
||||
break;
|
||||
}
|
||||
|
||||
ctx.set(
|
||||
'data',
|
||||
await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: `%title%`,
|
||||
params: {
|
||||
title: 'AIEA Seminars',
|
||||
},
|
||||
item: {
|
||||
item: `.seminar-contents .seminar-partWrap:nth-child(${nth_child}) > .seminar-list`,
|
||||
title: `$('.seminar-list-title > span').text()`,
|
||||
link: `$('a[href^="/0504"]').attr('href')`,
|
||||
description: `$('.seminar-list .txt > .title').text()`,
|
||||
},
|
||||
})
|
||||
);
|
||||
return await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: `%title%`,
|
||||
params: {
|
||||
title: 'AIEA Seminars',
|
||||
},
|
||||
item: {
|
||||
item: `.seminar-contents .seminar-partWrap:nth-child(${nth_child}) > .seminar-list`,
|
||||
title: `$('.seminar-list-title > span').text()`,
|
||||
link: `$('a[href^="/0504"]').attr('href')`,
|
||||
description: `$('.seminar-list .txt > .title').text()`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ export const route: Route = {
|
||||
url: 'www.airchina.com.cn/',
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
async function handler() {
|
||||
const link = `${baseUrl}/cn/info/new-service/service_announcement.shtml`;
|
||||
const data = await buildData({
|
||||
link,
|
||||
@@ -58,5 +58,5 @@ async function handler(ctx) {
|
||||
})
|
||||
);
|
||||
|
||||
ctx.set('data', data);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -50,5 +50,5 @@ async function handler(ctx) {
|
||||
default:
|
||||
throw new Error(`暂不支持对${type}的订阅`);
|
||||
}
|
||||
ctx.set('data', response);
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -48,8 +48,7 @@ async function handler(ctx) {
|
||||
});
|
||||
|
||||
if (!channelInfo) {
|
||||
ctx.set('data', notFoundData);
|
||||
return;
|
||||
return notFoundData;
|
||||
}
|
||||
const [userName, face] = await cacheIn.getUsernameAndFaceFromUID(uid);
|
||||
const host = `https://api.bilibili.com/x/series/archives?mid=${uid}&series_id=${sid}&only_normal=true&sort=desc&pn=1&ps=${limit}`;
|
||||
@@ -62,8 +61,7 @@ async function handler(ctx) {
|
||||
|
||||
const data = response.data.data;
|
||||
if (!data.archives) {
|
||||
ctx.set('data', notFoundData);
|
||||
return;
|
||||
return notFoundData;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -44,8 +44,7 @@ async function handler(ctx) {
|
||||
|
||||
const data = response.data.data;
|
||||
if (!data.archives) {
|
||||
ctx.set('data', notFoundData);
|
||||
return;
|
||||
return notFoundData;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -32,18 +32,15 @@ async function handler(ctx) {
|
||||
link = `https://www.brooklynmuseum.org/exhibitions/${state}`;
|
||||
}
|
||||
|
||||
ctx.set(
|
||||
'data',
|
||||
await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: 'Brooklyn Museum - Exhibitions',
|
||||
item: {
|
||||
item: '.exhibitions .image-card',
|
||||
title: `$('h2 > a, h3 > a').text()`,
|
||||
link: `$('h2 > a, h3 > a').attr('href')`,
|
||||
description: `$('h6').text()`,
|
||||
},
|
||||
})
|
||||
);
|
||||
return await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: 'Brooklyn Museum - Exhibitions',
|
||||
item: {
|
||||
item: '.exhibitions .image-card',
|
||||
title: `$('h2 > a, h3 > a').text()`,
|
||||
link: `$('h2 > a, h3 > a').attr('href')`,
|
||||
description: `$('h6').text()`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -42,5 +42,5 @@ async function handler(ctx) {
|
||||
responseData = await getNews(category);
|
||||
}
|
||||
|
||||
ctx.set('data', responseData);
|
||||
return responseData;
|
||||
}
|
||||
|
||||
@@ -27,5 +27,5 @@ async function handler(ctx) {
|
||||
|
||||
const currentUrl = `onlyfans/user/${id}`;
|
||||
|
||||
ctx.set('data', await fetchItems(ctx, currentUrl));
|
||||
return await fetchItems(ctx, currentUrl);
|
||||
}
|
||||
|
||||
@@ -26,5 +26,5 @@ export const route: Route = {
|
||||
async function handler(ctx) {
|
||||
const currentUrl = 'posts';
|
||||
|
||||
ctx.set('data', await fetchItems(ctx, currentUrl));
|
||||
return await fetchItems(ctx, currentUrl);
|
||||
}
|
||||
|
||||
@@ -20,5 +20,5 @@ export const route: Route = {
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
ctx.set('data', await utils.parseFeed({ subjectid: ctx.req.param('id') }));
|
||||
return await utils.parseFeed({ subjectid: ctx.req.param('id') });
|
||||
}
|
||||
|
||||
@@ -19,6 +19,6 @@ export const route: Route = {
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
ctx.set('data', await utils.parseFeed({ subjectid: 70 }));
|
||||
async function handler() {
|
||||
return await utils.parseFeed({ subjectid: 70 });
|
||||
}
|
||||
|
||||
@@ -9,5 +9,5 @@ export const route: Route = {
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
ctx.set('data', await ProcessItems(ctx));
|
||||
return await ProcessItems(ctx);
|
||||
}
|
||||
|
||||
@@ -46,8 +46,7 @@ async function handler(ctx) {
|
||||
const slcProvince = $(`select#searchprovince option:contains('${province}')`);
|
||||
|
||||
if (!slcProvince.length) {
|
||||
ctx.set('data', result);
|
||||
return;
|
||||
return result;
|
||||
}
|
||||
|
||||
queryParams.searchprovince = slcProvince.attr('value');
|
||||
@@ -57,8 +56,7 @@ async function handler(ctx) {
|
||||
const slcOffice = $(`select#searchoffice option:contains('${office}')`);
|
||||
|
||||
if (!slcOffice.length) {
|
||||
ctx.set('data', result);
|
||||
return;
|
||||
return result;
|
||||
}
|
||||
|
||||
queryParams.searchoffice = slcOffice.attr('value');
|
||||
@@ -107,5 +105,5 @@ async function handler(ctx) {
|
||||
};
|
||||
});
|
||||
|
||||
ctx.set('data', result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -92,5 +92,5 @@ async function handler(ctx) {
|
||||
};
|
||||
}
|
||||
|
||||
ctx.set('data', data);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -25,5 +25,5 @@ async function handler(ctx) {
|
||||
|
||||
const title = `Dribbble - keyword ${keyword}`;
|
||||
|
||||
ctx.set('data', await utils.getData(ctx, url, title));
|
||||
return await utils.getData(ctx, url, title);
|
||||
}
|
||||
|
||||
@@ -30,5 +30,5 @@ async function handler(ctx) {
|
||||
|
||||
const title = 'Dribbble - Popular Shots';
|
||||
|
||||
ctx.set('data', await utils.getData(ctx, url, title));
|
||||
return await utils.getData(ctx, url, title);
|
||||
}
|
||||
|
||||
@@ -28,5 +28,5 @@ async function handler(ctx) {
|
||||
|
||||
const title = `Dribbble - user ${name}`;
|
||||
|
||||
ctx.set('data', await utils.getData(ctx, url, title));
|
||||
return await utils.getData(ctx, url, title);
|
||||
}
|
||||
|
||||
@@ -32,18 +32,15 @@ async function handler(ctx) {
|
||||
const inline_set = ctx.req.param('order') === 'posted' ? 'fs_p' : 'fs_f';
|
||||
const items = await EhAPI.getFavoritesItems(cache, favcat, inline_set, page, bittorrent, embed_thumb);
|
||||
|
||||
ctx.set(
|
||||
'data',
|
||||
EhAPI.from_ex
|
||||
? {
|
||||
title: 'ExHentai Favorites',
|
||||
link: `https://exhentai.org/favorites.php?favcat=${favcat}&inline_set=${inline_set}`,
|
||||
item: items,
|
||||
}
|
||||
: {
|
||||
title: 'E-Hentai Favorites',
|
||||
link: `https://e-hentai.org/favorites.php?favcat=${favcat}&inline_set=${inline_set}`,
|
||||
item: items,
|
||||
}
|
||||
);
|
||||
return EhAPI.from_ex
|
||||
? {
|
||||
title: 'ExHentai Favorites',
|
||||
link: `https://exhentai.org/favorites.php?favcat=${favcat}&inline_set=${inline_set}`,
|
||||
item: items,
|
||||
}
|
||||
: {
|
||||
title: 'E-Hentai Favorites',
|
||||
link: `https://e-hentai.org/favorites.php?favcat=${favcat}&inline_set=${inline_set}`,
|
||||
item: items,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -40,18 +40,15 @@ async function handler(ctx) {
|
||||
title = match[1];
|
||||
}
|
||||
|
||||
ctx.set(
|
||||
'data',
|
||||
EhAPI.from_ex
|
||||
? {
|
||||
title: title + ' - ExHentai Search ',
|
||||
link: `https://exhentai.org/?${params}`,
|
||||
item: items,
|
||||
}
|
||||
: {
|
||||
title: title + ' - E-Hentai Search ',
|
||||
link: `https://e-hentai.org/?${params}`,
|
||||
item: items,
|
||||
}
|
||||
);
|
||||
return EhAPI.from_ex
|
||||
? {
|
||||
title: title + ' - ExHentai Search ',
|
||||
link: `https://exhentai.org/?${params}`,
|
||||
item: items,
|
||||
}
|
||||
: {
|
||||
title: title + ' - E-Hentai Search ',
|
||||
link: `https://e-hentai.org/?${params}`,
|
||||
item: items,
|
||||
};
|
||||
}
|
||||
|
||||
+11
-14
@@ -28,18 +28,15 @@ async function handler(ctx) {
|
||||
const embed_thumb = routeParams.get('embed_thumb') || false;
|
||||
const items = await EhAPI.getTagItems(cache, tag, page, bittorrent, embed_thumb);
|
||||
|
||||
ctx.set(
|
||||
'data',
|
||||
EhAPI.from_ex
|
||||
? {
|
||||
title: tag + ' - ExHentai Tag',
|
||||
link: `https://exhentai.org/tag/${tag}`,
|
||||
item: items,
|
||||
}
|
||||
: {
|
||||
title: tag + ' - E-Hentai Tag',
|
||||
link: `https://e-hentai.org/tag/${tag}`,
|
||||
item: items,
|
||||
}
|
||||
);
|
||||
return EhAPI.from_ex
|
||||
? {
|
||||
title: tag + ' - ExHentai Tag',
|
||||
link: `https://exhentai.org/tag/${tag}`,
|
||||
item: items,
|
||||
}
|
||||
: {
|
||||
title: tag + ' - E-Hentai Tag',
|
||||
link: `https://e-hentai.org/tag/${tag}`,
|
||||
item: items,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -30,12 +30,9 @@ export const route: Route = {
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
ctx.set(
|
||||
'data',
|
||||
await utils.getData({
|
||||
site: ctx.req.param('language') === 'chinese' ? 'www' : 'big5',
|
||||
channel: ctx.req.param('channel'),
|
||||
ctx,
|
||||
})
|
||||
);
|
||||
return await utils.getData({
|
||||
site: ctx.req.param('language') === 'chinese' ? 'www' : 'big5',
|
||||
channel: ctx.req.param('channel'),
|
||||
ctx,
|
||||
});
|
||||
}
|
||||
|
||||
+18
-27
@@ -26,36 +26,27 @@ async function handler(ctx) {
|
||||
// 特殊处理两个, 其他的栏目都可以找到那种一个列表下去的目录
|
||||
if (suburl === 'xw/tpxw/') {
|
||||
// 图片新闻
|
||||
ctx.set(
|
||||
'data',
|
||||
await dealChannel(suburl, {
|
||||
channelTitleSelector: '.pub-media2-head',
|
||||
listSelector: '.tupian_list li',
|
||||
titleSelector: 'a[class="block w_fill ellipsis adc ahc"]',
|
||||
dateSelector: 'span',
|
||||
})
|
||||
);
|
||||
return await dealChannel(suburl, {
|
||||
channelTitleSelector: '.pub-media2-head',
|
||||
listSelector: '.tupian_list li',
|
||||
titleSelector: 'a[class="block w_fill ellipsis adc ahc"]',
|
||||
dateSelector: 'span',
|
||||
});
|
||||
} else if (suburl === 'govpublic/') {
|
||||
// 公开公告
|
||||
ctx.set(
|
||||
'data',
|
||||
await dealChannel('govpublic/1/index.htm', {
|
||||
channelTitleSelector: 'title',
|
||||
listSelector: '.gongkai_centerRList li',
|
||||
titleSelector: 'a',
|
||||
dateSelector: 'span',
|
||||
})
|
||||
);
|
||||
return await dealChannel('govpublic/1/index.htm', {
|
||||
channelTitleSelector: 'title',
|
||||
listSelector: '.gongkai_centerRList li',
|
||||
titleSelector: 'a',
|
||||
dateSelector: 'span',
|
||||
});
|
||||
} else {
|
||||
ctx.set(
|
||||
'data',
|
||||
await dealChannel(suburl, {
|
||||
channelTitleSelector: '.pub-media1-head-title',
|
||||
listSelector: '.ztlb',
|
||||
titleSelector: 'a',
|
||||
dateSelector: 'span',
|
||||
})
|
||||
);
|
||||
return await dealChannel(suburl, {
|
||||
channelTitleSelector: '.pub-media1-head-title',
|
||||
listSelector: '.ztlb',
|
||||
titleSelector: 'a',
|
||||
dateSelector: 'span',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,5 +23,5 @@ async function handler(ctx) {
|
||||
const { site = 'beijing' } = ctx.req.param();
|
||||
const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 3;
|
||||
|
||||
ctx.set('data', await processZxfkItems(site, 'ywzx', limit));
|
||||
return await processZxfkItems(site, 'ywzx', limit);
|
||||
}
|
||||
|
||||
@@ -23,5 +23,5 @@ async function handler(ctx) {
|
||||
const { site = 'beijing' } = ctx.req.param();
|
||||
const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 5;
|
||||
|
||||
ctx.set('data', await processZxfkItems(site, 'tsjy', limit));
|
||||
return await processZxfkItems(site, 'tsjy', limit);
|
||||
}
|
||||
|
||||
@@ -23,22 +23,19 @@ async function handler(ctx) {
|
||||
const department = ctx.req.param('department');
|
||||
const link = `http://www.gov.cn/zhengce/zhengceku/${department}/`;
|
||||
|
||||
ctx.set(
|
||||
'data',
|
||||
await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: `%title%`,
|
||||
description: '政府文件库, 当页的所有列表',
|
||||
params: {
|
||||
title: `$('.channel_tab > .noline > a').text().trim() + ' - 政府文件库'`,
|
||||
},
|
||||
item: {
|
||||
item: '.news_box > .list > ul > li:not(.line)',
|
||||
title: `$('h4 > a').text()`,
|
||||
link: `$('h4 > a').attr('href')`,
|
||||
pubDate: `parseDate($('h4 > .date').text().trim())`,
|
||||
},
|
||||
})
|
||||
);
|
||||
return await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: `%title%`,
|
||||
description: '政府文件库, 当页的所有列表',
|
||||
params: {
|
||||
title: `$('.channel_tab > .noline > a').text().trim() + ' - 政府文件库'`,
|
||||
},
|
||||
item: {
|
||||
item: '.news_box > .list > ul > li:not(.line)',
|
||||
title: `$('h4 > a').text()`,
|
||||
link: `$('h4 > a').attr('href')`,
|
||||
pubDate: `parseDate($('h4 > .date').text().trim())`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -18,5 +18,5 @@ async function handler(ctx) {
|
||||
const title = `Grub Street`;
|
||||
const description = `New York Magazine's Food and Restaurant Blog`;
|
||||
|
||||
ctx.set('data', await utils.getData(ctx, url, title, description));
|
||||
return await utils.getData(ctx, url, title, description);
|
||||
}
|
||||
|
||||
@@ -28,5 +28,5 @@ export const route: Route = {
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
ctx.set('data', await ProcessFeed('all', 0, ctx.req.param('order')));
|
||||
return await ProcessFeed('all', 0, ctx.req.param('order'));
|
||||
}
|
||||
|
||||
@@ -23,5 +23,5 @@ export const route: Route = {
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
ctx.set('data', await ProcessFeed('character', ctx.req.param('id'), ctx.req.param('order')));
|
||||
return await ProcessFeed('character', ctx.req.param('id'), ctx.req.param('order'));
|
||||
}
|
||||
|
||||
@@ -23,5 +23,5 @@ export const route: Route = {
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
ctx.set('data', await ProcessFeed('work', ctx.req.param('id'), ctx.req.param('order')));
|
||||
return await ProcessFeed('work', ctx.req.param('id'), ctx.req.param('order'));
|
||||
}
|
||||
|
||||
+19
-22
@@ -14,27 +14,24 @@ export const route: Route = {
|
||||
url: 'www.iiilab.com/',
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
async function handler() {
|
||||
const link = baseUrl;
|
||||
ctx.set(
|
||||
'data',
|
||||
await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: `%title%`,
|
||||
description: `%description%`,
|
||||
params: {
|
||||
title: '发现',
|
||||
description: '人人都是自媒体-发现',
|
||||
},
|
||||
item: {
|
||||
item: '.aw-common-list > div',
|
||||
title: `$('a').first().text()`,
|
||||
link: `$('a').first().attr('href')`,
|
||||
description: `$('.markitup-box').first().text()`,
|
||||
pubDate: `parseDate($('.text-color-999').first().text(), 'YYYY-MM-DD HH:mm')`,
|
||||
guid: Buffer.from(`$('a').attr('href')`).toString('base64'),
|
||||
},
|
||||
})
|
||||
);
|
||||
return await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: `%title%`,
|
||||
description: `%description%`,
|
||||
params: {
|
||||
title: '发现',
|
||||
description: '人人都是自媒体-发现',
|
||||
},
|
||||
item: {
|
||||
item: '.aw-common-list > div',
|
||||
title: `$('a').first().text()`,
|
||||
link: `$('a').first().attr('href')`,
|
||||
description: `$('.markitup-box').first().text()`,
|
||||
pubDate: `parseDate($('.text-color-999').first().text(), 'YYYY-MM-DD HH:mm')`,
|
||||
guid: Buffer.from(`$('a').attr('href')`).toString('base64'),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -73,5 +73,5 @@ async function handler(ctx) {
|
||||
);
|
||||
browser.close();
|
||||
|
||||
ctx.set('data', data);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -45,5 +45,5 @@ async function handler(ctx) {
|
||||
|
||||
const title = `JavDB${filters[filter] === '' ? '' : ` - ${filters[filter]}`} `;
|
||||
|
||||
ctx.set('data', await utils.ProcessItems(ctx, currentUrl, title));
|
||||
return await utils.ProcessItems(ctx, currentUrl, title);
|
||||
}
|
||||
|
||||
@@ -59,5 +59,5 @@ async function handler(ctx) {
|
||||
|
||||
const title = `${categories[category]} - JavDB - ${filters[filter] === '' ? '|' : `${filters[filter]} | `}${sorts[sort]}`;
|
||||
|
||||
ctx.set('data', await utils.ProcessItems(ctx, currentUrl, title));
|
||||
return await utils.ProcessItems(ctx, currentUrl, title);
|
||||
}
|
||||
|
||||
@@ -37,5 +37,5 @@ async function handler(ctx) {
|
||||
|
||||
const title = `JavDB${filters[filter] === '' ? '' : ` - ${filters[filter]}`} ${sortOptions[sort]}`;
|
||||
|
||||
ctx.set('data', await utils.ProcessItems(ctx, currentUrl, title));
|
||||
return await utils.ProcessItems(ctx, currentUrl, title);
|
||||
}
|
||||
|
||||
@@ -46,5 +46,5 @@ async function handler(ctx) {
|
||||
|
||||
const title = `JavDB${filters[filter] === '' ? '' : ` - ${filters[filter]}`} `;
|
||||
|
||||
ctx.set('data', await utils.ProcessItems(ctx, currentUrl, title));
|
||||
return await utils.ProcessItems(ctx, currentUrl, title);
|
||||
}
|
||||
|
||||
@@ -43,5 +43,5 @@ async function handler(ctx) {
|
||||
|
||||
const title = 'JavDB';
|
||||
|
||||
ctx.set('data', await utils.ProcessItems(ctx, currentUrl, title));
|
||||
return await utils.ProcessItems(ctx, currentUrl, title);
|
||||
}
|
||||
|
||||
@@ -64,5 +64,5 @@ async function handler(ctx) {
|
||||
|
||||
const title = `關鍵字 ${keyword} ${filters[filter] === '' ? '' : `+ ${filters[filter]}`} ${sorts[sort]} 搜索結果 - JavDB`;
|
||||
|
||||
ctx.set('data', await utils.ProcessItems(ctx, currentUrl, title));
|
||||
return await utils.ProcessItems(ctx, currentUrl, title);
|
||||
}
|
||||
|
||||
@@ -46,5 +46,5 @@ async function handler(ctx) {
|
||||
|
||||
const title = `JavDB${filters[filter] === '' ? '' : ` - ${filter[filter]}`} `;
|
||||
|
||||
ctx.set('data', await utils.ProcessItems(ctx, currentUrl, title));
|
||||
return await utils.ProcessItems(ctx, currentUrl, title);
|
||||
}
|
||||
|
||||
@@ -43,5 +43,5 @@ async function handler(ctx) {
|
||||
|
||||
const title = `JavDB${query === '' ? '' : ` - ${query}`} `;
|
||||
|
||||
ctx.set('data', await utils.ProcessItems(ctx, currentUrl, title));
|
||||
return await utils.ProcessItems(ctx, currentUrl, title);
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@ async function handler(ctx) {
|
||||
const language = ctx.req.param('language') ?? defaultLanguage;
|
||||
const currentUrl = `${rootUrl}/${language}/vl_bestrated.php?list&mode=${mode}`;
|
||||
|
||||
ctx.set('data', await ProcessItems(language, currentUrl, cache.tryGet));
|
||||
return await ProcessItems(language, currentUrl, cache.tryGet);
|
||||
}
|
||||
|
||||
@@ -28,5 +28,5 @@ async function handler(ctx) {
|
||||
const language = ctx.req.param('language') ?? defaultLanguage;
|
||||
const currentUrl = `${rootUrl}/${language}/tl_bestreviews.php?list&mode=${mode}`;
|
||||
|
||||
ctx.set('data', await ProcessItems(language, currentUrl, cache.tryGet));
|
||||
return await ProcessItems(language, currentUrl, cache.tryGet);
|
||||
}
|
||||
|
||||
@@ -22,5 +22,5 @@ async function handler(ctx) {
|
||||
const language = ctx.req.param('language') ?? defaultLanguage;
|
||||
const currentUrl = `${rootUrl}/${language}/vl_genre.php?list&g=${genre}&mode=${mode}`;
|
||||
|
||||
ctx.set('data', await ProcessItems(language, currentUrl, cache.tryGet));
|
||||
return await ProcessItems(language, currentUrl, cache.tryGet);
|
||||
}
|
||||
|
||||
@@ -29,5 +29,5 @@ async function handler(ctx) {
|
||||
const language = ctx.req.param('language') ?? defaultLanguage;
|
||||
const currentUrl = `${rootUrl}/${language}/vl_maker.php?list&m=${maker}&mode=${mode}`;
|
||||
|
||||
ctx.set('data', await ProcessItems(language, currentUrl, cache.tryGet));
|
||||
return await ProcessItems(language, currentUrl, cache.tryGet);
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@ async function handler(ctx) {
|
||||
const language = ctx.req.param('language') ?? defaultLanguage;
|
||||
const currentUrl = `${rootUrl}/${language}/vl_mostwanted.php?list&mode=${mode}`;
|
||||
|
||||
ctx.set('data', await ProcessItems(language, currentUrl, cache.tryGet));
|
||||
return await ProcessItems(language, currentUrl, cache.tryGet);
|
||||
}
|
||||
|
||||
@@ -13,5 +13,5 @@ async function handler(ctx) {
|
||||
const language = ctx.req.param('language') ?? defaultLanguage;
|
||||
const currentUrl = `${rootUrl}/${language}/vl_newentries.php?list`;
|
||||
|
||||
ctx.set('data', await ProcessItems(language, currentUrl, cache.tryGet));
|
||||
return await ProcessItems(language, currentUrl, cache.tryGet);
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@ async function handler(ctx) {
|
||||
const language = ctx.req.param('language') ?? defaultLanguage;
|
||||
const currentUrl = `${rootUrl}/${language}/vl_newrelease.php?list&mode=${mode}`;
|
||||
|
||||
ctx.set('data', await ProcessItems(language, currentUrl, cache.tryGet));
|
||||
return await ProcessItems(language, currentUrl, cache.tryGet);
|
||||
}
|
||||
|
||||
@@ -35,5 +35,5 @@ async function handler(ctx) {
|
||||
const language = ctx.req.param('language') ?? defaultLanguage;
|
||||
const currentUrl = `${rootUrl}/${language}/vl_star.php?list&s=${id}&mode=${mode}`;
|
||||
|
||||
ctx.set('data', await ProcessItems(language, currentUrl, cache.tryGet));
|
||||
return await ProcessItems(language, currentUrl, cache.tryGet);
|
||||
}
|
||||
|
||||
@@ -13,5 +13,5 @@ async function handler(ctx) {
|
||||
const language = ctx.req.param('language') ?? defaultLanguage;
|
||||
const currentUrl = `${rootUrl}/${language}/vl_update.php?list`;
|
||||
|
||||
ctx.set('data', await ProcessItems(language, currentUrl, cache.tryGet));
|
||||
return await ProcessItems(language, currentUrl, cache.tryGet);
|
||||
}
|
||||
|
||||
@@ -18,5 +18,5 @@ async function handler(ctx) {
|
||||
const language = ctx.req.param('language') ?? defaultLanguage;
|
||||
const currentUrl = `${rootUrl}/${language}/${type}.php?list&u=${id}`;
|
||||
|
||||
ctx.set('data', await ProcessItems(language, currentUrl, cache.tryGet));
|
||||
return await ProcessItems(language, currentUrl, cache.tryGet);
|
||||
}
|
||||
|
||||
@@ -19,20 +19,17 @@ export const route: Route = {
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
async function handler() {
|
||||
const link = 'https://thejewishmuseum.org/exhibitions';
|
||||
|
||||
ctx.set(
|
||||
'data',
|
||||
await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: 'Jewish Museums - Exhibitions',
|
||||
item: {
|
||||
item: '#current article.exhibition, #upcoming article, #past article.exhibition',
|
||||
title: `$('article.exhibition h3').text()`,
|
||||
link: `$('article.exhibition > a').attr('href')`,
|
||||
},
|
||||
})
|
||||
);
|
||||
return await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: 'Jewish Museums - Exhibitions',
|
||||
item: {
|
||||
item: '#current article.exhibition, #upcoming article, #past article.exhibition',
|
||||
title: `$('article.exhibition h3').text()`,
|
||||
link: `$('article.exhibition > a').attr('href')`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -40,6 +40,6 @@ async function handler(ctx) {
|
||||
link: `https://m.okjike.com/originalPosts/${item.id}`,
|
||||
};
|
||||
});
|
||||
ctx.set('data', result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,6 @@ async function handler(ctx) {
|
||||
})
|
||||
);
|
||||
}
|
||||
ctx.set('data', result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,5 +68,5 @@ async function handler(ctx) {
|
||||
link,
|
||||
item: items,
|
||||
};
|
||||
ctx.set('data', data);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -138,5 +138,5 @@ async function handler(ctx) {
|
||||
link: url,
|
||||
item: items,
|
||||
};
|
||||
ctx.set('data', data);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -72,5 +72,5 @@ async function handler(ctx) {
|
||||
item: items,
|
||||
};
|
||||
|
||||
ctx.set('data', data);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -67,5 +67,5 @@ async function handler(ctx) {
|
||||
link,
|
||||
item: items,
|
||||
};
|
||||
ctx.set('data', data);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -47,5 +47,5 @@ async function handler(ctx) {
|
||||
link,
|
||||
item: items,
|
||||
};
|
||||
ctx.set('data', data);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -32,18 +32,15 @@ async function handler(ctx) {
|
||||
link = `https://www.newmuseum.org/exhibitions/${state}`;
|
||||
}
|
||||
|
||||
ctx.set(
|
||||
'data',
|
||||
await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: 'New Museum - Exhibitions',
|
||||
item: {
|
||||
item: '.exh',
|
||||
title: `$('.exh .title').text()`,
|
||||
link: `$('.exh > a').attr('href')`,
|
||||
description: `$('.exh .body-reveal').text()`,
|
||||
},
|
||||
})
|
||||
);
|
||||
return await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: 'New Museum - Exhibitions',
|
||||
item: {
|
||||
item: '.exh',
|
||||
title: `$('.exh .title').text()`,
|
||||
link: `$('.exh > a').attr('href')`,
|
||||
description: `$('.exh .body-reveal').text()`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -186,5 +186,5 @@ async function handler(ctx) {
|
||||
|
||||
result.item = actListFull;
|
||||
|
||||
ctx.set('data', result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -258,5 +258,5 @@ async function handler(ctx) {
|
||||
)
|
||||
);
|
||||
|
||||
ctx.set('data', feed);
|
||||
return feed;
|
||||
}
|
||||
|
||||
@@ -45,5 +45,5 @@ async function handler(ctx) {
|
||||
|
||||
const currentUrl = `${rootUrl}/Rank/comicRank/type/${type}`;
|
||||
|
||||
ctx.set('data', await ProcessItems(ctx, currentUrl, time, titles[type]));
|
||||
return await ProcessItems(ctx, currentUrl, time, titles[type]);
|
||||
}
|
||||
|
||||
@@ -28,5 +28,5 @@ async function handler(ctx) {
|
||||
const category = ctx.req.param('category');
|
||||
const currentUrl = `/cat/${category}`;
|
||||
|
||||
ctx.set('data', await fetchFeed(ctx, currentUrl));
|
||||
return await fetchFeed(ctx, currentUrl);
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ export const route: Route = {
|
||||
async function handler(ctx) {
|
||||
const currentUrl = '';
|
||||
|
||||
ctx.set('data', await fetchFeed(ctx, currentUrl));
|
||||
return await fetchFeed(ctx, currentUrl);
|
||||
}
|
||||
|
||||
@@ -28,5 +28,5 @@ async function handler(ctx) {
|
||||
const keyword = ctx.req.param('keyword');
|
||||
const currentUrl = `/?s=${keyword}`;
|
||||
|
||||
ctx.set('data', await fetchFeed(ctx, currentUrl));
|
||||
return await fetchFeed(ctx, currentUrl);
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ async function handler(ctx) {
|
||||
const id = ctx.req.param('id');
|
||||
const currentUrl = `/i/${id}`;
|
||||
|
||||
ctx.set('data', await fetchFeed(ctx, currentUrl));
|
||||
return await fetchFeed(ctx, currentUrl);
|
||||
}
|
||||
|
||||
@@ -26,5 +26,5 @@ export const route: Route = {
|
||||
async function handler(ctx) {
|
||||
const date = ctx.req.param('date') ?? `${new Date().getFullYear()}/${new Date().getMonth()}`;
|
||||
|
||||
ctx.set('data', await utils(ctx, `books/date/${date.replace('-', '/')}`));
|
||||
return await utils(ctx, `books/date/${date.replace('-', '/')}`);
|
||||
}
|
||||
|
||||
@@ -36,5 +36,5 @@ export const route: Route = {
|
||||
async function handler(ctx) {
|
||||
const category = ctx.req.param('category') ?? '';
|
||||
|
||||
ctx.set('data', await utils(ctx, category));
|
||||
return await utils(ctx, category);
|
||||
}
|
||||
|
||||
@@ -35,5 +35,5 @@ export const route: Route = {
|
||||
async function handler(ctx) {
|
||||
const id = ctx.req.param('id') ?? '小说';
|
||||
|
||||
ctx.set('data', await utils(ctx, `books/tag/${id}`));
|
||||
return await utils(ctx, `books/tag/${id}`);
|
||||
}
|
||||
|
||||
@@ -8,24 +8,21 @@ export const route: Route = {
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
async function handler() {
|
||||
const link = 'https://stratechery.com/';
|
||||
|
||||
ctx.set(
|
||||
'data',
|
||||
await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: 'Stratechery by Ben Thompson',
|
||||
author: 'Ben Thompson',
|
||||
description: 'Stratechery provides analysis of the strategy and business side of technology and media, and the impact of technology on society. ',
|
||||
item: {
|
||||
item: 'article',
|
||||
title: `$('article > header > h1 > a').text()`,
|
||||
link: `$('article > header > h1 > a').attr('href')`,
|
||||
pubDate: `parseDate($('article .entry-date').attr('datetime'))`,
|
||||
description: `$('article > .entry-content').html().replace(/%/g, '%')`,
|
||||
},
|
||||
})
|
||||
);
|
||||
return await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: 'Stratechery by Ben Thompson',
|
||||
author: 'Ben Thompson',
|
||||
description: 'Stratechery provides analysis of the strategy and business side of technology and media, and the impact of technology on society. ',
|
||||
item: {
|
||||
item: 'article',
|
||||
title: `$('article > header > h1 > a').text()`,
|
||||
link: `$('article > header > h1 > a').attr('href')`,
|
||||
pubDate: `parseDate($('article .entry-date').attr('datetime'))`,
|
||||
description: `$('article > .entry-content').html().replace(/%/g, '%')`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -23,5 +23,5 @@ export const route: Route = {
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
ctx.set('data', await FetchGoItems(ctx));
|
||||
return await FetchGoItems(ctx);
|
||||
}
|
||||
|
||||
@@ -20,5 +20,5 @@ export const route: Route = {
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
ctx.set('data', await FetchGoItems(ctx, 'jobs'));
|
||||
return await FetchGoItems(ctx, 'jobs');
|
||||
}
|
||||
|
||||
@@ -20,5 +20,5 @@ export const route: Route = {
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
ctx.set('data', await FetchGoItems(ctx, 'weekly'));
|
||||
return await FetchGoItems(ctx, 'weekly');
|
||||
}
|
||||
|
||||
@@ -79,5 +79,5 @@ async function handler(ctx) {
|
||||
responseData.item = news;
|
||||
}
|
||||
|
||||
ctx.set('data', responseData);
|
||||
return responseData;
|
||||
}
|
||||
|
||||
@@ -93,14 +93,12 @@ async function handler(ctx) {
|
||||
});
|
||||
}
|
||||
|
||||
// Update ctx
|
||||
return {
|
||||
title: '微博热搜榜',
|
||||
link: 'https://s.weibo.com/top/summary?cate=realtimehot',
|
||||
description: '实时热点,每分钟更新一次',
|
||||
item: resultItems,
|
||||
};
|
||||
// ctx.set('data', weiboUtils.sinaimgTvax(ctx.state.data)); // no image in the route
|
||||
}
|
||||
|
||||
async function fetchContent(url) {
|
||||
|
||||
@@ -24,27 +24,24 @@ export const route: Route = {
|
||||
url: 'www.xunhupay.com/blog',
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
async function handler() {
|
||||
const link = `${baseUrl}/blog.html`;
|
||||
ctx.set(
|
||||
'data',
|
||||
await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: `%title%`,
|
||||
description: `%description%`,
|
||||
params: {
|
||||
title: '博客',
|
||||
description: '虎皮椒-博客',
|
||||
},
|
||||
item: {
|
||||
item: '.blog-post > article',
|
||||
title: `$('h5').text()`,
|
||||
link: `$('a').attr('href')`,
|
||||
description: `$('.content').text()`,
|
||||
pubDate: `parseDate($('.date').text(), 'YYYY-MM-DD')`,
|
||||
guid: Buffer.from(`$('a').attr('href')`).toString('base64'),
|
||||
},
|
||||
})
|
||||
);
|
||||
return await buildData({
|
||||
link,
|
||||
url: link,
|
||||
title: `%title%`,
|
||||
description: `%description%`,
|
||||
params: {
|
||||
title: '博客',
|
||||
description: '虎皮椒-博客',
|
||||
},
|
||||
item: {
|
||||
item: '.blog-post > article',
|
||||
title: `$('h5').text()`,
|
||||
link: `$('a').attr('href')`,
|
||||
description: `$('.content').text()`,
|
||||
pubDate: `parseDate($('.date').text(), 'YYYY-MM-DD')`,
|
||||
guid: Buffer.from(`$('a').attr('href')`).toString('base64'),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user