Open SorenDalsgaard opened 2 years ago
Hi, thanks for reaching out!
source
doesn't seems to be stored at the moment; reader started out using a subset of the stuff feedparser exposes, and I kept adding more and more fields as I needed them.
I think source
should be relatively easy to add. I can't promise I can get to it anytime soon, but I will prioritize reviewing a pull request for it.
Some notes on implementing this.
The RSS source
just points to the original feed:
<source url="http://example.com/feed.xml">Some Feed</source>
The Atom source
is way more complicated, containing a subset of the feed
elements.
feedparser represents the RSS source element like this:
{'href': 'http://example.com/feed.xml', 'title': 'Some Feed'}
Note the href
is not a documented attribute of the feedparser entries[i].source
(but is accessible as source.url
, because source is a FeedParserDict). The Atom equivalent of href
would then be link[rel=self]
, and the reader equivalent url
(per #153, and for similarity with Feed).
It should be pretty safe to make Entry.source have a subset of the Feed attributes:
class Entry:
...
source: Optional[EntrySource]
class EntrySource:
url: str # RSS href/url; Atom link[rel=self]
updated: Optional[datetime] = None
title: Optional[str] = None
link: Optional[str] = None
author: Optional[str] = None
subtitle: Optional[str] = None
2024 implementation notes:
Additional implementation notes (in light of #290):
feed
).
Hi
First of thanks for building this great tool.
I am having a small issue with understanding how to store elements from a feed item. For this feed
https://www.newsdesk.lexisnexis.com/feed/aeb9dae6799dcbd4.rss
I am interested in storing thesource
element.How could I store this for each entry in the feed? Thanks