probnot / wpg-weatherchan

This creates the old-school looking weather channel that was common on Winnipeg cable TV into the 1990s.
MIT License
128 stars 19 forks source link

Bottom panel used to show City of Winnipeg's RSS feed broken #4

Closed dcepticon closed 8 months ago

dcepticon commented 11 months ago

Bug description: Running script produces an error likely caused by the City of Winnipeg's website restructuring RSS Feeds.

fibrely@weather:~/wpg-weatherchan $ python3 wpg-weatherchan.py pygame 2.1.2 (SDL 2.26.5, Python 3.11.2) Hello from the pygame community. https://www.pygame.org/contribute.html 10:35.wpg-weather.2.0.4.ROOT-placing clock 10:35.wpg-weather.2.0.4.ROOT-launching clock updater 10:35.wpg-weather.2.0.4.ROOT-placing Title Text 10:35.wpg-weather.2.0.4.ROOT-launching weather update 10:35.wpg-weather.2.0.4.WEATHER_UPDATE-weather group 0 updated in 19.45 seconds 10:35.wpg-weather.2.0.4.ROOT-launching weather_page 10:35.wpg-weather.2.0.4.ROOT-launching playlist generator 10:35.wpg-weather.2.0.4.PLAYLIST_GENERATOR-searching for music files... 10:35.wpg-weather.2.0.4.PLAYLIST_GENERATOR-found 1 10:35.wpg-weather.2.0.4.ROOT-launching background music 10:35.wpg-weather.2.0.4.MUSIC_PLAYER-playlist complete,re-shuffling... 10:35.wpg-weather.2.0.4.ROOT-launching bottom_marquee 10:35.wpg-weather.2.0.4.BOTTOM_MARQUEE-RSS feed refreshed Traceback (most recent call last): File "/home/fibrely/wpg-weatherchan/wpg-weatherchan.py", line 803, in bottom_marquee(grouptotal) File "/home/fibrely/wpg-weatherchan/wpg-weatherchan.py", line 595, in bottom_marquee wpg_desc = wpg.entries[0]["description"] + pad + wpg.entries[1]["description"] + pad + wpg.entries[2]["description"] + pad + wpg.entries[3]["description"] + pad + wpg.entries[4]["description"] + pad + wpg.entries[5]["description"] + pad + wpg.entries[6]["description"] + pad + wpg.entries[7]["description"]


IndexError: list index out of range

Note: When visiting https://winnipeg.ca/interhom/RSS/RSSNewsTopTen.xml we get a 404 page. If I comment out lines 802 and 803 the script works without the bottom RSS Feed.

Environment information:
Raspberry Pi 4 running Raspberry Pi OS Bookshelf Linux 6.1.0-rpi4-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.54-1+rpt2 (2023-10-05) aarch64 GNU/Linux
Python 3.11.2

Steps to reproduce:
Run python3 wpg-weatherchan.py

![20231028_105050](https://github.com/probnot/wpg-weatherchan/assets/1232167/2561cbec-1265-4d3e-b402-8ccb9a056243)
dcepticon commented 11 months ago

When I changed the url to https://www.winnipeg.ca/rss/en/media-releases.xml it works but with "< span >" and "< p >" tags now.

20231028_155111 (1)

probnot commented 11 months ago

You've run into the same issue I had, and I haven't had time to delve into it. The City of Winnipeg discontinued their old RSS feed, and the new one just contains links. I searched for a short while for an RSS feed that just contains the little news blurbs in it, but nothing yet. Mine is also commented out for now.

I think the whole RSS section needs a rewrite, as well as needing to source a good feed for text on the bottom.

probnot commented 11 months ago

I'll probably do a quick update to comment it out with a note for now.

dcepticon commented 11 months ago

Thank you, and thanks for some amazing software! I'm a beginner programmer so maybe I'll see if I can hone my chops on a project!

Tekhnocyte commented 8 months ago

Man, I'll tell you, getting all of the prerequisites installed for the Environment Canada package was a lot of hoop jumping I'll tell ya, a real learning experience for someone extremely new to Python, but I got it done.

As for the rss feed problem, the feed over at CTV seems to be tag free, and displays properly. http://winnipeg.ctvnews.ca/rss/winnipeg

Did a little hunting around to see if there was a package that maybe parsed out just the text from a variable, but I think I'm just a little too green yet. Gonna keep going though, this has definitely reignited my programming passion.

probnot commented 8 months ago

Man, I'll tell you, getting all of the prerequisites installed for the Environment Canada package was a lot of hoop jumping I'll tell ya, a real learning experience for someone extremely new to Python, but I got it done.

As for the rss feed problem, the feed over at CTV seems to be tag free, and displays properly. http://winnipeg.ctvnews.ca/rss/winnipeg

Did a little hunting around to see if there was a package that maybe parsed out just the text from a variable, but I think I'm just a little too green yet. Gonna keep going though, this has definitely reignited my programming passion.

Thanks! Just switched the URL to that and it works great. I'll update it here just for people in the future.