#!/usr/bin/python
# -*- coding: utf8 -*-
import datetime, PyRSS2Gen
rss = PyRSS2Gen.RSS2(
title = "Andrew's PyRSS2Gen feed",
link = "",
description = "The latest news about PyRSS2Gen, a Python library for generating RSS2 feeds",
lastBuildDate = datetime.datetime.now(),
items = [
PyRSS2Gen.RSSItem(
title = "PyRSS2Gen-0.0 released",
link = "",
description = "Dalke Scientific today announced PyRSS2Gen-0.0, a library for generating RSS feeds for Python. ",
guid = PyRSS2Gen.Guid(""),
pubDate = datetime.datetime(2003, 9, 6, 21, 31)
),
PyRSS2Gen.RSSItem(
title = "Thoughts on RSS feeds for bioinformatics",
link = "",
description = "One of the reasons I wrote PyRSS2Gen was to experiment with RSS for data collection in bioinformatics. Last year I came across...",
guid = PyRSS2Gen.Guid(""
),
pubDate = datetime.datetime(2003, 9, 6, 21, 49)),
]
)
rss.write_xml(open("pyrss2gen.xml", "w"))
![](/fileicon/zip.gif) |
文件: | PyRSS2Gen-1.0.0.tar.gz |
大小: | 8KB |
下载: | 下载 |
|
#!/usr/bin/python
# -*- coding: utf8 -*-
import feedparser
f = feedparser.parse(r'')
print f['feed']['title']
for item in f.entries:
print item.title, item.author, item.link
阅读(775) | 评论(0) | 转发(0) |