zedeus / nitter

Alternative Twitter front-end
https://nitter.net
GNU Affero General Public License v3.0
9.94k stars 528 forks source link

[Enhancement] Following/followers lists #187

Open stemy2 opened 4 years ago

stemy2 commented 4 years ago

Hello,

For now, we can't see the list of persons following/being followed by someone. We can only see the number, not the persons. Is the functionality implementable ?

zedeus commented 2 years ago

I believe it is implementable yes, I played around with the required endpoints many moons ago

shtefcs commented 2 years ago

I believe it is implementable yes, I played around with the required endpoints many moons ago

Hi Zed, is there a way to share more info on this? I am interested if we are able to get a full list or at least some number of followers of a certain account?

Would be grateful if you can point me somewhere, even its includes a solution outside of Nitter. And yeah, trying to do this without a Twitter Developer account.

zedeus commented 2 years ago

@shtefcs Following: https://api.twitter.com/1.1/friends/list.json?screen_name=<username> Followers: https://api.twitter.com/1.1/followers/list.json?screen_name=<username>

shtefcs commented 2 years ago

wow that was fast and very interest. I just tried to query, but getting {"errors":[{"code":215,"message":"Bad Authentication data."}]}

I guess this not requiring any authentication?

zedeus commented 2 years ago

You need to authenticate using a guest token. curl 'https://api.twitter.com/1.1/guest/activate.json' -H "authorization: Bearer AAAAAAAAAAAAAAAAAAAAAPYXBAAAAAAACLXUNDekMxqa8h%2F40K4moUkGsoc%3DTYfbDKbT3jJPCEVnMYqilB28NHfOPqkca3qaAxGfsyKCs0wRbw" -X POST

Then take the token you get, and use the endpoints like this: curl 'https://api.twitter.com/1.1/followers/list.json?screen_name=elonmusk' -H 'authorization: Bearer AAAAAAAAAAAAAAAAAAAAAPYXBAAAAAAACLXUNDekMxqa8h%2F40K4moUkGsoc%3DTYfbDKbT3jJPCEVnMYqilB28NHfOPqkca3qaAxGfsyKCs0wRbw' -H 'x-guest-token: <token>'

shtefcs commented 2 years ago

You need to authenticate using a guest token. curl 'https://api.twitter.com/1.1/guest/activate.json' -H "authorization: Bearer AAAAAAAAAAAAAAAAAAAAAPYXBAAAAAAACLXUNDekMxqa8h%2F40K4moUkGsoc%3DTYfbDKbT3jJPCEVnMYqilB28NHfOPqkca3qaAxGfsyKCs0wRbw" -X POST

Then take the token you get, and use the endpoints like this: curl 'https://api.twitter.com/1.1/followers/list.json?screen_name=elonmusk' -H 'authorization: Bearer AAAAAAAAAAAAAAAAAAAAAPYXBAAAAAAACLXUNDekMxqa8h%2F40K4moUkGsoc%3DTYfbDKbT3jJPCEVnMYqilB28NHfOPqkca3qaAxGfsyKCs0wRbw' -H 'x-guest-token: <token>'

Thank you a lot! Will share with my team mates this and see how it goes.

Is there any limit on followers response, how many followers u can get?

zedeus commented 2 years ago

Not that I know of, just use the cursor (in next_cursor_str, add as query parameter using min_position or max_position not sure which one) to get the next page of responses

shtefcs commented 2 years ago

okay, thanks mate alot. Nitter is really great project, we wanted to use it in our project, but looked like overkill, specially now that you shared those API accesses.

cypherbits commented 2 years ago

I tried the APIs but this seems to only bw working on the "old" v1.1 API with the guest token. This means that we can implement this feature but if Twitter removes the v1.1 we can't do anything since the v2 or graphql api seems it does not work.