psisysinsight / tweeter-lite

Tweet validation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

Lightweight Tweet Validator

This project can be used to verify Twitter messages (tweets) against two constraints:

  1. Length: tweets can be only so long
  2. Valid URL: If you embed a URL use Python httpx to ensure it works

Install the required packages with pip install -r requirements.txt.

Then, run the script with python tl.py.

If the length is too long, you'll see a message like this:

bad/long.txt: Message to long -> 283 < 260
-------------------------------------------------------

If the URL does not return status 200 (OK), you'll see a message like this:

http://njrusmc.net/bad: HEAD failed -> 404 / Not Found
-------------------------------------------------------

Regardless, the text of the tweet is printed out last, allowing for easy copy/paste into Twitter. The absence of any error messages is an indication that the tweet has passed all tests.

About

Tweet validation


Languages

Language:Python 83.8%Language:Makefile 16.2%