Changeset 22170 in project


Ignore:
Timestamp:
01/02/11 22:27:49 (9 years ago)
Author:
Christian Kellermann
Message:

isbn docs update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/isbn

    r22166 r22170  
    2020[[https://isbndb.com/docs/api/30-keys.html|source]]
    2121
     22Starting with version 0.3 of this egg, the open and free api of
     23[[http://openlibrary.org]] is also supported. Advantages over isbndb
     24are: No need for an API key, more detailed results plus links to cover
     25images.
     26
    2227=== Usage
     28
     29All modules can be loaded optionally. Note that the openlibrary needs
     30normalized ISBNs to work with.
    2331
    2432<enscript highlight=scheme>
    2533(require-extension isbn)
    2634(require-extension isbndb)
     35(require-extension openlibrary)
    2736</enscript>
    2837
     
    99108could be found.
    100109
    101 ===== Example
     110===== isbndb Example
    102111
    103112<enscript highlight ="scheme">
     
    108117  (publisher "Cambridge, Mass. : MIT Press ; c1996.")))
    109118</enscript>
     119
     120==== openlibrary
     121
     122===== Parameters: Database URL
     123
     124<parameter>(database-url STRING)</parameter>
     125
     126URL of the base API for openlibrary.org. Default:
     127http://openlibrary.org/
     128
     129===== available-keys
     130
     131Descripes the available keys this module supports.
     132
     133<enscript highlight="scheme">
     134(define-constant user-keys
     135    '(title
     136      authors
     137      publisher
     138      publishing-date
     139      number-of-pages
     140      cover-urls
     141      isbn-numbers))
     142
     143;exported is this
     144(define available-keys user-keys)
     145</enscript>
     146
     147===== isbn->alist
     148
     149<procedure>(isbn->alist STRING #!optional (interesting-entries))</procedure>
     150
     151Queries openlibrary.org for an ISBN. It seems that you need to give it
     152a normalized ISBN to make it work. '''interesting-entries''' is an
     153optional parameter that can be a subset of the '''user-keys''' list.
     154Defaults to '''user-keys''': title, authors, publisher,
     155publishing-date, number-of-pages, cover-urls, isbn-numbers
     156
     157===== Openlibrary Example
     158
     159<enscript highlight="scheme">
     160#;1> (use openlibrary)
     161
     162#;2> (pp (isbn->alist "0937073806"))
     163 ((title . "Literate programming")
     164 (authors ("Donald Knuth"))
     165 (publisher ("Center for the Study of Language and Information"))
     166 (publishing-date . "1992")
     167 (number-of-pages . 368)
     168 (cover-urls
     169   ("small" . "http://covers.openlibrary.org/b/id/715228-S.jpg")
     170   ("large" . "http://covers.openlibrary.org/b/id/715228-L.jpg")
     171   ("medium" . "http://covers.openlibrary.org/b/id/715228-M.jpg"))
     172 (isbn-numbers (("0937073806" "0937073814"))))
     173
     174#;3> (pp (isbn->alist "0937073806" '(title authors publishing-date)))
     175((title . "Literate programming")
     176 (authors ("Donald Knuth"))
     177 (publishing-date . "1992"))
     178</enscript>
     179
     180
    110181
    111182=== Author
     
    145216; 0.1 : initial release
    146217; 0.2 : isbn 10 -> 13 conversion added thanks to [[http://wiki.call-cc.org/users/alaric-blagrave-snellpym|Alaric Snell-Pym]]
     218; 0.3 : support for openlibrary.org API added
Note: See TracChangeset for help on using the changeset viewer.