Skip to content

header images for webapp #4

Description

@Bhupesh-V

Is your feature request related to a problem? Please describe.
It would be nice to show some header images (if the feed provides it)
Something like this probably

Describe the solution you'd like
For every card rendered on webapp we can show the image if it exists
The feedparser library colllects these links for us in a single key

f3 = feedparser.parse("https://www.telegraph.co.uk/technology/rss.xml")
f3.entries[0].links
[{'rel': 'alternate', 'type': 'text/html', 'href': 'https://www.telegraph.co.uk/technology/0/houseparty-app-delete-account-is-safe/'}, {'length': '99', 'type': 'image/jpeg', 'href': 'https://www.telegraph.co.uk/content/dam/technology/2020/03/31/Conversation-8-People_trans_NvBQzQNjv4BqZgEkZX3M936N5BQK4Va8RWtT0gK_6EfZT336f62EI5U.jpg', 'rel': 'enclosure'}]

Usually the images will exist in either the links key or sometimes in media_content

>>> f = feedparser.parse("https://www.freecodecamp.org/news/rss/")
>>> f.entries[0].keys()
dict_keys(['title', 'title_detail', 'summary', 'summary_detail', 'links', 'link', 'id', 'guidislink', 'tags', 'authors', 'author', 'published', 'published_parsed', 'media_content', 'content'])
>>> f.entries[0]['media_content']
[{'url': 'https://www.freecodecamp.org/news/content/images/2020/04/sunset_loading2-1.gif', 'medium': 'image'}]

One thing to note that the images may exist for some source & not for others, so make sure there is a fallback mechanism (if/else to say 😅 )

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestgood first issueGood for newcomersweb-appIssues & PRs related to the devfeed Web App

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions