mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-07 05:36:08 +08:00
* fix(route)(twitter): quote ignored in web API * refactor: migrate to v2 Signed-off-by: Rongrong <i@rong.moe>
17 lines
454 B
JavaScript
17 lines
454 B
JavaScript
const utils = require('../utils');
|
|
const { getSearch } = require('./twitter-api');
|
|
|
|
module.exports = async (ctx) => {
|
|
const keyword = ctx.params.keyword;
|
|
const data = await getSearch(keyword);
|
|
|
|
ctx.state.data = {
|
|
title: `Twitter Keyword - ${keyword}`,
|
|
link: `https://twitter.com/search?q=${encodeURIComponent(keyword)}`,
|
|
item: utils.ProcessFeed(ctx, {
|
|
data,
|
|
}),
|
|
allowEmpty: true,
|
|
};
|
|
};
|