Skip to main content

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.

asciicast

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

twittertail-0.7.tar.gz (8.6 kB view details)

Uploaded Source

File details

Details for the file twittertail-0.7.tar.gz.

File metadata

  • Download URL: twittertail-0.7.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for twittertail-0.7.tar.gz
Algorithm Hash digest
SHA256 af74b4ee1d0426606c7deec2f829cfd546458995675b987037da2c2150f66976
MD5 f8883d9c4f4ccf454bbc86927d5cef73
BLAKE2b-256 3838dd261fa2214797d4aaf076e19969d71a4d99fa1e3a26975bcc17aac48bf7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page