Closed simon-marcus closed 12 months ago
Thank you for sending us your Issues. The count parameter exists in the official Twitter client, but seems to be ignored on the server side.
If logged in, it always returns 25 responses and if not logged in, it always seems to return 100 responses.
Thank you for the fast reply! After additional testing, I think that the public API for getUserTweets()
returns a selection of the most popular tweets for some (maybe blue verified?) users—not the most recent tweets. It won't return any results at all for other users. I have updated my code with some examples if you want to see.
To get reliable results, I will need to to use a logged-in version of the API. Is there a version that you have been working on? I see you mention the Logged in branch, but I am not clear on how I should use this. I would be grateful for your suggestion!
getUserTweets({ userId })
is the same as the tweets you get when you visit https://twitter.com/<screenName>
The csrf token and auth token are required to use the login version of the API.
const client = await api.getClientFromCookies('<csrf toke>', '<auth token>');
await client.getUserApi().getUserTweets({ userId });
You need the cookie that is given to you after you log in with your browser.
ct0
is the csrf token and auth_token
is the auth token.
An external program is needed to automate this process. As far as I know, this is all there is, except for implementations using WebDriver and older implementations.
Recommend (Python) https://github.com/tsukumijima/tweepy-authlib My implementation (Python) https://github.com/fa0311/TwitterFrontendFlow
I've noticed that setting the value of
count
ingetUserTweets
does not appear to limit the number of results: it returns 100 results by default. This would be really useful to make smaller requests.I've reproduced the code here: https://replit.com/@simonasaservice/TweetDemo#index.js
Please let me know if there's anything else I could test, and thanks for this outstanding library! 🙏