2 # This file is part of gpodder.net.
4 # my.gpodder.org is free software: you can redistribute it and/or modify it
5 # under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or (at your
7 # option) any later version.
9 # my.gpodder.org is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
12 # License for more details.
14 # You should have received a copy of the GNU Affero General Public License
15 # along with my.gpodder.org. If not, see <http://www.gnu.org/licenses/>.
23 from mygpo
.core
.json
import json
28 queries the public API of delicious.com and retrieves a dictionary of all
29 tags that have been used for the url, with the number of users that have
33 split
= urlparse
.urlsplit(url
)
35 split
= urlparse
.SplitResult(split
.scheme
, split
.netloc
, '/', split
.query
, split
.fragment
)
39 m
.update(url
.encode('ascii'))
41 url_md5
= m
.hexdigest()
42 req
= 'http://feeds.delicious.com/v2/json/urlinfo/%s' % url_md5
44 resp
= urllib
.urlopen(req
).read()
46 resp_obj
= json
.loads(resp
)
52 if (not 'top_tags' in o
) or (not o
['top_tags']):
54 for tag
, count
in o
['top_tags'].iteritems():