-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Scraping functions
Basically we can get users (and their information) and tweets. But there are various ways to get tweet and user objects.
We can get tweets in three ways:
- searching for them,
twint.run.Search
- scraping the user's timeline,
twint.run.Profile
- scraping the favorite tweets of an user,
twint.run.Favorites
We can get only the usernames about the followers/following of a specific user:
- followers:
twint.run.Followers
- following:
twint.run.Following
We can also get the information about the followers/following of a specific user, or even just the user itself:
- followers/following, just add
config.User_full = True
- single user:
twint.run.Lookup
import twint
c = twint.Config()
c.Username = "twitter"
twint.run.Search(c)
import twint
c = twint.Config()
c.Username = "twitter"
twint.run.Followers(c)
import twint
c = twint.Config()
c.Username = "twitter"
c.User_full = True
twint.run.Followers(c)
import twint
c = twint.Config()
c.Username = "twitter"
twint.run.Lookup(c)
What is shadow banning? What can we do in such case?
An user might get shadow banned for various reasons. Whatever the reason is, what happens is that you will not be able to search for tweets sent by that user. This doesn't mean that the user is temporary suspended or permanently banned, so if we go to user the page we'll still be able to see his/her tweets. In situations like this one is suggested to use twint.run.Profile
. It will not return many tweets, but as of now it's the best solution.
You will still be able to search for tweets sent to the user, and tweets that mention him/her.