Scrape the Twitter Frontend API without authentication.
Project description
Twitter Scraper
Twitter’s API is annoying to work with, and has lots of limitations — luckily their frontend (JavaScript) has it’s own API, which I reverse–engineered. No API rate limits. No restrictions. Extremely fast.
You can use this library to get the text of any user’s Tweets trivially.
Very useful for making markov chains.
Usage
>>> from twitter_scraper import get_tweets
>>> for tweet in get_tweets('kennethreitz', pages=1):
>>> print(tweet)
P.S. your API is a user interface
s3monkey just hit 100 github stars! Thanks, y’all!
I’m not sure what this /dev/fd/5 business is, but it’s driving me up the wall.
…
It appears you can ask for up to 25 pages of tweets reliably (~486 tweets).
Markov Example
First, install markovify:
$ pipenv install markovify
>>> import markovify
>>> tweets = '\n'.join([t for t in get_tweets('kennethreitz', pages=25)])
>>> text_model = markovify.Text(tweets)
>>> print(text_model.make_short_sentence(140))
Wtf you can’t use APFS on a prototype for “django-heroku”, which does a lot out of me.
Installation
$ pipenv install twitter-scraper
Only Python 3.6+ is supported.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
twitter-scraper-0.2.1.tar.gz
(3.6 kB
view details)
Built Distribution
File details
Details for the file twitter-scraper-0.2.1.tar.gz
.
File metadata
- Download URL: twitter-scraper-0.2.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29ed35b0c46cb9b3bce2e1ce906dafcf8eb361827bdcc6a203d181d06c62eeea |
|
MD5 | 68cf612d6adc084b6eb69da673e17879 |
|
BLAKE2b-256 | c9cc2eb1598158a2593165535ea14533ec7e35772bd7319276d104d1d44b35fb |
File details
Details for the file twitter_scraper-0.2.1-py2.py3-none-any.whl
.
File metadata
- Download URL: twitter_scraper-0.2.1-py2.py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7032fbdcf62080241dddef64677d18fedd3a4cce130a5a03a75c66754a8a7d27 |
|
MD5 | 79e68055f1c6e2ccc4950516ac0f70d0 |
|
BLAKE2b-256 | c034f47c6b53c2e8996c1bfc2a6f9152addd10be2eea0bf496fbf4e5ab326f4d |