[Sugar-devel] GetBook activity

Gonzalo Odiard gonzalo at laptop.org
Sat Apr 2 11:51:57 EDT 2011


Hmm, then you is better use the OPDS service?
One of the problems in the OPDS server is we don't have the links to
the DejaVu files.
I am not very impressed with Internet Archive implementations.
The languages are not stored in standard ways, the information about the
formats of the files is not clear, etc. And I did not found a email to
contact the developers.
If you want help me testing what is the best way to request the books,
you can change in the find_books method:

            if self.source == 'Internet Archive':
                self.queryresults = \
                        opds.InternetArchiveQueryResult(search_text,
                        query_language, self)
            elif self.source in _SOURCES_CONFIG:

to
            """
            if self.source == 'Internet Archive':
                self.queryresults = \
                        opds.InternetArchiveQueryResult(search_text,
                        query_language, self)
            elif self.source in _SOURCES_CONFIG:
            """
            if self.source in _SOURCES_CONFIG:

and Internet Archive will use OPDS interface again.





On Sat, Apr 2, 2011 at 11:00 AM, James Simmons <nicestep at gmail.com> wrote:

> Gonzalo,
>
> I haven't tried out your Activity yet but I do want to warn you about
> one thing.  The RESTful service from IA does not give you the file
> name of the book, just it's identifier.  Now for MOST books in the
> Archive you can derive the file name from the identifier, but that
> isn't true for all of them.  For Community Books (those uploaded by
> outsiders) the filename can be quite different and the REST API
> doesn't give you a way to know what it is.
>
> For some examples of this, do a search for the word "nicestep" in the
> archive and you'll see all the community texts I've donated myself.
> You'll see a couple of issues:
>
> 1).  Filenames that don't match the identifier + a suffix.
> 2).  Filenames that DO match, but are not what you want.  For example,
>
> http://www.archive.org/details/TheContinentsAndTheirPeopleOceania
>
> If you try to download the PDF using the filename that GIAB uses
> you'll get a 203 megabyte monster!  The one you want is called
>
> TheContinentsAndTheirPeopleOceania_text.pdf
>
> and is only 4 megabytes.  It also includes searchable text, which the
> monster does not!
>
> OPDS is supported by IA (I think they helped to develop it) and should
> probably be used for all searches.  We can leave GIAB around until it
> has outlived it's usefulness.
>
> James Simmons
>
>
> On Fri, Apr 1, 2011 at 11:01 PM, Gonzalo Odiard <gonzalo at laptop.org>
> wrote:
> > Here there are a new unofficial version of GetBooks to test.
> > You can download it from http://dev.laptop.org/~gonzalo/GetBooks-6.xo(the
> > name of the file is the same, but is updated)
> > New improvements:
> > * Don't save entry in the Journal.
> > * Download cover images in separated threads to do the UI more
> responsive.
> > * Use REST client backend to search in Internet Archive (from Get
> Internet
> > Archive Books activity)
> > * Show books in the journal (My books, in the sources combo)
> > * Improved work flow (using "Open in Journal" buttons, like in Browse)
> > * Add support of DejaVu files.
> > * More minor fixes
> >
> > You can see the code (and start to contribute ;) ) in
> > http://git.sugarlabs.org/~godiard/get-books/gonzalo-mainline
> >
> > If you want test adding a private bookserver, you can install Pathagar
> >
> http://en.flossmanuals.net/e-book-enlightenment/ch026_the-pathagar-book-server
> > and copy the file get-books.cfg from the activity to /etc directory and
> add
> > a section:
> >
> > [MyBookServer]
> > name = MyBookServer
> > query_uri = http://IP_NUMBER/catalogs/?q=
> > opds_cover = http://opds-spec.org/cover
> >
> > Gonzalo
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110402/ac6d0e17/attachment.html>


More information about the Sugar-devel mailing list