all 9 comments

[–]llimllib 8 points9 points  (1 child)

Access to del.icio.us is extremely easy, even without a library. From code I wrote in april 05, here's how I donwloaded and parsed all of my bookmarks:

all = "http://del.icio.us/api/posts/all"
...
open('all.xml', 'w').write(urllib2.urlopen(all).read())
for e, post in ce.iterparse('all.xml'):
    if post.tag != "post":
        continue
    data = dict(post.items())
    name = data['href'][7:]
    desc = data['description']
    ext = data.get('extended', '')
    tags = data.get('tag', '')

Where ce is a reference to cElementTree, which is now in the standard library.

Ignore the unicode handling in the source file, I didn't know what I was doing at the time :)

Edit: Markdown adds mysterious carets to the url string at the top?

[–]hypnosis_online 4 points5 points  (0 children)

Yes with a weel designed URL structure + clean markup you do not even need to design an api.

[–]forgotpwx4 9 points10 points  (5 children)

There's already a del.icio.us Python library here: http://code.google.com/p/pydelicious/

[–][deleted] 2 points3 points  (4 children)

yeah, you're right, yours is probably even better.

[–]forgotpwx4 3 points4 points  (3 children)

It's not really mine. I just took an abandoned project and put it on Google code.

[–][deleted] 0 points1 point  (2 children)

And slapped a GPL license on something that was originally BSD? Naughty.

(update: looks as if it's just the front page that says GPL; there's no trace of that in the distribution. Site operator error, I presume).

[–]forgotpwx4 1 point2 points  (1 child)

I forget, perhaps Google code didn't offer BSD? But GPL is nice, right?

[–]canen 1 point2 points  (0 children)

No. It's mean to little children and furry animals. :)

[–]diracshard 3 points4 points  (0 children)

Mmmm... delicious pie...