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

Add RSS feed #29

Closed
dmpop opened this issue Feb 26, 2017 · 0 comments
Closed

Add RSS feed #29

dmpop opened this issue Feb 26, 2017 · 0 comments

Comments

@dmpop
Copy link
Owner

dmpop commented Feb 26, 2017

http://pythonhosted.org/feedparser/

#!/usr/bin/env python3
import feedparser
rss = feedparser.parse('http://www.amateurphotographer.co.uk/feed')
count = 1
html_feed = []
for post in rss.entries:
    if count < 5:
        item = '<a href="'+ post.link +'>'+ post.title +  '</a><br />'
        html_feed.append(item)
        count += 1
print(rss.feed.title)
print('\n'.join(html_feed))
@dmpop dmpop self-assigned this Feb 26, 2017
@dmpop dmpop closed this as completed in 4dc0f33 Feb 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant