const utils = require('./utils'); const config = require('@/config'); 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 relevant config'; } const id = ctx.params.id; const result = await utils.getTwit().get('favorites/list', { screen_name: id, tweet_mode: 'extended', }); const data = result.data; ctx.state.data = { title: `Twitter Likes - ${id}`, link: `https://twitter.com/${id}/likes`, item: utils.ProcessFeed({ data, }), }; };