@@ -24,6 +24,12 @@ export class TwitterApiError extends Error {
24
24
25
25
const TWEET_ID = / ^ [ 0 - 9 ] + $ /
26
26
27
+ function getToken ( id : string ) {
28
+ return ( ( Number ( id ) / 1e15 ) * Math . PI )
29
+ . toString ( 6 ** 2 )
30
+ . replace ( / ( 0 + | \. ) / g, '' )
31
+ }
32
+
27
33
/**
28
34
* Fetches a tweet from the Twitter syndication API.
29
35
*/
@@ -46,16 +52,20 @@ export async function getTweet(
46
52
'tfw_follower_count_sunset:true' ,
47
53
'tfw_tweet_edit_backend:on' ,
48
54
'tfw_refsrc_session:on' ,
55
+ 'tfw_fosnr_soft_interventions_enabled:on' ,
56
+ 'tfw_show_birdwatch_pivots_enabled:on' ,
49
57
'tfw_show_business_verified_badge:on' ,
50
58
'tfw_duplicate_scribes_to_settings:on' ,
59
+ 'tfw_use_profile_image_shape_enabled:on' ,
51
60
'tfw_show_blue_verified_badge:on' ,
52
61
'tfw_legacy_timeline_sunset:true' ,
53
62
'tfw_show_gov_verified_badge:on' ,
54
63
'tfw_show_business_affiliate_badge:on' ,
55
64
'tfw_tweet_edit_frontend:on' ,
56
65
] . join ( ';' )
57
66
)
58
-
67
+ url . searchParams . set ( 'token' , getToken ( id ) )
68
+
59
69
const res = await fetch ( url . toString ( ) , fetchOptions )
60
70
const isJson = res . headers . get ( 'content-type' ) ?. includes ( 'application/json' )
61
71
const data = isJson ? await res . json ( ) : undefined
0 commit comments