Skip to content

Instantly share code, notes, and snippets.

@dedunumax
Created December 13, 2015 06:42
Show Gist options
  • Save dedunumax/4856150e6fc8a7fe5216 to your computer and use it in GitHub Desktop.
Save dedunumax/4856150e6fc8a7fe5216 to your computer and use it in GitHub Desktop.
import urllib2
from xml.dom import minidom
__author__ = 'dedunu'
class Reader:
def get_url_list(self, url_string):
data = urllib2.urlopen(url_string)
rss_string = ''
for line in data:
rss_string = rss_string + line
doc = minidom.parseString(rss_string)
article_list = doc.getElementsByTagName('item')
link_list = []
for item in article_list:
link_list.append(item.getElementsByTagName('link')[0].firstChild.data)
return link_list
# Example
reader = Reader()
url_list = reader.get_url_list('http://feeds.feedburner.com/TechCrunch/')
for url_item in url_list:
print url_item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment