TwitterAPI-Wrapper
- Create file called .env in the top folder of the repository
- Define API_KEY and API_SECRET_KEY with your twitter credential as following:
API_KEY={your_api_key}
API_SECRET_KEY={your_secret_api_key}
pip install -r requirements
# you can use the config file called 'config.yaml' to configure you run. then:
from twitter import Twitter
twitter = Twitter()
res = twitter.search_wrapper()
# you can also do it without the config file (more flexible query)
from datetime import timedelta
from twitter import Twitter
twitter = Twitter()
res = twitter.search(
query="unfollow OR unfriend OR unfollowing OR unfollowed",
time_window=timedelta(
days=0,
hours=1,
minutes=0
),
max_size=138
)