https://github.com/chfoo/litterapi
An API built from Twitter's web interface.
https://github.com/chfoo/litterapi
Last synced: 9 months ago
JSON representation
An API built from Twitter's web interface.
- Host: GitHub
- URL: https://github.com/chfoo/litterapi
- Owner: chfoo
- License: gpl-3.0
- Archived: true
- Created: 2014-12-26T20:51:30.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-26T21:02:39.000Z (about 11 years ago)
- Last Synced: 2025-03-24T20:14:51.963Z (11 months ago)
- Language: Python
- Size: 109 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
=========
Litterapi
=========
An API built from Twitter's web interface.
Twitter's API doesn't serve the same results from their web search especially with historical operators. This Python library exposes an API scraped from their web pages.
Search is currently supported.
Install
=======
Requires:
* Python 3.2 or greater
* requests
* html5lib
If you have pip, you can run::
pip3 install git+https://github.com/chfoo/litterapi#egg=litterapi --user
Quick Start
===========
To start searching quickly::
python3 -m litterapi search "cat"
Will return JSON formatted lines (line-breaks added for clarity)::
{
"tweet_id": "12345",
"screen_name": "catlover456",
"user_id": "7890",
"timestamp": 14567890,
"text": "Have you seen this cat? So cute! pic.twitter.com/photo/abcd,
"urls": [
["http://t.co/abcdef134", "http://pic.twitter.com/photo/abcd"]
]
}
Through the fake API::
api = SearchAPI('cat')
while True:
results = api.fetch()
if not results:
break
for result in results:
print(json.dumps(result))
time.sleep(1)