Closed laike9m closed 1 year ago
You can use if from inside a browser using the GraphQL API mode.
After starting it in the GraphQL API mode, go to localhost:{port_number}/graphql on you web browser to access the GraphiQL GUI to run queries to fetch data from Twitter. This method, however, doesn't allow you to send authenticated requests for fetching data such as followers, likes, etc.
If you want to make authenticated requests, using you account's credential, you can use a tool like Postman or Hoppscotch to make the same queries, using the GraphQL API.
thanks. In my case, I don't need to login and guest mode is probably fine. you mean that this part can run in the browser without authentication:
Sorry for the late reply. My exams were going on.
https://github.com/Rishikant181/Rettiwt-API#1-graphql-server
This is probably the one you are looking for. It will work without needing to log in, and from the browser.
After setting up, go to localhost:{port_number}/graphql address on you web-browser where the server is running, and you can write queries there to fetch data.
I see. So you always need a local server no matter what
Unfortunately, yes.
Using it without a local server requires hosting the server on an actual physical machine, which will additionally incur cost. Then there is the legalities of scraping data from a web server.
So, it's best to just setup a local server for scrap data.
It would be nice if this lib can be used from the browser (I only intend to fetch tweets at low frequency without using the server feature). Currently it seems impossible.
btw thanks for making this in a post-twitter-2.0 world :)