Chinaunix首页 | 论坛 | 博客
  • 博客访问: 212930
  • 博文数量: 70
  • 博客积分: 2050
  • 博客等级: 大尉
  • 技术积分: 700
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-15 21:42
文章分类

全部博文(70)

文章存档

2013年(1)

2011年(5)

2010年(3)

2009年(9)

2008年(17)

2007年(6)

2006年(29)

我的朋友

分类: Python/Ruby

2009-11-10 17:20:20

#!/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"))

文件: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

文件:feedparser-4.1.zip
大小:252KB
下载:下载& lt;/a>
阅读(775) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~