As per Installation doc, activate the virtual environment before running these commands. `
$ source venv/bin/activate
Note use of unbuffered -u
flag in some cases for immediate printing.
$ make auth
Using the default.
$ make timeline
Specify a username.
$ make demo-timeline screen_name=BarackObama
$ make trends
TODO: Make this an installable package.
Use the library in your own project.
Load config details:
$ export $(< .env.local | xargs)
Set up a script.
main.py
import twitterlib.timeline
from twitterlib import api_auth
s
api = api_auth.app_access_token_api()
cursor = twitterlib.timeline.get_timeline(api, screen_name="BarackObama")
for tweet in cursor.items(300):
print(tweet.full_text)
Run it:
$ python main.py