del.icio.us API through python

pydelicious是一个python版本的访问del.icio.us网络服务的接口。

[sourcecode language=”python”]
>>> from pydelicious import DeliciousAPI
>>> from getpass import getpass
>>> a = DeliciousAPI(‘username’, getpass(‘Password:’))
Password:
>>> # Either succeeds or raises DeliciousError or subclass:
>>> a.posts_add(“http://my.url/”, “title”,
… extended=”description”, tags=”my tags”)
>>> len(a.posts_all()[‘posts’])
1
>>> a.tags_get() # or: a.request(‘tags/get’)
{‘tags’: [{‘count’: ‘1’, ‘tag’: ‘my’}, {‘count’: ‘1’, ‘tag’: ‘tags’}]}
>>> a.posts_update()
{‘update’: {‘time’: (2008, 11, 28, 2, 35, 51, 4, 333, -1)}}
>>> # Either succeeds or raises DeliciousError or subclass:
>>> a.posts_delete(“http://my.com/”)
>>> len(a.posts_all()[‘posts’])
0
[/sourcecode]

打赏

发表评论

电子邮件地址不会被公开。 必填项已用*标注