Python Wrapper for Diigo API

2009年03月04日(水) 16:13

Description

This python scripts helps you to use diigo's bookmark.

Implements www.diigo.com's API.

Requirements

  • simplejson
  • pit optional. See diigotest.py. You might love it ;)

instllation

$ sudo easy_install pydiigo

or

Download pydiigo and extract it, then

$ sudo python setup.py install

Notes

Diigo's API limits are very few. (You get 503 error)

Usage

Initialize API

>>> from pydiigo import DiigoApi
>>> api = DiigoApi(user='YOUR_DIIGO_USERNAME', password='YOUR_DIIGO_PASSWORD')

Search Bookmarks

>>> bookmarks = api.bookmarks_find(users='DIIGO_USER_NAME')
>>> for bookmark in bookmarks:
...   print bookmark.title
...   print bookmark.url
...   print bookmark.tags
...   print bookmark.desc
...   print '-' * 10
  • Bookmark Structure
    • title (string)
    • url (string)
    • user (string)
    • desc (string: description)
    • tags (string: Seperated by comma with multiple tags.)
    • shared (string: yes or no)
    • created_at (string: eg.2009/03/04 02:57:09 +0000)
    • updated_at (string: eg.2009/03/04 02:57:09 +0000)
    • comments (string array)
    • annotations (string array)

Add Bookmark

>>> result = api.bookmark_add(title='', description='',url='', shared='yes', tags='')
>>> print result['message']
added 1 bookmark
  • required arguments
    • url

Update Bookmark

>>> result = api.bookmark_update(title='', description='',url='', shared='yes', tags='')
>>> print result['message']
updated 1 bookmark
  • required arguments
    • url

Delete Bookmark

>>> result = api.bookmark_delete(url='')
>>> print result['message']
updated 1 bookmark
  • required arguments
    • url


 
ponybadge

Powered by

Feedbacks

Tweets

Tags

Calendar