35
loading...
This website collects cookies to deliver better user experience
pip install requests_oauthlib
, then run python script.py
. I also like to use venv)from requests_oauthlib import OAuth1Session
twitter = OAuth1Session(
client_key='FILL_ME_IN',
client_secret='FILL_ME_IN',
resource_owner_key='FILL_ME_IN-FILL_ME_IN',
resource_owner_secret='FILL_ME_IN'
)
print(twitter.get( 'https://api.twitter.com/2/users/by/username/swyx').json())
print(twitter.get( 'https://api.twitter.com/2/users/1465910794114134018/following/?user.fields=public_metrics').json())
$ pip install twitter-to-sqlite
$ twitter-to-sqlite auth
Create an app here: https://developer.twitter.com/en/apps
Then navigate to 'Keys and tokens' and paste in the following:
API key: xxx
API secret key: xxx
Access token: xxx
Access token secret: xxx
$ twitter-to-sqlite user-timeline twitter.db
Importing tweets [#####-------------------------------] 2799/17780 00:01:39
twitter.db
file containing every tweet you've ever made or liked or retweeted that is still on your timeline (timeline gets cut off after 3,200 tweets). You can also crawl your followers with twitter-to-sqlite followers twitter.db
.git clone https://<git access token>@api.glitch.com/git/swyx-twitter-datasette
cd swyx-twitter-datasette
git checkout -b addData
###
# add/replace your twitter.db file to this repo and commit it
###
git push --set-upstream origin addData
git merge addData
refresh