Changeset 22169 in project


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

isbn: welcome the openlibrary api

Location:
release/4/isbn/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • release/4/isbn/trunk/isbn.meta

    r22117 r22169  
    22
    33((egg "isbn")
    4  (synopsis "ISBN lib for handling book identifier numbers")
     4 (synopsis "ISBN lib for handling book identifier numbers and public isbn databases")
    55 (author "Christian Kellermann")
    66 (category web)
     
    88 (doc-from-wiki)
    99 (test-depends test)
    10  (depends srfi-1 sxml-transforms sxpath
     10 (depends data-structures srfi-1 sxml-transforms sxpath
    1111          intarweb http-client ssax uri-common)
    12  (files "isbn.setup" "isbn.scm" "isbndb.scm"))
     12 (files "isbn.setup" "isbn.scm" "isbndb.scm" "openlibrary.scm"))
  • release/4/isbn/trunk/isbn.setup

    r22088 r22169  
    33(compile -s -O2 isbndb.scm -J)
    44(compile -s -O2 isbndb.import.scm)
     5(compile -s -O2 openlibrary.scm -J)
     6(compile -s -O2 openlibrary.import.scm)
    57
    68(install-extension
     
    911   "isbndb.import.so"
    1012   "isbn.so"
    11    "isbn.import.so")
    12  `((version 0.1)))
     13   "isbn.import.so"
     14   "openlibrary.so"
     15   "openlibrary.import.so")
     16 `((version 0.3)))
  • release/4/isbn/trunk/isbndb.scm

    r22093 r22169  
    2323                   (lambda ()
    2424                     (ssax:xml->sxml (current-input-port) '())))))
    25       content))
     25                (close-connection! uri)
     26                content))
    2627
    2728  (define isbndb->scheme-rules
  • release/4/isbn/trunk/tests/run.scm

    r22163 r22169  
    33(include "../isbn.scm")
    44(import isbn)
     5(include "../openlibrary.scm")
     6(import openlibrary)
     7
    58
    69(test-group "ISBN-10"
     
    3437            (test "Normalize ISBN-10 (with 10 check digit)"
    3538                  "052103311X" (normalize-isbn "0-521-03311-X")))
     39
     40(define literate-programming
     41  '((title . "Literate programming")
     42    (authors ("Donald Knuth"))
     43    (publisher ("Center for the Study of Language and Information"))
     44    (publishing-date . "1992")
     45    (number-of-pages . 368)
     46    (cover-urls
     47     ("small" . "http://covers.openlibrary.org/b/id/715228-S.jpg")
     48     ("large" . "http://covers.openlibrary.org/b/id/715228-L.jpg")
     49     ("medium" . "http://covers.openlibrary.org/b/id/715228-M.jpg"))
     50    (isbn-numbers (("0937073806" "0937073814")))))
     51
     52(define literate-programming-simplified
     53  '((title . "Literate programming")
     54    (authors ("Donald Knuth"))
     55    (publishing-date . "1992")
     56    (number-of-pages . 368)))
     57
     58(test-group "openlibrary.org API"
     59            (test "Requesting entry for ISBN-10 09370-73890-6"
     60                  literate-programming
     61                  (isbn->alist "0937073806"))
     62            (test "Requesting same ISBN with restricted return values"
     63                  literate-programming-simplified
     64                  (isbn->alist "0937073806" '(title authors publishing-date number-of-pages))))
Note: See TracChangeset for help on using the changeset viewer.