3 import urllib
.request
, urllib
.parse
, urllib
.error
9 queries the public API of delicious.com and retrieves a dictionary of all
10 tags that have been used for the url, with the number of users that have
14 split
= urllib
.parse
.urlsplit(url
)
16 split
= urllib
.parse
.SplitResult(split
.scheme
, split
.netloc
, '/', split
.query
, split
.fragment
)
20 m
.update(url
.encode('ascii'))
22 url_md5
= m
.hexdigest()
23 req
= 'http://feeds.delicious.com/v2/json/urlinfo/%s' % url_md5
25 resp
= urllib
.request
.urlopen(req
).read()
27 resp_obj
= json
.loads(resp
)
33 if (not 'top_tags' in o
) or (not o
['top_tags']):
35 for tag
, count
in o
['top_tags'].items():