Giter Site home page Giter Site logo

retrofeed's People

Contributors

jeffjetton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

retrofeed's Issues

ValueError: time data '2023 9 Apr 2:52 pm EDT' does not match format '%Y %d %b %I:%M %p %Z'

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'

Small error w/ time data format

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!!

Install and Launch instructions

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

  • Insert MicroSD Card
  • Click the Operating System button to select an OS
  • Select Raspberry PI OS Lite (32-bit)
  • Click on Storage Button to select the MicroSD
  • Configure System Settings via the Imager GUI Settings button
  • Set the hostname
  • Enable SSH
  • Set Username and Password
  • Configure WIFI (only supports DHCP)

Plug in a monitor and keyboard or connect via SSH
Log In

Update the OS and Install Git

ap_news.py formatting changed??

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.