Image of a small electronic paper display being held by a thumb and forefinger, displaying a news tweet from the AP
Image of a small electronic paper display being held by a thumb and forefinger, displaying a news tweet from the AP

Twitter Breaking News on the Inky PHAT from Pimoroni

Some code from here and there, a very small computer and a small e-paper screen, and you get a nice little breaking news notification machine.

What you need

Initial Raspberry Pi Set Up

cd /Volumes/boot
touch ssh
sudo nano wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US # Make sure to use the right country
network={
ssid="Name of your wireless LAN" # Remember to replace the name of your wireless network here
psk="Password for your wireless LAN" # Remember to replace with the password for your wireless here
}
ssh YOUR.IP.ADDRESS.HERE -l pi
sudo raspi-config
sudo shutdown -h

Attach Inky PHAT and Install Software

curl https://get.pimoroni.com/inky | bash

Get Twitter API Keys

Create a Python Script Like the “config.py” File in This Repository, or Clone It

sudo nano config.py

Create a Python Script Like the “breaking.py” File for Your Breaking News

sudo nano breaking.py

You’ll Need Tweepy

sudo pip install tweepy

Try Out Your Script

python3 breaking.py

Using Crontab to run the script every few minutes

chmod +x breaking.py
crontab -e
# Run the clean-up at midnight on the first day of each month
0 0 1 * * python3 /inky-phat/examples/clean.py
# Run the breaking news every three minutes. Without the dash,
# it would run on the 3s of every hour
*/3 * * * * python3 /home/pi/Inky-PHAT-Breaking-News/breaking.py

Didn’t Work?

A Few Words of Warning

sudo reboot
sudo shutdown -h

Doctor of Public Health in Epidemiology. Associate at JHSPH. Adjunct at George Mason Univ. Epidemiologist at a large County Health Department. Father. Husband.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store