sbdaman
#1
Hi,
I’m using rtweet package with rstudio.
I have a dataframe, lets call it “students” with a list of 272 users. The columns in students are user_id, screen_name, full_name.
I have a second dataframe, lets call it “professors” with a list of 35 users. The columns in professors are user_id, screen_name, full_name.
I want to see how many students follow each professor. Is this possible? I figure I want to check if “followed_by” under “get_friendships” is true for each professor for each student. I really am out of my depth here.
Any way to do this?
I want to see how many students follow each professor. Is this possible?
Sure, it might take a while because of rate limits but you can use GET followers/ids | Docs | Twitter Developer Platform for each professor, https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friends-ids for each student and look at the ids for overlaps. For most users you will only need 1 call because it can return 5000 ids and most people follow and are followed by far fewer number of people than that