regluit/experimental/pyzotero_test.py

12 lines
386 B
Python

from zoteroconf import user_id, user_key
# http://pyzotero.readthedocs.org/en/latest/index.html
from pyzotero import zotero
zot = zotero.Zotero(user_id, user_key)
items = zot.top()
for item in items:
try:
print 'Author: %s | Title: %s' % (item['creators'][0]['lastName'] if item['creators'] else '', item['title'])
except Exception, e:
print "Error: %s " % (e)