MCPcopy Create free account
hub / github.com/TejasQ/tejaskumar.com / fetchFromTwitter

Function fetchFromTwitter

create-testimonials.ts:21–29  ·  view source on GitHub ↗
(handle: string)

Source from the content-addressed store, hash-verified

19 let rateLimitResetTime = '';
20
21 const fetchFromTwitter = (handle: string) => fetch('https://api.twitter.com/1.1/users/lookup.json?screen_name=' + handle, {
22 headers: {
23 Authorization: "Bearer " + process.env.TWITTER_API_TOKEN
24 },
25 }).then(r => {
26 howManyMoreCanIDo = parseFloat(r.headers.get('x-rate-limit-remaining')!);
27 rateLimitResetTime = r.headers.get('x-rate-limit-reset')!;
28 return r.json()
29 })
30
31 for (const userIndex in users) {
32 const id = getIdFromTweetUrl(testimonials[userIndex])

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected