python script to fetch rss feeds

I was just thinking about making an rss bot in telegram, and wrote a small python script which can fetch rss feeds from the feed link and prints the result with “Title” and “Link”.

import feedparser
import sys

if len(sys.argv) < 2:
print("USAGE: python <rss feed link>")

rss_url = sys.argv[1]
print("TITLE","                                                   ","LINK")

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

Below example shall print the feeds available in Mobilecrunch.

$ python

Newest code will be available in gist if I forget to update this blog.