比这篇新的文章: Most Prolific DBLP Authors
比这篇旧的文章: RGB颜色值转HTML十六进制(HEX)代码的JS函数

most popular tags at flickr.com

语言: Python, 标签: urllib tag flickr 2008/07/21发布 1年前更新 更新记录
作者: innersmile, 点击845次, 评论(0), 收藏者(0), , 打分:

背景
主题: 字体:
01 from urllib import urlopen
02 def most_popular_tags():
03     url = 'http://flickr.com/photos/tags/'
04     doc = urlopen(url).read()
05     start = doc.find('<h3>All time most popular tags</h3>')
06     end_of_cloud = doc.find('</p>',start)
07     tags = []
08     while(True):
09         start = doc.find('px;">',start)
10         if start == -1 or start>end_of_cloud:
11             return tags
12         end = doc.find('</a>',start)
13         tags.append(doc[start+5:end])
14         start = end+4
15     return tags


所有评论,共0条:( 我也来说两句)


发表评论

注册登录后再发表评论