From 568dd0e70b5ba41e4fdde7b3b0cdc12b59a96a60 Mon Sep 17 00:00:00 2001 From: dangered wolf Date: Thu, 14 Jul 2022 13:50:09 -0400 Subject: [PATCH] Fetch now returns TimelineBlobPartial --- src/fetch.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/fetch.ts b/src/fetch.ts index f73dfa8..dd0cafc 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -1,6 +1,6 @@ import { Constants } from './constants'; -export const fetchUsingGuest = async (status: string): Promise => { +export const fetchUsingGuest = async (status: string): Promise => { const csrfToken = crypto.randomUUID().replace(/-/g, ''); // Generate a random CSRF token, this doesn't matter, Twitter just cares that header and cookie match let headers: { [header: string]: string } = { @@ -47,11 +47,5 @@ export const fetchUsingGuest = async (status: string): Promise => ) ).json()) as TimelineBlobPartial; - const tweet = conversation?.globalObjects?.tweets?.[status] || {}; - /* With v2 conversation API we re-add the user object ot the tweet because - Twitter stores it separately in the conversation API. This is to consolidate - it in case a user appears multiple times in a thread. */ - tweet.user = conversation?.globalObjects?.users?.[tweet.user_id_str] || {}; - - return tweet; + return conversation; };