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

header images for webapp #4

Open
Bhupesh-V opened this issue Apr 5, 2020 · 9 comments
Open

header images for webapp #4

Bhupesh-V opened this issue Apr 5, 2020 · 9 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers web-app Issues & PRs related to the devfeed Web App
Milestone

Comments

@Bhupesh-V
Copy link
Owner

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

@Bhupesh-V Bhupesh-V added enhancement New feature or request good first issue Good for newcomers web-app Issues & PRs related to the devfeed Web App labels Apr 5, 2020
@Bhupesh-V Bhupesh-V pinned this issue Apr 5, 2020
@Bhupesh-V
Copy link
Owner Author

Sure @olunusib 👍
Hit me up if you need any help

@Bhupesh-V
Copy link
Owner Author

@olunusib Are you working on this ?

@Bhupesh-V Bhupesh-V added this to the 0.2.0 milestone Jun 8, 2020
@olunusib olunusib removed their assignment Jun 23, 2020
@Bhupesh-V Bhupesh-V unpinned this issue Jul 1, 2020
@bgtripp
Copy link

bgtripp commented Nov 9, 2020

Hi, is this issue still open?

@Bhupesh-V
Copy link
Owner Author

Hi, is this issue still open?

yes it is

@bgtripp
Copy link

bgtripp commented Nov 12, 2020

I can give it a shot!

@bgtripp
Copy link

bgtripp commented Nov 13, 2020

Please assign it when you can.

@bgtripp
Copy link

bgtripp commented Nov 13, 2020

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
Copy link
Owner Author

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers web-app Issues & PRs related to the devfeed Web App
Projects
None yet
Development

No branches or pull requests

4 participants