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, name } = ctx.params; const result = await utils.getTwit().get('lists/statuses', { owner_screen_name: id, slug: name, tweet_mode: 'extended', }); const data = result.data; ctx.state.data = { title: `Twitter List - ${id}/${name}`, link: `https://twitter.com/${id}/lists/${name}`, item: utils.ProcessFeed({ data, }), }; };