Created
September 12, 2020 21:13
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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