First, 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).
In order for your bot to have write access to the OL API, your bot account must be a member of the API usergroup. Please write to us (ol-tech@archive.org) with information about your bot so that we can add you to the group.
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'})
Examples and source code:
History
- Created November 30, 2010
- 16 revisions
June 27, 2021 | Edited by Mek | Edited without comment. |
June 27, 2021 | Edited by Mek | Edited without comment. |
June 27, 2021 | Edited by Mek | reverted to revision 12 |
June 27, 2021 | Edited by Mek | Edited without comment. |
November 30, 2010 | Edited by raj | add link to goodreads bot |