Skip to content
Snippets Groups Projects
Commit 27989f14 authored by Joe Atzberger's avatar Joe Atzberger Committed by Demian Katz
Browse files

Booksite config and code for cover images

parent 75b9a768
No related merge requests found
...@@ -357,7 +357,7 @@ major = studentmajor ...@@ -357,7 +357,7 @@ major = studentmajor
; You can select Syndetics, LibraryThing, Summon, Amazon, Booksite, OpenLibrary, ; You can select Syndetics, LibraryThing, Summon, Amazon, Booksite, OpenLibrary,
; Contentcafe and/or Google Books. ; Contentcafe and/or Google Books.
; Note: Summon service takes a Serials Solutions client key, NOT Summon API key! ; Note: Summon service takes a Serials Solutions client key, NOT Summon API key!
;coverimages = Syndetics:MySyndeticsId,Amazon:MyAccessKeyId,Booksite:MyCATSkey,LibraryThing:MyLibraryThingId,Google,OpenLibrary,Summon:MySerialsSolutionsClientKey,Contentcafe:MyContentCafeID ;coverimages = Syndetics:MySyndeticsId,Amazon:MyAccessKeyId,Booksite,LibraryThing:MyLibraryThingId,Google,OpenLibrary,Summon:MySerialsSolutionsClientKey,Contentcafe:MyContentCafeID
; This setting controls the image to display when no book cover is available. ; This setting controls the image to display when no book cover is available.
; The path is relative to the base of your theme directory. ; The path is relative to the base of your theme directory.
...@@ -368,7 +368,7 @@ noCoverAvailableImage = images/noCover2.gif ...@@ -368,7 +368,7 @@ noCoverAvailableImage = images/noCover2.gif
; Note: Guardian reviews contain embedded advertisements. If the API key is not ; Note: Guardian reviews contain embedded advertisements. If the API key is not
; supplied, e.g. "Guardian:", only the review title, byline, Guardian logo ; supplied, e.g. "Guardian:", only the review title, byline, Guardian logo
; and a link to the full Guardian page will be displayed ; and a link to the full Guardian page will be displayed
;reviews = Syndetics:MySyndeticsId,SyndeticsPlus:MySyndeticsID,AmazonEditorial:MyAccessKeyId,Amazon:MyAccessKeyId,Booksite:MyCATSkey,Guardian:MyGuardianKeyId ;reviews = Syndetics:MySyndeticsId,SyndeticsPlus:MySyndeticsID,AmazonEditorial:MyAccessKeyId,Amazon:MyAccessKeyId,Booksite,Guardian:MyGuardianKeyId
; You can select from Syndetics or SyndeticsPlus ; You can select from Syndetics or SyndeticsPlus
;excerpts = Syndetics:MySyndeticsId,SyndeticsPlus:MySyndeticsId ;excerpts = Syndetics:MySyndeticsId,SyndeticsPlus:MySyndeticsId
...@@ -895,4 +895,4 @@ max_tag_length = 64 ...@@ -895,4 +895,4 @@ max_tag_length = 64
;Solr = Catalog ;Solr = Catalog
;Summon = Summon ;Summon = Summon
;WorldCat = WorldCat ;WorldCat = WorldCat
;SolrWeb = "Library Website" ;SolrWeb = "Library Website"
\ No newline at end of file
...@@ -479,6 +479,7 @@ class Loader implements \Zend\Log\LoggerAwareInterface ...@@ -479,6 +479,7 @@ class Loader implements \Zend\Log\LoggerAwareInterface
return true; return true;
} else { } else {
$this->debug("Failed to retrieve image from " + $url);
return false; return false;
} }
} }
...@@ -698,4 +699,24 @@ class Loader implements \Zend\Log\LoggerAwareInterface ...@@ -698,4 +699,24 @@ class Loader implements \Zend\Log\LoggerAwareInterface
'/' . $isn . '/' . $this->size; '/' . $isn . '/' . $this->size;
return $this->processImageURL($url); return $this->processImageURL($url);
} }
public function booksite($id)
{
// convert normalized 10 char isn to 13 digits
$isn = $this->isn;
if (strlen($isn) != 13){
$ISBN = new ISBN($isn);
$isn = $ISBN->get13();
}
$url = isset($this->config->Booksite->url) ?
$this->config->Booksite->url : 'https://api.booksite.com';
if (! isset($this->config->Booksite->key)) {
throw new \Exception("Booksite 'key' not set in VuFind config");
}
$key = $this->config->Booksite->key;
$url = $url . '/poca/content_img?key=' . $key . '&ean=' . $isn;
return $this->processImageURL($url);
}
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment