Tail a twitter account from the command line.
Project description
twittertail
This python app monitors a Twitter account for tweet activity, using the asyncio library to create an event loop for the life of the running app. On execution, the 5 most recent tweets are displayed (like tail, so oldest to newest), and every 10 minutes new tweet activity is displayed. The app also includes an inbuilt HTTP API to retrieve all displayed tweets so far.
setup
This demo requires Python 3 (tested on Python 3.7.5+). To install:
pip install twittertail
cli
The cli program can be run like so:
twittertail -u TWITTER_USERNAME
See -h for more options.
HTTP
By passing in a -w argument, a simple HTTP server will run, allowing you to query the tweets collected so far, which is returned in a application/json response as a JSON object.
twittertail -u TWITTER_USERNAME -w
Get tweets via:
curl http://127.0.0.1:9000/tweets
Run as a Docker container
To run this as a Docker container, first build the image from the app's root directory:
sudo docker build -t twittertail .
And then run the container, passing in the Twitter username you want to monitor as the first argument:
sudo docker run --rm -p 9000:9000 twittertail tinycarebot
This also runs the HTTP server on port 9000.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file twittertail-0.8.tar.gz.
File metadata
- Download URL: twittertail-0.8.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e41095b238bba567e92c01c7dad2649f0a8952f9dcd084fa690a5039e62fd5a4
|
|
| MD5 |
e45cbc5bd9fc140c0cdac4f4e5cda8b3
|
|
| BLAKE2b-256 |
fddc34f7f3f847f7a68c2eb15905ccfe348779849f92fc6a68095b52b85cb275
|