Skip to content
I want to send a a daily tweet with the results of what my @pi-hole blocked and other system stats.
Branch: master
Clone or download
Pull request Compare This branch is 158 commits behind mwoolweaver:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Send a daily tweet with your Pi-Hole statistics and other system information!

How to use


  • Pi-hole

    • install Pi-hole (
    • api_path = Path to http://pi.hole/admin/api.php of Pi-Hole (if you're running this script from the machine running Pi-hole that URL should work)
  • Twitter

    • Tokens: Create an application here
  • speedtest-cli

Guided Setup (install script)


Manual Setup (no install script)

  1. git clone
  2. Install Python 3
  3. pip3 install -U -r requirements.txt
  4. cp config.json.example config.json and adjust it
  5. Run it! python3 or python3 -h for help
  6. ???
  7. Profit

cmd line args for testing

  • -db will print the tweet to be sent and all other variables that are used in the proccess.

  • -dbl will test your twitter credentials to test a successful login.

  • -dbp will make sure the pi-hole api can be reached.


test cron job w/ sudo run-parts /etc/cron.daily

Use Install Script


Manual Setup

creaate file /etc/cron.daily/tweetStats with the following contents

cd /path/to/folder/containing/
python3 ./ >> tweetStats.txt

How it looks

Tweet 1
Blocklist Size: 761,313
Total Queries: 25,137
Queries Blocked: 0|0%
Queries Forwarded: 509
Queries Cached: 24,628
Unique Clients: 1
Privacy Level: 2
Gravity Last Updated: 2019-07-16 18:03

 Tweet 2
CPU Load AVG: 0.08, 0.02, 0.01
Ram Usage: 483M/1G|39.3%
Disk Usage: 9G/28G|32.14%
Network Interfaces: ens4, tun0, tun1
Kernel && OS: Linux-5.0.0-1010-gcp-x86_64-with-Ubuntu-19.10-eoan
Boot Time: 2019-07-16 18:12

 Tweet 3
Ping: 38.68 ms
Down/Up Speed: 994.81 Mbps/409.19 Mbps
Data Used (dl/ul): 390.41 MB/144.5 MB
IP: 35.222.xx.xx
ISP: Google Cloud
Region: Virginia
Continent: North America


You can’t perform that action at this time.