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:
Thomas
2024-09-18 08:13:22 +08:00
committed by GitHub
parent 42b5362fbe
commit 3eeb7ecd25
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -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',
];
+5 -2
View File
@@ -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}`,