Skip to content

Instantly share code, notes, and snippets.

@JayCuthrell
Created September 12, 2020 21:13
Show Gist options
  • Save JayCuthrell/36ffab7709d7cd680c32fbf3e3b36cf8 to your computer and use it in GitHub Desktop.
Save JayCuthrell/36ffab7709d7cd680c32fbf3e3b36cf8 to your computer and use it in GitHub Desktop.
Use python feedparser and time to parse an RSS feed and output a simple markdown unordered list of links
import feedparser
import time
# grab the feed
feed = feedparser.parse('https://fudge.org/rss.xml')
# for each entry print a markdown unordered list item of links using using title, link, and the parsed publishing time
for pub_date in feed.entries:
print ('- ','[',pub_date.title,'](',pub_date.link,')',time.strftime(' %Y %b %d',pub_date.published_parsed),sep="")
# append this output to a file as needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment