Critter is a twitter front-end that allows you to view twitter search results and user profile tweets without an account. Uses react front-end with express backend.
Crawl + Twitter = Critter
-
API call is made by react front end to express backend server
-
Server fetches up to 20 search results from Startpage using the site: search operator to restrict results to twitter.com for general search or twitter.com/username for tweets from a specific user.
-
A guest token is used to fetch the twitter data. Guest tokens expire after 9e6 milliseconds or 2.5 hours, so the server checks if the current token stored in the token.json file has expired and fetches a new one if needed.
-
The twitter tweet data is fetched via the 'TweetResultByRestId' api call using the rest id number in the twitter urls grabbed from the Startpage search results. The twitter user profile data is fetched via the 'UserByScreenName' twitter API call using a username.
-
Twitter data is sent to the react front end and displayed.
The Twitter API calls used are the same used when one views an individual tweet or a twitter user's profile (as a "guest" without a twitter account) using a web browser. Anyone can copy these requests as Powershell, Fetch, Node.js fetch, cuRL, etc in the Developer Tools of your web browser.
https://api.twitter.com/1.1/guest/activate.json
See: StackOverflow