Click here to skip to this page's main content.

New Feature: You can now embed Open Library books on your website!   Learn More
Last edited by Anand Chitipothu
June 11, 2010 | History

Writing Open Library Bots

Some quick notes, to be filled out by Daniel!

Create bot account, ending with "Bot". e.g. WorkBot, ImportBot. Ending with "Bot" allows the bot edits to be hidden in Recent Changes (they would overwhelm the list if shown).

Use the openlibrary API to read from or write to an Open Library instance. It is part of source distribution on github. There is documentation in the source available at github: http://github.com/openlibrary/openlibrary/blob/master/openlibrary/api.py

ol = OpenLibrary('http://0.0.0.0:8080') # use dev instance
ol.login(username, password) # or use ol.autologin() to load from ~/.olrc
data = ol.get(key)
ol.save(key, data, comment)

You can save thing with key-value pairs and edit comment. Loop would look like find book, add identifier, save.

Querying for things:

things = ol.query({'key1': 'value1', 'key2': 'value2'})

History

February 26, 2013 Edited by Anand Chitipothu Fixed OL github repo URL (tx John Shutt)
January 4, 2012 Edited by Edward Betts fix link to Ben's Goodread bot, thanks goes to Tom Morris
May 3, 2011 Edited by George added a link to oclcBot
January 31, 2011 Edited by George Added AMillarBot
June 11, 2010 Created by mangtronix Start of docs on writing bots