I recently wanted to parse an RSS feed as a part of a larger script. Luckily, that boils down to just working with regular-old XML. Despite the proliferation of great libraries like BeautifulSoup, whenever possible I try to stick to the standard library. Not that using Pipenv or another Python dependency tool is necessarily a ton of work, it just feels like excess overhead. Plus, it’s just fun to explore libs I haven’t had the pleasure of interacting with.
For my use case, I wanted to parse the RSS file, then pull data from the latest article as well as randomly select a few of the older pieces. The minidom
module is our friend for this task, and as always a helpful Stack Overflow led the way
.
Let users read a random page on your site. A quick guide on how to add this feature to your site in no time.
Add search to your static site in 5 minutes, the 80/20 effort-saving guide. No dependencies needed here.
Emoji cursors changing based on position? Oh my.
The utility of Python Flask routing on a Lambda, without the framework.