Python script to display your YouTube Subscriber count on the Pimoroni Micro Dot pHAT.
sudo apt-get install python3-microdotphator
curl https://get.pimoroni.com/microdotphat | bashsudo pip3 install --upgrade python-youtubeClone the project:
git clone https://github.com/BramDriesen/microdot-phat-youtube-subscribers.gitCopy the default-config file to config.py
cp default-config.py config.pyEdit the configuration file and add the YouTube channel you want to monitor, and the YouTube Statistics V3 API key.
API_KEY = "YOUR API KEY"
CHANNEL_ID = "YOUR CHANNEL ID"NOTE: Make sure to enable the setting "Wait for network on boot" in the Raspberry Pi config screen. Use sudo raspi-config to go to the settings.
To simply run the script execute the script file.
python3 script.pyEdit your rc.local (or use any other method as described here) file to make the script run at boot. Edit it using the command:
sudo nano /etc/rc.localUsing your cursor keys scroll to the bottom and add the following line right before the exit 0 line:
sudo python3 /home/pi/microdot-phat-youtube-subscribers/script.py & > /home/pi/youtube-subscribers.logNow reboot your Pi and the script should automatically start.
sudo reboot