This is the official rpilocator.com and hwlocator.com RSS feed reader and push notification scripts. It checks the RSS feed every minute and sends a push notification when a product comes in stock.
Send Pushbullet, Pushover or Gotify notifications to your device.
If you appreciate the work I do with rpilocator.com and hwlocatorcom consider buying me a coffee. I spend a lot of time looking for Raspberry Pi computers (and other hardware), tweaking the sites, and communicating with different sellers so you don't have to spend your time doing it.
Download Pushbullet to your device (Android/iOS app or Browser extension). After logging in to your Pushbullet account, create an Access Token. This token is used to send a push notification to your devices through the Pushbullet API.
Edit the script and enter your Access Token.
PUSHBULLET_TOKEN = '<your access token here>'
Download Pushover to your device (Android/iOS/Desktop). After logging in to your Pushover account, register an application. You will need your user key and the application token/key send a push notification to your devices through the Pushover API.
Edit the script and enter your user key and application token/key.
# User Key
PUSHOVER_KEY = '<your user key here>'
# Application Key
PUSHOVER_API_KEY = '<your application key here>'
Create an application in your Gotify server. You will need the token from this to send a push notification to your devices through the Gotify API.
Edit the script and enter your server base URL and application token.
# Gotify Server Base URL e.g. https://mygotifyserver.com
GOTIFY_BASE_URL = '<your gotify server url>'
# Application Key
GOTIFY_TOKEN = '<your application key here>'
Create a bot via telegrams 'BotFather'. You will need the token from this and your own telegram chat id.
Edit the script and enter your bot token and chat_id.
# Telegram settings
TELEGRAM_BOT_TOKEN = '<your telegram bot token>'
TELEGRAM_CHAT_ID = '<your telegram chat id>'
The script uses the Feedparser module to parse RSS feed information, so you'll have to install it first.
pip install feedparser
It also uses Requests to send the notification to the Pushbullet API.
pip install requests
For the telegram version you will also need the python telegram bot module.
pip install python-telegram-bot
The easiest way to run this scrip continuously is to use nohup
nohup python3 rpilocator-rss-pushbullet.py &
If you would like to only get notified if certain product categories come in stock in a certain country (for example), you can use the feed customizer at rpilocator.com or hwlocator.com.
After customzing the feed, update the FEED_URL
variable.
FEED_URL = 'https://rpilocator.com/feed/?country=US,CA&cat=CM4'
The example above will only send notifications if Compute Module 4 comes in stock at a US or Canadian store.
The script is set to check the RSS feed every minute. Don't be tempted to change this to a faster update interval. Faster updates will be blocked and you will end up missing a stock alert :)
Feel free to modify the script and use with other RSS feeds. If you do so, please change the User Agent to something else. The User Agent is how web servers identify which software is accessing their website.