dmpop / sonnenhut

Simple dashboard for photographers
GNU General Public License v3.0
5 stars 0 forks source link

Add RSS feed #29

Closed dmpop closed 7 years ago

dmpop commented 7 years ago

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