Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
This small piece of code can print the title and links of rss feed link provided in command line.
import feedparser
import sys
if len(sys.argv) < 2:
print("USAGE: python feedparse.py <rss feed link>")
exit()
rss_url = sys.argv[1]
print("TITLE"," ","LINK")
print("------------------------------------------------------------------")
feed = feedparser.parse( rss_url )
y = len(feed[ "items" ])
for x in range(0,y):
print('\033[91m'+feed[ "items" ][x][ "title" ] + '\033[0m', "-", feed[ "items" ][x][ "link" ])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment