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.6.tar.gz (8.0 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: twittertail-0.6.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.5

File hashes

Hashes for twittertail-0.6.tar.gz
Algorithm Hash digest
SHA256 dc87538d3cc5d6bdfc3cd1cdec407a05c9f89943c0eb98e546e56a28390b10a8
MD5 de66f5c67fffd24c932b2d62464a282f
BLAKE2b-256 74f5a4adea4e9e753ce2514cc1b451bda401ea93a0a9d3207d12121df31c9782

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