Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedparser not pulling description attribute entry #130

Closed
pop-vapor opened this issue May 14, 2024 · 2 comments
Closed

Feedparser not pulling description attribute entry #130

pop-vapor opened this issue May 14, 2024 · 2 comments

Comments

@pop-vapor
Copy link

My configuration.yaml looks like this:

sensor:
  - platform: feedparser
    name: New York Times
    feed_url: 'https://rss.nytimes.com/services/xml/rss/nyt/NYRegion.xml'
    date_format: '%a, %b %d %I:%M %p'
    inclusions:
      - title
      - description
      - link
    scan_interval:
      hours: 1
  - platform: feedparser
    name: Scientific American
    feed_url: 'http://rss.sciam.com/ScientificAmerican-Global?format=xml'
    date_format: '%a, %b %d %I:%M %p'
    inclusions:
      - title
      - description
      - link
    scan_interval:
      hours: 1

But the entries for both rss feed entities looks like:

- title: Democrats’ Split Over Israel Takes Center Stage in Tense Primary Debate
  link: https://www.nytimes.com/2024/05/13/nyregion/bowman-latimer-debate.html
- title: Black Man Charged With Threatening to Kill White People in Mass Shooting
  link: >-
    https://www.nytimes.com/2024/05/13/nyregion/mercer-county-threats-white-people.html
- title: 'Michael Cohen Begins Testimony in Trump’s Hush-Money Trial: 5 Takeaways'
  link: >-
    https://www.nytimes.com/2024/05/13/nyregion/trump-trial-michael-cohen-takeaways.html
- title: Record-Breaking Ocean Heat Wave Foreshadows a Dangerous Hurricane Season
  link: >-
    https://www.scientificamerican.com/article/record-breaking-ocean-heat-wave-foreshadows-a-dangerous-hurricane-season/
- title: How to Check If You Have Immunity to Measles or Need Another Dose
  link: >-
    https://www.scientificamerican.com/article/how-to-check-if-you-have-immunity-to-measles-or-need-another-dose/

Am I missing something?

@pop-vapor
Copy link
Author

Looks like this issue is with python feedparser renaming description to "summary" - https://pythonhosted.org/feedparser/reference-entry-summary.html

The following configuration.yaml works for the sensors:

sensor:
  - platform: feedparser
    name: New York Times
    feed_url: 'https://rss.nytimes.com/services/xml/rss/nyt/NYRegion.xml'
    date_format: '%a, %b %d %I:%M %p'
    inclusions:
      - title
      - summary
      - link
    scan_interval:
      hours: 1
  - platform: feedparser
    name: Scientific American
    feed_url: 'http://rss.sciam.com/ScientificAmerican-Global?format=xml'
    date_format: '%a, %b %d %I:%M %p'
    inclusions:
      - title
      - summary
      - link
    scan_interval:
      hours: 1

@kk-sonata
Copy link

Would be worth an update to the documentation to reflect the change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants