def test(url): print 'TESTING', url print '=' * 80 pt = parse.tree_from_url(url) print parse.header_data(pt) print for elem in parse.items(pt): pprint_dict(elem) print
def generate_page(feed_url, outpath): "Renders the contents of an RSS feed into the given HTML file." tree = parse.tree_from_url(feed_url) if os.path.exists(outpath): os.remove(outpath) with codecs.open(outpath, 'a', 'utf-8') as f: write_preamble(f, feed_url) write_header(f, parse.header_data(tree)) write_items(f, parse.items(tree)) write_conclusion(f)
def test2(feed_url): pt = parse.tree_from_url(feed_url) print parse.header_data(pt)