mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-01 01:28:08 +08:00
* fix(route)(twitter): quote ignored in web API * refactor: migrate to v2 Signed-off-by: Rongrong <i@rong.moe>
23 lines
765 B
JavaScript
23 lines
765 B
JavaScript
const utils = require('./utils');
|
|
const config = require('@/config').value;
|
|
|
|
module.exports = async (ctx) => {
|
|
if (!config.twitter || !config.twitter.consumer_key || !config.twitter.consumer_secret) {
|
|
throw 'Twitter RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>';
|
|
}
|
|
const id = ctx.params.id;
|
|
const client = await utils.getAppClient();
|
|
const data = await client.v1.get('favorites/list.json', {
|
|
screen_name: id,
|
|
tweet_mode: 'extended',
|
|
});
|
|
|
|
ctx.state.data = {
|
|
title: `Twitter Likes - ${id}`,
|
|
link: `https://twitter.com/${id}/likes`,
|
|
item: utils.ProcessFeed(ctx, {
|
|
data,
|
|
}),
|
|
};
|
|
};
|