As part of my Raspberry Pi powered status script I show the current weather for my city of Montreal. At first I used the widget provided by Weather Canada, but I decided to move to a custom web page by using a simple Python script that reads the RSS feed from the same Weather Canada service, and then show the result using Font Awesome icons and the Bootstrap framework. This is what the result looks like: The first thing to do is import the needed libraries, including feedparser which allows us to parse the RSS feed, then connect to the feed and extract the information. Finally, we display a bootstrap table with the data for the few next upcoming days. This is the complete code: #!/usr/bin/env python3 import os import sys import time import connix import feedparser import re # This is the feed URL rss = feedparser.parse("https://weather.gc.ca/rss/city/qc-147_e.xml") print(connix.header()) print("<html><head><link href='https://ma
Posts about technology, DevOps, the cloud and more.