fix(route): Twitter list API new query path and support include_rts (#16788)
* fix: new Twitter list query path * feat: support filtering retweets in list api
This commit is contained in:
parent
42b5362fbe
commit
3eeb7ecd25
|
|
@ -9,7 +9,7 @@ const graphQLEndpointsPlain = [
|
|||
'/graphql/dexO_2tohK86JDudXXG3Yw/UserMedia',
|
||||
'/graphql/tD8zKvQzwY3kdx5yz6YmOw/UserByRestId',
|
||||
'/graphql/UN1i3zUiCWa-6r-Uaho4fw/SearchTimeline',
|
||||
'/graphql/TOTgqavWmxywKv5IbMMK1w/ListLatestTweetsTimeline',
|
||||
'/graphql/Pa45JvqZuKcW1plybfgBlQ/ListLatestTweetsTimeline',
|
||||
'/graphql/QuBlQ6SxNAQCt6-kBiCXCQ/TweetDetail',
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -41,11 +41,14 @@ export const route: Route = {
|
|||
|
||||
async function handler(ctx) {
|
||||
const id = ctx.req.param('id');
|
||||
const { count } = utils.parseRouteParams(ctx.req.param('routeParams'));
|
||||
const { count, include_rts } = utils.parseRouteParams(ctx.req.param('routeParams'));
|
||||
const params = count ? { count } : {};
|
||||
|
||||
await api.init();
|
||||
const data = await api.getList(id, params);
|
||||
let data = await api.getList(id, params);
|
||||
if (!include_rts) {
|
||||
data = utils.excludeRetweet(data);
|
||||
}
|
||||
|
||||
return {
|
||||
title: `Twitter List - ${id}`,
|
||||
|
|
|
|||
Loading…
Reference in New Issue