Python生成RSS,pythonrss,心血来潮要搞下pytho
Python生成RSS,pythonrss,心血来潮要搞下pytho
心血来潮要搞下python的rss,google一把,发现两个最简单的类库,是python官方网站介绍的,实在是太简洁了 。
PyRSS2Gen :rss生成下载地址:http://www.dalkescientific.com/Python/PyRSS2Gen-1.0.0.tar.gz
例子:
import datetimeimport PyRSS2Genrss = PyRSS2Gen.RSS2( title = "Andrew's PyRSS2Gen feed", link = "http://www.dalkescientific.com/Python/PyRSS2Gen.html", 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 = "http://www.dalkescientific.com/news/030906-PyRSS2Gen.html", description = "Dalke Scientific today announced PyRSS2Gen-0.0, " "a library for generating RSS feeds for Python. ", guid = PyRSS2Gen.Guid("http://www.dalkescientific.com/news/" "030906-PyRSS2Gen.html"), pubDate = datetime.datetime(2003, 9, 6, 21, 31)), PyRSS2Gen.RSSItem( title = "Thoughts on RSS feeds for bioinformatics", link = "http://www.dalkescientific.com/writings/diary/" "archive/2003/09/06/RSS.html", 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("http://www.dalkescientific.com/writings/" "diary/archive/2003/09/06/RSS.html"), pubDate = datetime.datetime(2003, 9, 6, 21, 49)), ])rss.write_xml(open("pyrss2gen.xml", "w"))
相关内容
- Python解析RSS,pythonrss,首先需要安装RSS解析的
- python webpy purge nginx fastcgi cache 代码实现,webpynginx,前几
- Python初学教程:Python使用os.path处理文件路径,pythonos
- Python验证Url地址的正则表达式,python正则表达式,Pytho
- Python连接mysql OperationalError: (1366, "Incorrect string
- Python使用easy_install升级包,pythoneasy_install,easy_install
- Python实现java或者.net的getHashCode()函数,pythongethashcode,
- Python正则表达式入门,python正则表达式,一. 编译正则表
- Python使用elaphe包生成二维码,pythonelaphe,首先需要安装
- Python正则表达式前向否定断言使用示例,python正则表达
评论关闭