defe
defe copied to clipboard
header images for webapp
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 :sweat_smile: )
Hi, I would like to take on this task. Please assign.
Regards, Best Olunusi.
Sure @Olunusib :+1: Hit me up if you need any help
@Olunusib Are you working on this ?
Hi, is this issue still open?
Hi, is this issue still open?
yes it is
I can give it a shot!
Please assign it when you can.
Hi, I implemented a way for this to work using the media_content and links keys as suggested. This works well for the general and news feeds, but those keys almost never exist for the podcasts or newsletters feeds. Should I submit a pull request for this initial solution?
Hi, I implemented a way for this to work using the media_content and links keys as suggested. This works well for the general and news feeds, but those keys almost never exist for the podcasts or newsletters feeds. Should I submit a pull request for this initial solution?
Sure. We can ignore header images for podcasts and newsletters
Hello @Bhupesh-V , I would like to work on this issue. This is my first contribution . Please assign me a file accordingly.