<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[611] trunk/alexandria: - fixes and updates for some providers</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>611</dd>
<dt>Author</dt> <dd>laurusnobilis</dd>
<dt>Date</dt> <dd>2007-02-20 06:32:55 -0500 (Tue, 20 Feb 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>- fixes and updates for some providers
- added info about the Wikipedia page (if any)
- added the country of the provider after the name
- converted the encoding from utf-8, when searching by title/author/keyword
- used CGI::unescapeHTML for renaud and thalia
- now most providers return EAN
- added Library.canonicalise_isbn for the providers that don't yet use EAN, so that now EAN can be used with every provider file
- for the function url, the check that the book has the ISBN has been moved to only one place in the ui library
- other minor and cosmetic changes</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkalexandrialibalexandriabook_providersadlibrisrb">trunk/alexandria/lib/alexandria/book_providers/adlibris.rb</a></li>
<li><a href="#trunkalexandrialibalexandriabook_providersamazonrb">trunk/alexandria/lib/alexandria/book_providers/amazon.rb</a></li>
<li><a href="#trunkalexandrialibalexandriabook_providersbnrb">trunk/alexandria/lib/alexandria/book_providers/bn.rb</a></li>
<li><a href="#trunkalexandrialibalexandriabook_providersbol_itrb">trunk/alexandria/lib/alexandria/book_providers/bol_it.rb</a></li>
<li><a href="#trunkalexandrialibalexandriabook_providersdea_store_itrb">trunk/alexandria/lib/alexandria/book_providers/dea_store_it.rb</a></li>
<li><a href="#trunkalexandrialibalexandriabook_providersibs_itrb">trunk/alexandria/lib/alexandria/book_providers/ibs_it.rb</a></li>
<li><a href="#trunkalexandrialibalexandriabook_providerslsrb">trunk/alexandria/lib/alexandria/book_providers/ls.rb</a></li>
<li><a href="#trunkalexandrialibalexandriabook_providersmcurb">trunk/alexandria/lib/alexandria/book_providers/mcu.rb</a></li>
<li><a href="#trunkalexandrialibalexandriabook_providersproxisrb">trunk/alexandria/lib/alexandria/book_providers/proxis.rb</a></li>
<li><a href="#trunkalexandrialibalexandriabook_providersrenaudrb">trunk/alexandria/lib/alexandria/book_providers/renaud.rb</a></li>
<li><a href="#trunkalexandrialibalexandriabook_providersthaliarb">trunk/alexandria/lib/alexandria/book_providers/thalia.rb</a></li>
<li><a href="#trunkalexandrialibalexandriabook_providerswebster_itrb">trunk/alexandria/lib/alexandria/book_providers/webster_it.rb</a></li>
<li><a href="#trunkalexandrialibalexandriabook_providersworldcatrb">trunk/alexandria/lib/alexandria/book_providers/worldcat.rb</a></li>
<li><a href="#trunkalexandrialibalexandriabook_providersz3950rb">trunk/alexandria/lib/alexandria/book_providers/z3950.rb</a></li>
<li><a href="#trunkalexandrialibalexandriauimain_apprb">trunk/alexandria/lib/alexandria/ui/main_app.rb</a></li>
<li><a href="#trunkalexandriateststest_providersrb">trunk/alexandria/tests/test_providers.rb</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkalexandrialibalexandriabook_providersadlibrisrb"></a>
<div class="modfile"><h4>Modified: trunk/alexandria/lib/alexandria/book_providers/adlibris.rb (610 => 611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/alexandria/lib/alexandria/book_providers/adlibris.rb        2007-02-19 21:44:33 UTC (rev 610)
+++ trunk/alexandria/lib/alexandria/book_providers/adlibris.rb        2007-02-20 11:32:55 UTC (rev 611)
</span><span class="lines">@@ -27,11 +27,12 @@
</span><span class="cx">     class AdlibrisProvider &lt; GenericProvider
</span><span class="cx">         BASE_URI = &quot;http://www.adlibris.se/&quot;
</span><span class="cx">         def initialize
</span><del>-            super(&quot;Adlibris&quot;, &quot;Adlibris&quot;)
</del><ins>+            super(&quot;Adlibris&quot;, &quot;Adlibris (Sweden)&quot;)
</ins><span class="cx">             # no preferences for the moment
</span><span class="cx">         end
</span><span class="cx">         
</span><span class="cx">         def search(criterion, type)
</span><ins>+            criterion = criterion.convert(&quot;iso-8859-1&quot;, &quot;utf-8&quot;)
</ins><span class="cx">             req = BASE_URI
</span><span class="cx">             if type == SEARCH_BY_ISBN
</span><span class="cx">                 req += &quot;product.aspx?isbn=&quot;+criterion+&quot;&amp;checked=1&quot;
</span><span class="lines">@@ -86,7 +87,6 @@
</span><span class="cx"> 
</span><span class="cx">         def url(book)
</span><span class="cx">                         #puts &quot;debug: url(book)&quot;
</span><del>-            return nil unless book.isbn
</del><span class="cx">             BASE_URI + &quot;product.aspx?isbn=&quot; + book.isbn
</span><span class="cx">         end
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkalexandrialibalexandriabook_providersamazonrb"></a>
<div class="modfile"><h4>Modified: trunk/alexandria/lib/alexandria/book_providers/amazon.rb (610 => 611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/alexandria/lib/alexandria/book_providers/amazon.rb        2007-02-19 21:44:33 UTC (rev 610)
+++ trunk/alexandria/lib/alexandria/book_providers/amazon.rb        2007-02-20 11:32:55 UTC (rev 611)
</span><span class="lines">@@ -15,6 +15,8 @@
</span><span class="cx"> # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
</span><span class="cx"> # Boston, MA 02111-1307, USA.
</span><span class="cx"> 
</span><ins>+# http://en.wikipedia.org/wiki/Amazon
+
</ins><span class="cx"> require 'amazon/search'
</span><span class="cx"> 
</span><span class="cx"> module Alexandria
</span><span class="lines">@@ -26,7 +28,7 @@
</span><span class="cx">         CACHE_DIR = File.join(Alexandria::Library::DIR, '.amazon_cache')
</span><span class="cx">         
</span><span class="cx">         def initialize
</span><del>-            super(&quot;Amazon&quot;)
</del><ins>+            super(&quot;Amazon&quot;, &quot;Amazon (USA)&quot;)
</ins><span class="cx">             prefs.add(&quot;locale&quot;, _(&quot;Locale&quot;), &quot;us&quot;,
</span><span class="cx">                        Amazon::Search::LOCALES.keys)
</span><span class="cx">             prefs.add(&quot;dev_token&quot;, _(&quot;Development token&quot;), 
</span><span class="lines">@@ -66,6 +68,7 @@
</span><span class="cx">                 products = []
</span><span class="cx">                 case type
</span><span class="cx">                     when SEARCH_BY_ISBN
</span><ins>+                        criterion = Library.canonicalise_isbn(criterion)
</ins><span class="cx">                         req.asin_search(criterion) do |product| 
</span><span class="cx">                             products &lt;&lt; product
</span><span class="cx">                         end
</span><span class="lines">@@ -131,7 +134,6 @@
</span><span class="cx">         end
</span><span class="cx"> 
</span><span class="cx">         def url(book)
</span><del>-            return nil unless book.isbn
</del><span class="cx">             url = case prefs[&quot;locale&quot;]
</span><span class="cx">                 when &quot;fr&quot;
</span><span class="cx">                     &quot;http://www.amazon.fr/exec/obidos/ASIN/%s&quot;
</span><span class="lines">@@ -146,7 +148,7 @@
</span><span class="cx">                 when &quot;us&quot;
</span><span class="cx">                     &quot;http://www.amazon.com/exec/obidos/ASIN/%s&quot;
</span><span class="cx">             end
</span><del>-            url % book.isbn
</del><ins>+            url % Library.canonicalise_isbn(book.isbn)
</ins><span class="cx">         end
</span><span class="cx">     end
</span><span class="cx"> end
</span></span></pre></div>
<a id="trunkalexandrialibalexandriabook_providersbnrb"></a>
<div class="modfile"><h4>Modified: trunk/alexandria/lib/alexandria/book_providers/bn.rb (610 => 611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/alexandria/lib/alexandria/book_providers/bn.rb        2007-02-19 21:44:33 UTC (rev 610)
+++ trunk/alexandria/lib/alexandria/book_providers/bn.rb        2007-02-20 11:32:55 UTC (rev 611)
</span><span class="lines">@@ -16,6 +16,8 @@
</span><span class="cx"> # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
</span><span class="cx"> # Boston, MA 02111-1307, USA.
</span><span class="cx"> 
</span><ins>+# http://en.wikipedia.org/wiki/Barnes_&amp;_Noble
+
</ins><span class="cx"> require 'net/http'
</span><span class="cx"> require 'cgi'
</span><span class="cx"> 
</span><span class="lines">@@ -25,11 +27,12 @@
</span><span class="cx">     
</span><span class="cx">         BASE_URI = &quot;http://search.barnesandnoble.com/&quot;
</span><span class="cx">         def initialize
</span><del>-            super(&quot;BN&quot;, &quot;Barnes and Noble&quot;)
</del><ins>+            super(&quot;BN&quot;, &quot;Barnes and Noble (Usa)&quot;)
</ins><span class="cx">             # no preferences for the moment
</span><span class="cx">         end
</span><span class="cx">         
</span><span class="cx">         def search(criterion, type)
</span><ins>+            criterion = criterion.convert(&quot;iso-8859-1&quot;, &quot;utf-8&quot;)
</ins><span class="cx">             req = BASE_URI + &quot;booksearch/&quot;
</span><span class="cx">             req += case type
</span><span class="cx">                 when SEARCH_BY_ISBN
</span><span class="lines">@@ -48,6 +51,7 @@
</span><span class="cx">                     raise InvalidSearchTypeError
</span><span class="cx"> 
</span><span class="cx">             end
</span><ins>+
</ins><span class="cx">             req += CGI.escape(criterion)
</span><span class="cx">             puts req if $DEBUG
</span><span class="cx">             data = transport.get(URI.parse(req))
</span><span class="lines">@@ -67,7 +71,6 @@
</span><span class="cx">         end
</span><span class="cx"> 
</span><span class="cx">         def url(book)
</span><del>-            return nil unless book.isbn
</del><span class="cx">             &quot;http://search.barnesandnoble.com/booksearch/isbninquiry.asp?ISBN=&quot; + book.isbn
</span><span class="cx">         end
</span><span class="cx"> 
</span><span class="lines">@@ -89,18 +92,18 @@
</span><span class="cx">                 authors &lt;&lt; md[1]
</span><span class="cx">             end
</span><span class="cx"> 
</span><del>-            raise unless md = /ISBN-13:(\s+)&lt;a style=&quot;text-decoration:none&quot;&gt;([^&lt;]+)/.match(data)
-            isbn = md[2].strip
</del><ins>+            raise unless md = /ISBN-13:\s+&lt;a style=&quot;text-decoration:none&quot;&gt;([^&lt;]+)/.match(data)
+            isbn = md[1].strip
</ins><span class="cx"> 
</span><del>-            raise unless md = /&lt;li class=&quot;format&quot;&gt;Format:(\s+)([^&lt;]+)/.match(data)
-            edition = md[2].strip
</del><ins>+            raise unless md = /&lt;li class=&quot;publisher&quot;&gt;Publisher:\s+([^&lt;]+)/.match(data)
+            publisher = md[1].strip
</ins><span class="cx"> 
</span><del>-            raise unless md = /&lt;li class=&quot;publisher&quot;&gt;Publisher:(\s+)([^&lt;]+)/.match(data)
-            publisher = md[2].strip
</del><ins>+            raise unless md = /&lt;li class=&quot;format&quot;&gt;Format:\s+([^&lt;]+)/.match(data)
+            edition = md[1].strip
</ins><span class="cx"> 
</span><span class="cx">             publish_year = nil
</span><del>-            if md = /&lt;li class=&quot;pubDate&quot;&gt;Pub. Date:(\s+).*(\d\d\d\d)&lt;/.match(data)
-                publish_year = md[2].to_i
</del><ins>+            if md = /&lt;li class=&quot;pubDate&quot;&gt;Pub. Date:[^&lt;]+(\d\d\d\d)&lt;/.match(data)
+                publish_year = md[1].to_i
</ins><span class="cx">                 publish_year = nil if publish_year == 0
</span><span class="cx">             end
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkalexandrialibalexandriabook_providersbol_itrb"></a>
<div class="modfile"><h4>Modified: trunk/alexandria/lib/alexandria/book_providers/bol_it.rb (610 => 611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/alexandria/lib/alexandria/book_providers/bol_it.rb        2007-02-19 21:44:33 UTC (rev 610)
+++ trunk/alexandria/lib/alexandria/book_providers/bol_it.rb        2007-02-20 11:32:55 UTC (rev 611)
</span><span class="lines">@@ -29,13 +29,14 @@
</span><span class="cx">         REFERER = BASE_URI
</span><span class="cx">         LOCALE = &quot;libri&quot; # possible locales are: &quot;libri&quot;, &quot;inglesi&quot;, &quot;video&quot;, &quot;musica&quot;, &quot;choco&quot;
</span><span class="cx">         def initialize
</span><del>-            super(&quot;BOL_it&quot;, &quot;BOL Italia&quot;)
</del><ins>+            super(&quot;BOL_it&quot;, &quot;BOL (Italy)&quot;)
</ins><span class="cx">             FileUtils.mkdir_p(CACHE_DIR) unless File.exists?(CACHE_DIR)            
</span><span class="cx">             # no preferences for the moment
</span><span class="cx">             at_exit { clean_cache }
</span><span class="cx">         end
</span><span class="cx">         
</span><span class="cx">         def search(criterion, type)
</span><ins>+            criterion = criterion.convert(&quot;iso-8859-1&quot;, &quot;utf-8&quot;)
</ins><span class="cx">             req = BASE_URI + &quot;/&quot; + LOCALE + &quot;/&quot;
</span><span class="cx">             req += case type
</span><span class="cx">                 when SEARCH_BY_ISBN
</span><span class="lines">@@ -55,14 +56,11 @@
</span><span class="cx"> 
</span><span class="cx">             end
</span><span class="cx">             
</span><del>-if type == SEARCH_BY_ISBN
</del><span class="cx"> ## warning: this provider uses pages like http://www.bol.it/libri/scheda/ea978888584104 with 12 numbers, without the checksum
</span><del>-            req += &quot;ea978&quot; + Library.canonicalise_isbn(criterion)[0 .. -2] + &quot;.html&quot;
-else
</del><ins>+            criterion = &quot;ea978&quot; + Library.canonicalise_isbn(criterion)[0 .. -2] + &quot;.html&quot; if type == SEARCH_BY_ISBN
</ins><span class="cx">             req += CGI.escape(criterion)
</span><del>-end
</del><span class="cx">             p req if $DEBUG
</span><del>-                data = transport.get(URI.parse(req))
</del><ins>+            data = transport.get(URI.parse(req))
</ins><span class="cx">             if type == SEARCH_BY_ISBN
</span><span class="cx">                 to_book(data) #rescue raise NoResultsError
</span><span class="cx">             else
</span><span class="lines">@@ -79,7 +77,6 @@
</span><span class="cx">         end
</span><span class="cx"> 
</span><span class="cx">         def url(book)
</span><del>-            return nil unless book.isbn
</del><span class="cx">             BASE_URI + &quot;/#{LOCALE}/scheda/ea978&quot; + Library.canonicalise_isbn(book.isbn)[0 .. -2] + &quot;.html&quot;
</span><span class="cx">         end
</span><span class="cx"> 
</span><span class="lines">@@ -88,7 +85,7 @@
</span><span class="cx">         #######
</span><span class="cx">     
</span><span class="cx">         def to_book(data)
</span><del>-        data = data.convert(&quot;UTF-8&quot;, &quot;iso-8859-1&quot;)
</del><ins>+            data = data.convert(&quot;UTF-8&quot;, &quot;iso-8859-1&quot;)
</ins><span class="cx"> 
</span><span class="cx">             raise unless md = /&lt;INPUT type =hidden name =&quot;mailTitolo&quot; value=&quot;([^&quot;]+)/.match(data)
</span><span class="cx">             title = CGI.unescape(md[1].strip)
</span><span class="lines">@@ -141,7 +138,7 @@
</span><span class="cx">         end
</span><span class="cx"> 
</span><span class="cx">         def each_book_page(data)
</span><del>-            raise if data.scan(/&lt;a href=&quot;\/#{LOCALE}\/scheda\/ea(\d+)\.html;jsessionid=([^&quot;]+)&quot;&gt;(\s*)Scheda completa(\s*)&lt;\/a&gt;/) { |a| yield a}.empty?
</del><ins>+            raise if data.scan(/&lt;a href=&quot;\/#{LOCALE}\/scheda\/ea(\d+)\.html;jsessionid=[^&quot;]+&quot;&gt;\s*Scheda completa\s*&lt;\/a&gt;/) { |a| yield a}.empty?
</ins><span class="cx">         end
</span><span class="cx">     
</span><span class="cx">         def clean_cache
</span></span></pre></div>
<a id="trunkalexandrialibalexandriabook_providersdea_store_itrb"></a>
<div class="modfile"><h4>Modified: trunk/alexandria/lib/alexandria/book_providers/dea_store_it.rb (610 => 611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/alexandria/lib/alexandria/book_providers/dea_store_it.rb        2007-02-19 21:44:33 UTC (rev 610)
+++ trunk/alexandria/lib/alexandria/book_providers/dea_store_it.rb        2007-02-20 11:32:55 UTC (rev 611)
</span><span class="lines">@@ -27,13 +27,14 @@
</span><span class="cx">         BASE_URI = &quot;http://www.deastore.com&quot;
</span><span class="cx">         CACHE_DIR = File.join(Alexandria::Library::DIR, '.deastore_it_cache')
</span><span class="cx">         def initialize
</span><del>-            super(&quot;DeaStore_it&quot;, &quot;DeaStore Italia&quot;)
</del><ins>+            super(&quot;DeaStore_it&quot;, &quot;DeaStore (Italy)&quot;)
</ins><span class="cx">             FileUtils.mkdir_p(CACHE_DIR) unless File.exists?(CACHE_DIR)            
</span><span class="cx">             # no preferences for the moment
</span><span class="cx">             at_exit { clean_cache }
</span><span class="cx">         end
</span><span class="cx">         
</span><span class="cx">         def search(criterion, type)
</span><ins>+            criterion = criterion.convert(&quot;windows-1252&quot;, &quot;utf-8&quot;)
</ins><span class="cx">             req = BASE_URI + &quot;/&quot;
</span><span class="cx">             req += case type
</span><span class="cx">                 when SEARCH_BY_ISBN
</span><span class="lines">@@ -52,12 +53,9 @@
</span><span class="cx">                     raise InvalidSearchTypeError
</span><span class="cx"> 
</span><span class="cx">             end
</span><del>-            
-if type == SEARCH_BY_ISBN
-            req += Library.canonicalise_isbn(criterion)
-else
</del><ins>+
+            criterion = Library.canonicalise_isbn(criterion) if type == SEARCH_BY_ISBN
</ins><span class="cx">             req += CGI.escape(criterion)
</span><del>-end
</del><span class="cx">             p req if $DEBUG
</span><span class="cx"> 
</span><span class="cx">             agent = WWW::Mechanize.new
</span><span class="lines">@@ -83,7 +81,6 @@
</span><span class="cx">         end
</span><span class="cx"> 
</span><span class="cx">         def url(book)
</span><del>-            return nil unless book.isbn
</del><span class="cx">             BASE_URI + &quot;/product.asp?isbn=&quot; + Library.canonicalise_isbn(book.isbn)
</span><span class="cx">         end
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkalexandrialibalexandriabook_providersibs_itrb"></a>
<div class="modfile"><h4>Modified: trunk/alexandria/lib/alexandria/book_providers/ibs_it.rb (610 => 611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/alexandria/lib/alexandria/book_providers/ibs_it.rb        2007-02-19 21:44:33 UTC (rev 610)
+++ trunk/alexandria/lib/alexandria/book_providers/ibs_it.rb        2007-02-20 11:32:55 UTC (rev 611)
</span><span class="lines">@@ -27,13 +27,14 @@
</span><span class="cx">         CACHE_DIR = File.join(Alexandria::Library::DIR, '.ibs_it_cache')
</span><span class="cx">         REFERER = BASE_URI
</span><span class="cx">         def initialize
</span><del>-            super(&quot;IBS_it&quot;, &quot;Internet Bookshop Italia&quot;)
</del><ins>+            super(&quot;IBS_it&quot;, &quot;Internet Bookshop (Italy)&quot;)
</ins><span class="cx">             FileUtils.mkdir_p(CACHE_DIR) unless File.exists?(CACHE_DIR)            
</span><span class="cx">             # no preferences for the moment
</span><span class="cx">             at_exit { clean_cache }
</span><span class="cx">         end
</span><span class="cx">         
</span><span class="cx">         def search(criterion, type)
</span><ins>+            criterion = criterion.convert(&quot;iso-8859-1&quot;, &quot;utf-8&quot;)
</ins><span class="cx">             req = BASE_URI + &quot;/ser/&quot;
</span><span class="cx">             req += case type
</span><span class="cx">                 when SEARCH_BY_ISBN
</span><span class="lines">@@ -52,10 +53,10 @@
</span><span class="cx">                     raise InvalidSearchTypeError
</span><span class="cx"> 
</span><span class="cx">             end
</span><del>-            
</del><ins>+
</ins><span class="cx">             req += CGI.escape(criterion)
</span><span class="cx">             p req if $DEBUG
</span><del>-                data = transport.get(URI.parse(req))
</del><ins>+            data = transport.get(URI.parse(req))
</ins><span class="cx">             if type == SEARCH_BY_ISBN
</span><span class="cx">                 to_book(data) #rescue raise NoResultsError
</span><span class="cx">             else
</span><span class="lines">@@ -72,7 +73,6 @@
</span><span class="cx">         end
</span><span class="cx"> 
</span><span class="cx">         def url(book)
</span><del>-            return nil unless book.isbn
</del><span class="cx">             &quot;http://www.internetbookshop.it/ser/serdsp.asp?isbn=&quot; + book.isbn
</span><span class="cx">         end
</span><span class="cx"> 
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">         #######
</span><span class="cx">     
</span><span class="cx">         def to_book(data)
</span><del>-        data = data.convert(&quot;UTF-8&quot;, &quot;iso-8859-1&quot;)
</del><ins>+            data = data.convert(&quot;UTF-8&quot;, &quot;iso-8859-1&quot;)
</ins><span class="cx"> 
</span><span class="cx">             raise &quot;No title&quot; unless md = /&lt;b&gt;Titolo&lt;\/b&gt;&lt;\/td&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span class=&quot;lbarrasup&quot;&gt;([^&lt;]+)/.match(data)
</span><span class="cx">             title = CGI.unescape(md[1].strip)
</span></span></pre></div>
<a id="trunkalexandrialibalexandriabook_providerslsrb"></a>
<div class="modfile"><h4>Modified: trunk/alexandria/lib/alexandria/book_providers/ls.rb (610 => 611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/alexandria/lib/alexandria/book_providers/ls.rb        2007-02-19 21:44:33 UTC (rev 610)
+++ trunk/alexandria/lib/alexandria/book_providers/ls.rb        2007-02-20 11:32:55 UTC (rev 611)
</span><span class="lines">@@ -26,11 +26,12 @@
</span><span class="cx">     
</span><span class="cx">         BASE_URI = &quot;http://www.siciliano.com.br&quot;
</span><span class="cx">         def initialize
</span><del>-            super(&quot;LS&quot;, &quot;Livraria Siliciano&quot;)
</del><ins>+            super(&quot;LS&quot;, &quot;Livraria Siliciano (Brasil)&quot;)
</ins><span class="cx">             # no preferences for the moment
</span><span class="cx">         end
</span><span class="cx">         
</span><span class="cx">         def search(criterion, type)
</span><ins>+            criterion = criterion.convert(&quot;iso-8859-1&quot;, &quot;utf-8&quot;)
</ins><span class="cx">             req = BASE_URI + &quot;/livro.asp?tipo=10&amp;pesquisa=&quot; 
</span><span class="cx">             req += case type
</span><span class="cx">                 when SEARCH_BY_ISBN
</span><span class="lines">@@ -46,11 +47,14 @@
</span><span class="cx">                     raise InvalidSearchTypeError
</span><span class="cx"> 
</span><span class="cx">             end
</span><ins>+
+            criterion = Library.canonicalise_isbn(criterion) if type == SEARCH_BY_ISBN
</ins><span class="cx">             req += CGI.escape(criterion)
</span><ins>+            p req if $DEBUG
</ins><span class="cx">             data = transport.get(URI.parse(req))
</span><ins>+
</ins><span class="cx">             if type == SEARCH_BY_ISBN
</span><span class="cx">                 book = to_book(data, req)            
</span><del>-            
</del><span class="cx">             #else
</span><span class="cx">             #    begin
</span><span class="cx">             #        results = [] 
</span><span class="lines">@@ -82,13 +86,13 @@
</span><span class="cx">             md[1].strip.split(', ').each { |a| authors &lt;&lt; CGI.unescape(a.strip) }
</span><span class="cx">             raise &quot;No ISBN from Image&quot; unless md = /&lt;img src=&quot;capas\/([^&lt;]+)p\.jpg&quot; alt=&quot;&quot;\/&gt;/.match(data)
</span><span class="cx">             isbn = md[1].strip
</span><del>-            edition = nil
-            publish_year = nil
</del><span class="cx">             if md = /&lt;br\/&gt;Editora: ([^&lt;]+)&lt;br&gt;/.match(data)
</span><span class="cx">                 publisher = md[1].strip
</span><span class="cx">             else
</span><span class="cx">                 publisher = nil
</span><span class="cx">             end
</span><ins>+            edition = nil
+            publish_year = nil
</ins><span class="cx">             medium_cover = BASE_URI+'/capas/'+ isbn + '.jpg'
</span><span class="cx">             #raise &quot;No Big Image&quot; unless medium_cover = transport.get(URI.parse(BASE_URI+'/capas/'+ isbn + '.jpg'))
</span><span class="cx">             #raise &quot;No Big Image&quot; unless md = /&lt;img src=&quot;capas\/(.+\/(\d+)p\.gif)&quot; alt=&quot;&quot;\/&gt;/.match(data)
</span></span></pre></div>
<a id="trunkalexandrialibalexandriabook_providersmcurb"></a>
<div class="modfile"><h4>Modified: trunk/alexandria/lib/alexandria/book_providers/mcu.rb (610 => 611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/alexandria/lib/alexandria/book_providers/mcu.rb        2007-02-19 21:44:33 UTC (rev 610)
+++ trunk/alexandria/lib/alexandria/book_providers/mcu.rb        2007-02-20 11:32:55 UTC (rev 611)
</span><span class="lines">@@ -9,6 +9,7 @@
</span><span class="cx"> # but WITHOUT ANY WARRANTY; without even the implied warranty of
</span><span class="cx"> # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
</span><span class="cx"> # General Public License for more details.
</span><ins>+#
</ins><span class="cx"> # You should have received a copy of the GNU General Public
</span><span class="cx"> # License along with Alexandria; see the file COPYING.  If not,
</span><span class="cx"> # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
</span><span class="lines">@@ -69,6 +70,14 @@
</span><span class="cx">             type == SEARCH_BY_ISBN ? products.values.first : products.values
</span><span class="cx">         end
</span><span class="cx">         
</span><ins>+        def url(book)
+            &quot;http://www.mcu.es/cgi-bin/BRSCGI3701?CMD=VERLST&amp;BASE=ISBN&amp;CONF=AEISPA.cnf&amp;OPDEF=AND&amp;DOCS=1&amp;SEPARADOR=&amp;WGEN-C=&amp;WISB-C=&quot; + book.isbn + &quot;&amp;WAUT-C=&amp;WTIT-C=&amp;WMAT-C=&amp;WEDI-C=&amp;WFEP-C=&amp;%40T353-GE=&amp;%40T353-LE=&amp;WSER-C=&amp;WLUG-C=&amp;WDIS-C=DISPONIBLE&amp;WLEN-C=&amp;WCLA-C=&amp;WSOP-C=&quot;
+        end
+
+        #######
+        private
+        #######
+
</ins><span class="cx">         def parseBook(docn,ndoc)
</span><span class="cx">             detailspage='http://www.mcu.es/cgi-bin/BRSCGI3701?CMD=VERDOC&amp;CONF=AEISPA.cnf&amp;BASE=ISBN&amp;DOCN=' + docn + '&amp;NDOC=' + ndoc
</span><span class="cx">             print &quot;Looking at detailspage: #{detailspage}\n&quot; if $DEBUG # for DEBUGing
</span><span class="lines">@@ -143,10 +152,6 @@
</span><span class="cx">             return [ book ]
</span><span class="cx">         end
</span><span class="cx"> 
</span><del>-        def url(book)
-            return nil unless book.isbn
-            &quot;http://www.mcu.es/cgi-bin/BRSCGI3701?CMD=VERLST&amp;BASE=ISBN&amp;CONF=AEISPA.cnf&amp;OPDEF=AND&amp;DOCS=1&amp;SEPARADOR=&amp;WGEN-C=&amp;WISB-C=&quot; + book.isbn + &quot;&amp;WAUT-C=&amp;WTIT-C=&amp;WMAT-C=&amp;WEDI-C=&amp;WFEP-C=&amp;%40T353-GE=&amp;%40T353-LE=&amp;WSER-C=&amp;WLUG-C=&amp;WDIS-C=DISPONIBLE&amp;WLEN-C=&amp;WCLA-C=&amp;WSOP-C=&quot;
-        end
</del><span class="cx">     end
</span><span class="cx"> end
</span><span class="cx"> end
</span></span></pre></div>
<a id="trunkalexandrialibalexandriabook_providersproxisrb"></a>
<div class="modfile"><h4>Modified: trunk/alexandria/lib/alexandria/book_providers/proxis.rb (610 => 611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/alexandria/lib/alexandria/book_providers/proxis.rb        2007-02-19 21:44:33 UTC (rev 610)
+++ trunk/alexandria/lib/alexandria/book_providers/proxis.rb        2007-02-20 11:32:55 UTC (rev 611)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         def initialize
</span><del>-            super(&quot;Proxis&quot;)
</del><ins>+            super(&quot;Proxis&quot;, &quot;Proxis (Belgium)&quot;)
</ins><span class="cx">             prefs.add(&quot;lang&quot;, _(&quot;Locale&quot;), &quot;fr&quot;,
</span><span class="cx">                       LANGUAGES.keys)
</span><span class="cx">         end
</span><span class="lines">@@ -55,6 +55,7 @@
</span><span class="cx">           
</span><span class="cx">                 else
</span><span class="cx">                     raise InvalidSearchTypeError
</span><ins>+
</ins><span class="cx">             end
</span><span class="cx">           
</span><span class="cx">             products = {}
</span><span class="lines">@@ -74,7 +75,15 @@
</span><span class="cx">             raise NoResultsError if products.values.empty?
</span><span class="cx">             type == SEARCH_BY_ISBN ? products.values.first : products.values
</span><span class="cx">         end
</span><del>-        
</del><ins>+
+        def url(book)
+            &quot;http://oas2000.proxis.be/gate/jabba.search.submit_search?p_isbn=&quot; + book.isbn + &quot;&amp;p_item=1&quot;
+        end
+
+        #######
+        private
+        #######
+
</ins><span class="cx">         def parseBook(product_id)
</span><span class="cx">             conv = proc { |str| str.convert(&quot;utf-8&quot;, &quot;windows-1252&quot;) if str != nil }
</span><span class="cx">             detailspage='http://oas2000.proxis.be/gate/jabba.coreii.g_p?bi=4&amp;sp=DETAILS&amp;mi='+product_id
</span><span class="lines">@@ -82,14 +91,15 @@
</span><span class="cx">             product['authors'] = []
</span><span class="cx">             nextline = nil
</span><span class="cx">             transport.get(URI.parse(detailspage)).each do |line|
</span><del>-                if line =~ /SPAN CLASS=&quot;?AUTHOR&quot;?&gt;([^&lt;]*)&lt;/i
</del><ins>+                if line =~ /span class=&quot;?AUTHOR&quot;?&gt;([^&lt;]*)&amp;nbsp; &amp;nbsp;/i
</ins><span class="cx">                     author = $1.gsub('&amp;nbsp;',' ').sub(/ +$/,'')
</span><span class="cx">                     product['authors'] &lt;&lt; author
</span><span class="cx">                 elsif line =~ /SRC=&quot;(http:\/\/www.proxis.be\/IMG.\/.*)M\.jpg&quot;/i 
</span><span class="cx">                     product['image_url_small'] = $1+'S.jpg'
</span><span class="cx">                     product['image_url_medium'] = $1+'M.jpg'
</span><span class="cx">                     product['image_url_large'] = $1+'L.jpg'
</span><del>-                elsif line =~ /class=&quot;?TITLECOLOR&quot;?&gt;([^&lt;]*)&lt;/i 
</del><ins>+#                elsif line =~ /class=&quot;?TITLECOLOR&quot;?&gt;([^&lt;]*)&lt;/i 
+                elsif line =~ /&lt;tr width=&quot;?100%&quot;?&gt;&lt;td valign=&quot;?middle&quot;? width=&quot;?100%&quot;? class=&quot;?verd_13_b&quot;?&gt;([^&lt;]*)&lt;/i 
</ins><span class="cx">                     product['name'] = $1.sub(/ +$/,'')
</span><span class="cx">                 elsif line =~ /ISBN&lt;\/TD&gt;&lt;TD class=&quot;?INFO&quot;?&gt; : ([^&lt;]*)&lt;/i 
</span><span class="cx">                     product['isbn'] = $1
</span><span class="lines">@@ -117,11 +127,6 @@
</span><span class="cx">         
</span><span class="cx">             return [ book, product['image_url_medium'] ]
</span><span class="cx">         end
</span><del>-
-        def url(book)
-            return nil unless book.isbn
-            &quot;http://oas2000.proxis.be/gate/jabba.search.submit_search?p_isbn=&quot; + book.isbn + &quot;&amp;p_item=1&quot;
-        end
</del><span class="cx">     end
</span><span class="cx"> end
</span><span class="cx"> end
</span></span></pre></div>
<a id="trunkalexandrialibalexandriabook_providersrenaudrb"></a>
<div class="modfile"><h4>Modified: trunk/alexandria/lib/alexandria/book_providers/renaud.rb (610 => 611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/alexandria/lib/alexandria/book_providers/renaud.rb        2007-02-19 21:44:33 UTC (rev 610)
+++ trunk/alexandria/lib/alexandria/book_providers/renaud.rb        2007-02-20 11:32:55 UTC (rev 611)
</span><span class="lines">@@ -15,6 +15,8 @@
</span><span class="cx"> # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
</span><span class="cx"> # Boston, MA 02111-1307, USA.
</span><span class="cx"> 
</span><ins>+# http://en.wikipedia.org/wiki/Renaud-Bray
+
</ins><span class="cx"> require 'net/http'
</span><span class="cx"> require 'cgi'
</span><span class="cx"> 
</span><span class="lines">@@ -27,10 +29,11 @@
</span><span class="cx">       ACCENTUATED_CHARS = &quot;áàâäçéèêëíìîïóòôöúùûü&quot;
</span><span class="cx"> 
</span><span class="cx">       def initialize
</span><del>-        super(&quot;RENAUD&quot;, &quot;Renaud-Bray&quot;)
</del><ins>+        super(&quot;RENAUD&quot;, &quot;Renaud-Bray (Canada)&quot;)
</ins><span class="cx">       end
</span><span class="cx"> 
</span><span class="cx">       def search(criterion, type)
</span><ins>+        criterion = criterion.convert(&quot;iso-8859-1&quot;, &quot;utf-8&quot;)
</ins><span class="cx">         req = BASE_URI + &quot;francais/menu/gabarit.asp?Rubrique=&amp;Recherche=&amp;Entete=Livre&amp;Page=Recherche_section_wsc.asp&amp;OnlyAvailable=false&amp;Tri=&quot;
</span><span class="cx">         req += case type
</span><span class="cx">                when SEARCH_BY_ISBN
</span><span class="lines">@@ -45,7 +48,9 @@
</span><span class="cx">                  raise InvalidSearchTypeError
</span><span class="cx">                end
</span><span class="cx">         req += &quot;&amp;Phrase=&quot;
</span><ins>+
</ins><span class="cx">         req += CGI.escape(criterion)
</span><ins>+        p req if $DEBUG
</ins><span class="cx">         data = transport.get(URI.parse(req))
</span><span class="cx">         begin
</span><span class="cx">           if type == SEARCH_BY_ISBN
</span><span class="lines">@@ -71,7 +76,6 @@
</span><span class="cx">       end
</span><span class="cx"> 
</span><span class="cx">       def url(book)
</span><del>-        return nil unless book.isbn
</del><span class="cx">         &quot;http://www.renaud-bray.com/francais/menu/gabarit.asp?Rubrique=&amp;Recherche=&amp;Entete=Livre&amp;Page=Recherche_section_wsc.asp&amp;OnlyAvailable=false&amp;Tri=ISBN&amp;Phrase=&quot; + book.isbn
</span><span class="cx">       end
</span><span class="cx"> 
</span><span class="lines">@@ -80,7 +84,7 @@
</span><span class="cx">       #######
</span><span class="cx">       
</span><span class="cx">       def to_books(data)
</span><del>-        # Make it sure that we are in utf-8
</del><ins>+        data = CGI::unescapeHTML(data)
</ins><span class="cx">         data = data.convert(&quot;UTF-8&quot;, &quot;iso-8859-1&quot;)
</span><span class="cx">         titles = []
</span><span class="cx">         data.scan(/&quot;LireHyperlien&quot; href.*&gt;&lt;strong&gt;([-,'\(\)&amp;\#;\w\s#{ACCENTUATED_CHARS}]*)&lt;\/strong&gt;&lt;\/a&gt;&lt;br&gt;/).each{|md|
</span></span></pre></div>
<a id="trunkalexandrialibalexandriabook_providersthaliarb"></a>
<div class="modfile"><h4>Modified: trunk/alexandria/lib/alexandria/book_providers/thalia.rb (610 => 611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/alexandria/lib/alexandria/book_providers/thalia.rb        2007-02-19 21:44:33 UTC (rev 610)
+++ trunk/alexandria/lib/alexandria/book_providers/thalia.rb        2007-02-20 11:32:55 UTC (rev 611)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx">         end
</span><span class="cx">         
</span><span class="cx">         def search(criterion, type)
</span><ins>+            criterion = criterion.convert(&quot;iso-8859-1&quot;, &quot;utf-8&quot;)
</ins><span class="cx">             req = BASE_URI + &quot;shop/bde_bu_hg_startseite/schnellsuche/buch/?&quot;
</span><span class="cx">             #if type == SEARCH_BY_ISBN
</span><span class="cx">             #    req += &quot;&quot;
</span><span class="lines">@@ -55,7 +56,9 @@
</span><span class="cx">                     raise InvalidSearchTypeError
</span><span class="cx"> 
</span><span class="cx">             end
</span><ins>+
</ins><span class="cx">             req += CGI.escape(criterion)
</span><ins>+            p req if $DEBUG
</ins><span class="cx">             data = transport.get(URI.parse(req))
</span><span class="cx">             if type == SEARCH_BY_ISBN
</span><span class="cx">                 to_book(data) #rescue raise NoResultsError
</span><span class="lines">@@ -73,7 +76,6 @@
</span><span class="cx">         end
</span><span class="cx"> 
</span><span class="cx">         def url(book)
</span><del>-            return nil unless book.isbn
</del><span class="cx">             BASE_URI + &quot;shop/bde_bu_hg_startseite/schnellsuche/buch/?fqbi=&quot; + book.isbn
</span><span class="cx">         end
</span><span class="cx"> 
</span><span class="lines">@@ -83,7 +85,8 @@
</span><span class="cx">     
</span><span class="cx">         def to_book(data)
</span><span class="cx">                                                 puts data if $DEBUG
</span><del>-                                                data = data.convert(&quot;UTF-8&quot;, &quot;iso-8859-1&quot;)
</del><ins>+#                                                data = data.convert(&quot;UTF-8&quot;, &quot;iso-8859-1&quot;)
+                                                data = CGI::unescapeHTML(data)
</ins><span class="cx">                                                 product = {}
</span><span class="cx">                                                 # title
</span><span class="cx">             raise &quot;No Title&quot; unless md = /&lt;span id=&quot;_artikel_titel&quot;&gt;(.+)&lt;\/span&gt;&lt;span class=&quot;foobar&quot;&gt;/.match(data)
</span><span class="lines">@@ -96,7 +99,7 @@
</span><span class="cx">             end
</span><span class="cx">             #raise if product[&quot;authors&quot;].empty?
</span><span class="cx">                                                 # isbn
</span><del>-            raise &quot;No isbn&quot; unless md = /&lt;strong&gt;ISBN-10:&lt;\/strong&gt;(.+)&lt;\/li&gt;/.match(data)
</del><ins>+            raise &quot;No isbn&quot; unless md = /&lt;strong&gt;ISBN-13:&lt;\/strong&gt;(.+)&lt;\/li&gt;/.match(data)
</ins><span class="cx">             product[&quot;isbn&quot;] = md[1].strip.gsub(/-/, &quot;&quot;)
</span><span class="cx">                                                 # edition
</span><span class="cx">             md = /&lt;strong&gt;Einband:&lt;\/strong&gt; ([^,]&lt;)/.match(data)
</span></span></pre></div>
<a id="trunkalexandrialibalexandriabook_providerswebster_itrb"></a>
<div class="modfile"><h4>Modified: trunk/alexandria/lib/alexandria/book_providers/webster_it.rb (610 => 611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/alexandria/lib/alexandria/book_providers/webster_it.rb        2007-02-19 21:44:33 UTC (rev 610)
+++ trunk/alexandria/lib/alexandria/book_providers/webster_it.rb        2007-02-20 11:32:55 UTC (rev 611)
</span><span class="lines">@@ -29,13 +29,14 @@
</span><span class="cx">         REFERER = BASE_URI
</span><span class="cx">         LOCALE = &quot;BIT&quot; # used only for search by title/author/keyword. possible are: &quot;BIT&quot;, &quot;BUS&quot;, &quot;BUK&quot;, &quot;BDE&quot;, &quot;MIT&quot;
</span><span class="cx">         def initialize
</span><del>-            super(&quot;Webster_it&quot;, &quot;Webster Italia&quot;)
</del><ins>+            super(&quot;Webster_it&quot;, &quot;Webster (Italy)&quot;)
</ins><span class="cx">             FileUtils.mkdir_p(CACHE_DIR) unless File.exists?(CACHE_DIR)            
</span><span class="cx">             # no preferences for the moment
</span><span class="cx">             at_exit { clean_cache }
</span><span class="cx">         end
</span><span class="cx">         
</span><span class="cx">         def search(criterion, type)
</span><ins>+            criterion = criterion.convert(&quot;iso-8859-15&quot;, &quot;utf-8&quot;)
</ins><span class="cx">             req = BASE_URI + &quot;/&quot;
</span><span class="cx">             req += case type
</span><span class="cx">                 when SEARCH_BY_ISBN
</span><span class="lines">@@ -54,14 +55,11 @@
</span><span class="cx">                     raise InvalidSearchTypeError
</span><span class="cx"> 
</span><span class="cx">             end
</span><del>-            
-if type == SEARCH_BY_ISBN
-            req += Library.canonicalise_isbn(criterion)
-else
</del><ins>+
+            criterion = Library.canonicalise_isbn(criterion) if type == SEARCH_BY_ISBN
</ins><span class="cx">             req += CGI.escape(criterion)
</span><del>-end
</del><span class="cx">             p req if $DEBUG
</span><del>-                data = transport.get(URI.parse(req))
</del><ins>+            data = transport.get(URI.parse(req))
</ins><span class="cx">             if type == SEARCH_BY_ISBN
</span><span class="cx">                 to_book(data) #rescue raise NoResultsError
</span><span class="cx">             else
</span><span class="lines">@@ -78,7 +76,6 @@
</span><span class="cx">         end
</span><span class="cx"> 
</span><span class="cx">         def url(book)
</span><del>-            return nil unless book.isbn
</del><span class="cx">             BASE_URI + &quot;/isbn/&quot; + Library.canonicalise_isbn(book.isbn)
</span><span class="cx">         end
</span><span class="cx"> 
</span><span class="lines">@@ -109,8 +106,8 @@
</span><span class="cx">             isbn = &quot;978&quot; + md[1].strip[0..8]
</span><span class="cx">             isbn += String( Library.ean_checksum( Library.extract_numbers( isbn ) ) )
</span><span class="cx"> 
</span><del>-            raise unless md = /&lt;li&gt;&lt;span class=&quot;product_label&quot;&gt;Editore:&lt;\/span&gt; &lt;span class=&quot;product_text&quot;&gt;&lt;a href=&quot;([^&gt;]+)&gt;([^&lt;]+)/.match(data)
-                publisher = CGI.unescape(md[2].strip)
</del><ins>+            raise unless md = /&lt;li&gt;&lt;span class=&quot;product_label&quot;&gt;Editore:&lt;\/span&gt; &lt;span class=&quot;product_text&quot;&gt;&lt;a href=&quot;[^&gt;]+&gt;([^&lt;]+)/.match(data)
+                publisher = CGI.unescape(md[1].strip)
</ins><span class="cx"> 
</span><span class="cx">            if md = /&lt;li&gt;&lt;span class=&quot;product_label&quot;&gt;Pagine:&lt;\/span&gt; &lt;span class=&quot;product_text&quot;&gt;([^&lt;]+)/.match(data)
</span><span class="cx">              edition = CGI.unescape(md[1].strip) + &quot; p.&quot;
</span><span class="lines">@@ -124,8 +121,8 @@
</span><span class="cx">                 publish_year = nil if publish_year == 0
</span><span class="cx">             end
</span><span class="cx"> 
</span><del>-  if data =~ /javascript:popImage/ and  md = /&lt;img border=&quot;0&quot; alt=&quot;([^&quot;]+)&quot; src=&quot;([^&quot;]+)/.match(data)
-            cover_url = BASE_URI + md[2].strip
</del><ins>+  if data =~ /javascript:popImage/ and  md = /&lt;img border=&quot;0&quot; alt=&quot;[^&quot;]+&quot; src=&quot;([^&quot;]+)/.match(data)
+            cover_url = BASE_URI + md[1].strip
</ins><span class="cx">             # use &quot;p&quot; instead of &quot;g&quot; for smaller image
</span><span class="cx">             if cover_url[-5] == 103
</span><span class="cx">                 cover_url[-5] = 112
</span></span></pre></div>
<a id="trunkalexandrialibalexandriabook_providersworldcatrb"></a>
<div class="modfile"><h4>Modified: trunk/alexandria/lib/alexandria/book_providers/worldcat.rb (610 => 611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/alexandria/lib/alexandria/book_providers/worldcat.rb        2007-02-19 21:44:33 UTC (rev 610)
+++ trunk/alexandria/lib/alexandria/book_providers/worldcat.rb        2007-02-20 11:32:55 UTC (rev 611)
</span><span class="lines">@@ -56,11 +56,10 @@
</span><span class="cx">                     raise InvalidSearchTypeError
</span><span class="cx"> 
</span><span class="cx">             end
</span><del>-            
-            # this provider supports both isbn-10 and isbn-13
</del><ins>+
</ins><span class="cx">             req += CGI.escape(criterion)
</span><span class="cx">             p req if $DEBUG
</span><del>-                data = transport.get(URI.parse(req))
</del><ins>+            data = transport.get(URI.parse(req))
</ins><span class="cx">             if type == SEARCH_BY_ISBN
</span><span class="cx">                 to_book(data) #rescue raise NoResultsError
</span><span class="cx">             else
</span><span class="lines">@@ -77,7 +76,6 @@
</span><span class="cx">         end
</span><span class="cx"> 
</span><span class="cx">         def url(book)
</span><del>-            return nil unless book.isbn
</del><span class="cx">             BASE_URI + &quot;/isbn/&quot; + book.isbn
</span><span class="cx">         end
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkalexandrialibalexandriabook_providersz3950rb"></a>
<div class="modfile"><h4>Modified: trunk/alexandria/lib/alexandria/book_providers/z3950.rb (610 => 611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/alexandria/lib/alexandria/book_providers/z3950.rb        2007-02-19 21:44:33 UTC (rev 610)
+++ trunk/alexandria/lib/alexandria/book_providers/z3950.rb        2007-02-20 11:32:55 UTC (rev 611)
</span><span class="lines">@@ -115,6 +115,7 @@
</span><span class="cx">     end
</span><span class="cx">     
</span><span class="cx">     class LOCProvider &lt; Z3950Provider
</span><ins>+        # http://en.wikipedia.org/wiki/Library_of_Congress
</ins><span class="cx">         unabstract
</span><span class="cx"> 
</span><span class="cx">         include GetText
</span><span class="lines">@@ -130,6 +131,7 @@
</span><span class="cx">     end
</span><span class="cx">     
</span><span class="cx">     class BLProvider &lt; Z3950Provider
</span><ins>+        # http://en.wikipedia.org/wiki/British_Library
</ins><span class="cx">         unabstract
</span><span class="cx"> 
</span><span class="cx">         include GetText
</span></span></pre></div>
<a id="trunkalexandrialibalexandriauimain_apprb"></a>
<div class="modfile"><h4>Modified: trunk/alexandria/lib/alexandria/ui/main_app.rb (610 => 611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/alexandria/lib/alexandria/ui/main_app.rb        2007-02-19 21:44:33 UTC (rev 610)
+++ trunk/alexandria/lib/alexandria/ui/main_app.rb        2007-02-20 11:32:55 UTC (rev 611)
</span><span class="lines">@@ -250,7 +250,7 @@
</span><span class="cx">                 if books.length == 1
</span><span class="cx">                     all_url = false
</span><span class="cx">                     BookProviders.each do |provider|
</span><del>-                        has_url = provider.url(books.first) != nil
</del><ins>+                        has_url = books.first.isbn and provider.url(books.first) != nil
</ins><span class="cx">                         @actiongroup[provider.action_name].sensitive = has_url
</span><span class="cx">                         all_url = true if has_url and !all_url
</span><span class="cx">                     end
</span></span></pre></div>
<a id="trunkalexandriateststest_providersrb"></a>
<div class="modfile"><h4>Modified: trunk/alexandria/tests/test_providers.rb (610 => 611)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/alexandria/tests/test_providers.rb        2007-02-19 21:44:33 UTC (rev 610)
+++ trunk/alexandria/tests/test_providers.rb        2007-02-20 11:32:55 UTC (rev 611)
</span><span class="lines">@@ -62,13 +62,13 @@
</span><span class="cx">     def test_proxis
</span><span class="cx">         __test_provider(Alexandria::BookProviders::ProxisProvider,
</span><span class="cx">                         '9026965745')
</span><del>-                __test_provider(Alexandria::BookProviders::ProxisProvider,
</del><ins>+        __test_provider(Alexandria::BookProviders::ProxisProvider,
</ins><span class="cx">                         '0586071407')
</span><span class="cx">     end
</span><span class="cx"> 
</span><span class="cx">     def test_thalia
</span><span class="cx">         __test_provider(Alexandria::BookProviders::ThaliaProvider,
</span><del>-                        '3896673300') 
</del><ins>+                        '9783896673305') 
</ins><span class="cx">     end
</span><span class="cx"> 
</span><span class="cx">     def test_ibs_it
</span></span></pre>
</div>
</div>

</body>
</html>