Using a Local RSS File as My Notification System
2024-06-08 - [53] 3:20
Recently, "Garage: Bad Dream Adventure" came out on the Nintendo Switch eShop for $24.99 USD, as opposed to its $19.90 USD price on steam or $4.99 USD price on the Apple app store and Google Play. Considering how generally niche this game is, I suspect it will go on sale at some point on the Nintendo eShop. I wanted to write a quick program that can scrape the page on nintendo.com to see if a sale is happening and how long the sale is going on for. Not just for this game, but potentially for other games I might have my eye on as well. Building that web page scraper was relatively straight forward for me, but I needed to solve another problem... How do I get that information in front of me so I am made aware of it?
There are a few things I check on my computer nearly every day, and sometimes multiple times a day. One of those things would be email. Initially I wanted to have my program email me when it detects specific sales, but I didn't really feel like dealing with spam filters to make sure the emails come through for me to see. Another thing I check often enough is my RSS feed reader. That's what I decided to build these notifications for.
Turns out it's really easy for the RSS feed reader I use, newsboat, to load a local RSS feed file. Newsboat also has good RSS feed item caching, where it uses the value of guid to determine if a new RSS feed item is available so newsboat can tell me that there's a new RSS feed item. I use the SHA256 hash of the RSS feed item description (the content) as for the guid value, which means newsboat will only show me that there's a new feed item when it hasn't seen that exact description before.
There are only 2 cases where the guid will match a different RSS feed item in the newsboat cache:
- There are no deals
- The current deal is the same as the last time newsboat checked the RSS feed
In both of these cases, I'm not alerted more than once by newsboat, as long as I don't clear the newsboat cache. This means I can rewrite the RSS feed file as many times as I want. I also only need to use a single RSS feed item for the feed file.
I'm pretty sure I will end up using this idea again of having a local RSS feed file for notifications I should see in the future.
Below is an example RSS feed file created by my Nintendo eShop scraping program:
<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
<channel>
<title>Nintendo eShop Sales</title>
<link>http://localhost</link>
<description>Self-generated RSS feed to show Nintendo eShop sales</description>
<item>
<title>Current Nintendo eShop Sales</title>
<link>http://localhost</link>
<guid>4d06bc884c45a764cafe019706d9a509aab59fa1dc79d51aee4e07e0fa7e1a22</guid>
<pubDate>Sat, 08 Jun 2024 02:28:47 +0000</pubDate>
<description><![CDATA[<h1>Current Nintendo eShop Sales</h1>
<h2>Mysterious Retro Games Bundle</h2>
<p>Current Price: $1.99 USD (80% Off)
<br>
Normal Price: $9.99 USD
<br>
Sale Ends: Jun 24, 2024 06:59 UTC
<br>
<a href="https://www.nintendo.com/us/store/products/mysterious-retro-games-bundle-switch/" target="_blank">eShop Page</a></p>
<h2>The Last Campfire</h2>
<p>Current Price: $1.99 USD (86% Off)
<br>
Normal Price: $14.99 USD
<br>
Sale Ends: Jun 11, 2024 06:59 UTC
<br>
<a href="https://www.nintendo.com/us/store/products/the-last-campfire-switch/" target="_blank">eShop Page</a></p>
]]></description>
</item>
</channel>
</rss>
Contact/Reply
If you would like to reply to this post, feel free to send me an email.
Email: vi@vigrey.com [Email]
PGP Public Key [515F AD67 F931 0A2B 9B93 CE19 814F ECB1 A398 63CE]