← Back to team overview

calibre-devs team mailing list archive

Re: Concept for interfacing with repositories such as Feedbooks

 

Integrating with feedbooks and manybooks.net are on my long term TODO list, 
but I'll be more than happy if you were to implement this functionality :)

The way I see it happening is the following:

The user clicks on a GUI button which opens a dialog. 

The dialog fetches the list of books from the website and presents them to the 
user (the list of books should be cached and only re-fetched if the last fetch 
was more than a day ago). The reason for doing this is so that the user can 
browse the book collection within calibre. 

The user should be able to browse the list of books and search for books etc. 
She can then specify books she wants and calibre will download and add them to 
its library.

As a first step, you should probably modify your script to fetch and cache the 
full list of books. At a minimum the list should have title, author, list of 
available formats and URL. Optionally publisher and  URL to cover thumbnail as 
well. You can use calibre's config system as an easy way to cache the list. 

from calibre.utils.config import DynamicConfig

c = DynamicConfig('feedbooks')
c['list'] = the_list # can be any picklable python object
c['last_downloaded'] = time

I'd recommend creating a QTableModel to abstract access to the list of books 
so that at a later date we can easily add new websites.

Once that's done, if you create a standalone GUI using PyQt based on a  
QDialog , that can later be easily integrated into calibre. I'd recommend 
creating a .ui file with designer for the dialog. You should be able to launch 
and test the GUI independently of calibre. Once you're satisfied with it, we 
can integrate it into calibre.

If you have questions/concerns/want to do things another way, don't hesitate 
to ask. 

Hope that helps,

Kovid. 

On Saturday 25 October 2008 20:11:46 Sean Peterson wrote:
> Hello,
>
> I wonder if anyone is interested in adding some functionality in Calibre
> to make it a little bit easier to work with online content repositories.
>
> I used jbook for a while and liked how even though it was a reader it
> had the capacity to get a list of txt files from project gutenberg
> servers and download the content to browse locally.
>
> When I saw the iPhone with Stanza could do something similar with
> feedbooks.com (see http://www.feedbooks.com/help/iphone) I decided to
> try and do something similar since there were a lot of ebooks that I
> wanted to download at once.
>
> Not having looked at the python scripts behind Calibre, I just cobbled
> together a rudimentary python script that queries the feedbook.com
> library through the web API, then parses the resulting xml file and
> downloads the e-books (currently only epubs).
>
> If that wasn't enough of a limitation, the results xml page doesn't
> contain all ebooks, just the first 20.
>
> The available documentation is minimal, but so far the API seems to be
> pretty intuitive. Just have to wait for the email reply to get some way
> to work around the 20 item limit.
>
> I'm considering making a simple graphical interface, so users averse to
> the command line can point and click. Before I go that route, I wanted
> to touch base and get feedback about this approach and how well it
> meshes (or doesn't) with the development goals and roadmap of Calibre.
>
> Thanks in advance.
>
> -Sean.

-- 
_____________________________________

Kovid Goyal  MC 452-48
California Institute of Technology
1200 E California Blvd
Pasadena, CA 91125

cell  : +01 626 390 8699
office: +01 626 395 6595 (449 Lauritsen)
email : kovid@xxxxxxxxxxxxxxxxxx
web   : http://www.kovidgoyal.net
_____________________________________

Attachment: signature.asc
Description: This is a digitally signed message part.


References