Answers for "Fetch tweets from twitter"

0

Fetch tweets from twitter

1234567891011121314const token = process.env["TWITTER_BEARER_TOKEN"]

const fetchTweetsFromUser = async (screenName, count) => {
  const response = await fetch(
    `https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=${screenName}&count=${count}`,
    {
      headers: {
        Authorization: `Bearer ${token}`,
      },
    }
  )
  const json = await response.json()
  return json
}
Posted by: Guest on July-04-2021

Code answers related to "Fetch tweets from twitter"

Browse Popular Code Answers by Language