Remove Amazon added content handler user/jeff/remove_amazon_added_content
authorJeff Godin <jgodin@tadl.org>
Sat, 28 Apr 2012 22:38:14 +0000 (18:38 -0400)
committerJeff Godin <jgodin@tadl.org>
Sat, 28 Apr 2012 22:38:14 +0000 (18:38 -0400)
The Amazon added content handler for jacket images is removed
by this commit.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
Open-ILS/examples/opensrf.xml.example
Open-ILS/src/perlmods/MANIFEST
Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Amazon.pm [deleted file]
Open-ILS/src/perlmods/t/16-OpenILS-WWW-AddedContent.t
Open-ILS/web/opac/locale/en-US/opac.dtd

index ea6f18b..0f2d11c 100644 (file)
@@ -243,11 +243,6 @@ vim:et:ts=4:sw=4:
             <userid>MY_USER_ID</userid>
 
             <!--
-            Base URL for Amazon added content fetching. Not needed by OpenLibrary
-            <base_url>http://images.amazon.com/images/P/</base_url>
-            -->
-
-            <!--
             Segregating the details for ContentCafe out for easier use.  At some point, we
             may want to support multiple services at one time.
             -->
index 9f30b97..8560f4e 100644 (file)
@@ -156,7 +156,6 @@ lib/OpenILS/Utils/ScriptRunner.pm
 lib/OpenILS/Utils/SpiderMonkey.pm
 lib/OpenILS/Utils/ZClient.pm
 lib/OpenILS/WWW/AddedContent.pm
-lib/OpenILS/WWW/AddedContent/Amazon.pm
 lib/OpenILS/WWW/AddedContent/ContentCafe.pm
 lib/OpenILS/WWW/AddedContent/OpenLibrary.pm
 lib/OpenILS/WWW/AddedContent/Syndetic.pm
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Amazon.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Amazon.pm
deleted file mode 100644 (file)
index 9e2c13c..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-package OpenILS::WWW::AddedContent::Amazon;
-use strict; use warnings;
-use OpenSRF::Utils::Logger qw/$logger/;
-use OpenSRF::Utils::SettingsParser;
-use OpenILS::WWW::AddedContent;
-use OpenSRF::Utils::JSON;
-use OpenSRF::EX qw/:try/;
-use XML::LibXML;
-use Business::ISBN;
-
-my $AC = 'OpenILS::WWW::AddedContent';
-
-sub new {
-    my( $class, $args ) = @_;
-    $class = ref $class || $class;
-    return bless($args, $class);
-}
-
-sub base_url {
-    my $self = shift;
-    return $self->{base_url};
-}
-
-sub userid {
-    my $self = shift;
-    return $self->{userid};
-}
-
-
-# --------------------------------------------------------------------------
-sub jacket_small {
-    my( $self, $key ) = @_;
-    return $self->send_img(
-        $self->fetch_response('_SCMZZZZZZZ_.jpg', $key));
-}
-
-sub jacket_medium {
-    my( $self, $key ) = @_;
-    return $self->send_img(
-        $self->fetch_response('_SCMZZZZZZZ_.jpg', $key));
-
-}
-sub jacket_large {
-    my( $self, $key ) = @_;
-    return $self->send_img(
-        $self->fetch_response('_SCZZZZZZZ_.jpg', $key));
-}
-
-# --------------------------------------------------------------------------
-
-sub send_img {
-    my($self, $response) = @_;
-    return { 
-        content_type => $response->header('Content-type'),
-        content => $response->content, 
-        binary => 1 
-    };
-}
-
-# returns the raw content returned from the URL fetch
-sub fetch_content {
-    my( $self, $page, $key ) = @_;
-    return $self->fetch_response($page, $key)->content;
-}
-
-# returns the HTTP response object from the URL fetch
-sub fetch_response {
-    my( $self, $page, $key ) = @_;
-    my $uname = $self->userid;
-
-    # Some sites have entered Amazon IDs in 020 $a, thus we cannot
-    # simply pass all incoming keys to Business::ISBN for normalization
-    if (length($key) > 10) {
-        # Use Business::ISBN to normalize the incoming ISBN
-        my $isbn = Business::ISBN->new( $key );
-        if (!defined $isbn) {
-            $logger->warning("'$key' is not a valid ISBN");
-            return 0;
-        }
-
-        # Amazon prefers ISBN10
-        $isbn = $isbn->as_isbn10 if $isbn->type eq 'ISBN13';
-        $key = $isbn->as_string([]);
-    }
-
-    my $url = $self->base_url . "$key.01.$page";
-    return $AC->get_url($url);
-}
-
-
-
-1;
index 10f79c9..3f2c6c6 100644 (file)
@@ -6,7 +6,6 @@ BEGIN {
        use_ok( 'OpenILS::WWW::AddedContent' );
 }
 
-use_ok( 'OpenILS::WWW::AddedContent::Amazon' );
 use_ok( 'OpenILS::WWW::AddedContent::ContentCafe' );
 use_ok( 'OpenILS::WWW::AddedContent::OpenLibrary' );
 use_ok( 'OpenILS::WWW::AddedContent::Syndetic' );
index 9b31b21..4b4589e 100644 (file)
@@ -683,9 +683,12 @@ Ensure Caps-Lock is off and try again or contact your local library.">
 <!ENTITY slimpac.advanced.create_date "Record Creation Date">
 <!ENTITY slimpac.advanced.edit_date "Record Edit Date">
 
+<!--   =================================================================
+       Added Content Attribution
+       ================================================================= -->
 <!ENTITY opac.image_provided "Image provided by">
-<!ENTITY vendor.name "Amazon">
-<!ENTITY vendor.base_link "http://amazon.com/dp/">
+<!ENTITY vendor.name "Example Vendor">
+<!ENTITY vendor.base_link "http://example.com/prefix/">
 
 <!--   ================================================================= 
        Selfcheck