Bhupesh-V / defe

devfeed is a Tech feed Aggregator for Developers & Tech Enthusiasts
GNU General Public License v2.0
30 stars 17 forks source link

header images for webapp #4

Open Bhupesh-V opened 4 years ago

Bhupesh-V commented 4 years ago

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: )

Bhupesh-V commented 4 years ago

Sure @Olunusib :+1: Hit me up if you need any help

Bhupesh-V commented 4 years ago

@Olunusib Are you working on this ?

bgtripp commented 4 years ago

Hi, is this issue still open?

Bhupesh-V commented 4 years ago

Hi, is this issue still open?

yes it is

bgtripp commented 4 years ago

I can give it a shot!

bgtripp commented 4 years ago

Please assign it when you can.

bgtripp commented 4 years ago

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?

Bhupesh-V commented 4 years ago

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

aakashraj01 commented 3 years ago

Hello @Bhupesh-V , I would like to work on this issue. This is my first contribution . Please assign me a file accordingly.