Using Feedparser to parse multiple RSS feeds but this function doesn't work. How can I create a function to parse feeds and get the link out of the feed entry to further push to a tweet?
def get():
rss_url = [
'http://www.huffingtonpost.com/news/syria/feed/',
'http://www.nytimes.com/svc/collections/v1/publish /www.nytimes.com/topic/destination/syria/rss.xml',
]
def getHeadlines(rss_url):
feeds = []
for url in rss_url:
feeds.append(feedparser.parse(url))
for feed in feeds:
for post in feed.entries:
return post.link
tweet(getHeadlines(rss_url))
I am able to do it when I try just this -
RSS_URLS = [
'http://feeds.feedburner.com/RockPaperShotgun',
'http://www.gameinformer.com/b/MainFeed.aspx?Tags=preview',
]
feed = feedparser.parse(RSS_URLS)
for post in feed.entries:
print post.title