jeffjetton / retrofeed Goto Github PK
View Code? Open in Web Editor NEWUse a Raspberry Pi to display weather, news, and other information, vintage-style, on a composite monitor
License: MIT License
Use a Raspberry Pi to display weather, news, and other information, vintage-style, on a composite monitor
License: MIT License
Getting the following error when running retrofeed on python 3, Windows 11 or ubuntu server:
[CHECKING FOR WEATHER UPDATES...]
Traceback (most recent call last):
File "C:\Users\srvr01\retrofeed-main\retrofeed.py", line 395, in <module>
main()
File "C:\Users\srvr01\retrofeed-main\retrofeed.py", line 370, in main
wx = show_weather(wx)
^^^^^^^^^^^^^^^^
File "C:\Users\srvr01\retrofeed-main\retrofeed.py", line 214, in show_weather
wx = weather.get_weather(WX_LAT, WX_LON, WX_LOCATION)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\srvr01\retrofeed-main\weather.py", line 83, in get_weather
dt_object = dt.datetime.strptime(dt_string, '%Y %d %b %I:%M %p %Z') #31 Jan 3:53 pm CST
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\srvr01\AppData\Local\Programs\Python\Python311\Lib\_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\srvr01\AppData\Local\Programs\Python\Python311\Lib\_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '2023 9 Apr 2:52 pm EDT' does not match format '%Y %d %b %I:%M %p %Z'
I'm working on getting this to work on a P Zero-W using Raspbian Lite and wanted to capture issues and approach.
I'm currently stuck on how to run the scripts. I changed the permissions to allow to 711 but am stuck from there.
Here's the instructions I have so far.
To make troubleshooting easier, I'm working an approach that connects to an HDMI monitor fist, get it working and then connect to an analog display once the basics are working. I expect there may be many who would like to get this running but don't have an analog display available.
Download and open Raspberry Pi Imager to Windows desktop to provision microSD card with OS
Plug in a monitor and keyboard or connect via SSH
Log In
Update the OS and Install Git
My ap_news.py only returns "NEWSFEED UNAVAILABLE". I've been debugging and apnews.com doesn't seem to return text with the old "headline:" and other prompts ap_news.py looks for...
Has anyone fixed this on their own yet??? Or, should I post my current [failed] attempts:
changed ./segments/spot-the-station.py;
#LINE 70 changed to:
-----
# Assuming the input is always "{ts '...'}"
date_string_clean = date_string[5:-2]
date_time = dt.datetime.strptime(date_string_clean, '%Y-%m-%d %H:%M:%S') - utc_diff
-----
added to debug lines to ./segments/ap_news.py;
#LINE 86 - #Comment out when done!!!
-----
#DEBUGGING:
with open("debug.txt", "w", encoding="utf-8") as f:
f.write(str(response.status_code) + "\n")
f.write(response.text[:1000] + "\n\n")
f.write(response.text)
-----
changed get_headlines function in ./segments/ap_news.py;
-----
def get_headline(self, s):
pos_start = s.find('<a class="Link "')
if pos_start < 0:
return None
pos_start = s.find('>', pos_start) + 1 # Find the next '>' after the start position
pos_end = s.find('</a>', pos_start) # Find the closing tag '</a>'
if pos_end < 0:
return None
headline = s[pos_start:pos_end]
return self.d.strip_tags(self.d.clean_chars(headline))
-----
changed code in ./segments/ap_news.py;
-----
#if headline is not None and summary is not None and headline.lower().find('top stories ') < 0:
#self.data['items'].append({'headline':headline, 'summary':summary})
if headline is not None and headline.lower().find('top stories ') < 0:
if summary is None:
summary = "Summary not available."
self.data['items'].append({'headline':headline, 'summary':summary})
-----
ap_news.py is still broke - but we did fix the spot-the..py.
reinstalled original ap_news.py - must fix later.
ValueError: time data '2023 13 Feb 6:53 pm CST' does not match format '%Y %d %b %I:%M %p %Z'
I ran the .py once, and it worked - but every time after I get the above... will dig in a bit - this is awesome, I'm just starting to play around with it. Thanks!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.