Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 01-22-2011, 09:56 AM   #241
nickdma
Enthusiast
nickdma began at the beginning.
 
Posts: 41
Karma: 12
Join Date: Oct 2010
Device: Tablet PC
Searching the forums, there appears to be some interest in the ability to track read/reading lists with GoodReads. There's also people who desire not to have any "social" integration with Calibre. It seems like a plugin would be a nice compromise.

Looking over the GoodReads api, they have a few basic URL's that can be called to add a book to a user's shelf. This seems like it would make it relatively easy to create a GUI plugin to attach to the context menu. Right-click -> send to GoodReads read shelf, send to GoodReads reading shelf, etc.

Maybe kiwidude would consider forking a copy of the Search the Internet plugin into a GoodReads Add to Shelf plugin? I think the only added bits needed would be to register the app with GoodReads for an API key, and add the OAuth handling to login to user's accounts.

It would almost even be a reasonable candidate to fold into Search the Internet.

I know you can do this type of thing with custom columns in Calibre. My wife and kids all share a copy of my library though, so that doesn't work very well. I'm sure there are users who enjoy the social aspect of GoodReads as well, and would prefer to push things out that way rather than in Calibre.

We generally select a number of books to send to our readers, so it would make sense to also do a "GoodReads -> Send to reading shelf" at the same time. Then, next time we plugin our readers to Calibre, we can select the books on device that we've read and do "GoodReads -> Send to read shelf".

I'm sure others would come up with their own workflows.

Any takers? I kinda know what needs to be done, it's the doing part that I'm lacking in

Can't wait to see the new Search the Internet plugin. I've been going through cleaning up my library, and I can't imagine how I got by without it before. That and Open With have made this task much more efficient, huge thanks kiwidude!!
nickdma is offline  
Old 01-22-2011, 05:35 PM   #242
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,224
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Interesting idea on the Goodreads integration. I will take a look into it later today.
kiwidude is offline  
Old 01-22-2011, 09:31 PM   #243
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,224
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Ok, so I've had a brief read through the GoodReads API. To be honest, oauth looks to be a *pita* to work with. I'm sure Kovid can confirm this but I don't believe Calibre uses oauth anywhere already so no quick & easy Python code for me to copy from . Plus there is the filth of callback urls which implies having a website to callback to...

I've got a few other questions too that would probably need asking in their developer forum. For instance you have to apply for a developer key (fine), but then it says that they monitor requests and part of their t&c are that a developer key does not make more than one request per second. So how does that work with multiple users of an application such as Calibre without a centralised web server to route the requests through? I can't guarantee that no two Calibre users around the world wouldn't click at the same time!

You don't need the developer key (just oauth) to submit data to their website like the adding a book to a shelve you mentioned - but you can't get the list of shelves a user has without it. I understand they don't want their API flooded but unless I am completely missing their point I don't see how you can have a very functional application?

I'll take another look sometime when I get a chance or if someone else can help shed light on this to progress it. From what I have seen it wouldn't make sense to incorporate it into the 'Search the Internet' plugin as you suggested, it's functionality and implementation are way too different. So it would be a separate standalone plugin.

There are some very cool things that you 'could' do with the API though, for the Calibre users who are GoodReads users too. So I can understand your desire for it...

Last edited by kiwidude; 01-22-2011 at 09:34 PM.
kiwidude is offline  
Old 01-22-2011, 11:08 PM   #244
redynstruc
Junior Member
redynstruc began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Dec 2010
Device: Kindle
Second Try at Making "Open With" Work on a Mac

Quote:
Originally Posted by kiwidude View Post
You are an incorrect name of the tweak - where did you get that from? The correct name of the tweak is owp_open_with_menus (owp for open with plugin - a prefix I use to ensure no naming collisions with any functionality added to Calibre)

[EDIT: I just realised that while the post has the correct tweak name, my manual editing of the readme.txt file was rubbish and no doubt what you copied from. Sorry for the inconvenience, new zip will be pushed to the post]

You will need to restart Calibre to get the new menu displayed of course. I may do another version of the plugin in future so it does not require a restart, I've got the whole dynamic menu in Qt thing figured out now with the last plugin I did.
OK, so I downloaded the new zip file and put the following in my "current tweaks" section of my Calibre preferences:
from PyQt4.Qt import Qt
owp_open_with_menus = [('AZW (Kindle)', 'AZW', '/MacintoshHD/Applications/Kindle.app', None, 'mspaint.png', Qt.AltModifier+Qt.Key_E)]
When right-click on a book, my context menu shows "Open With" and, when this is moused over, "AZW (Kindle)." Invoking the option, however, gets me the following error message:
OSError:[Errno 2] No such file or directory
When you ask Mac to "copy" the error's details, this is what it tells you:
ERROR: ERROR: Unhandled exception: <b>OSError</b>:[Errno 2] No such file or directory

Traceback (most recent call last):
File "<string>", line 120, in open_with
File "<string>", line 131, in launch_app
File "lib/python2.7/subprocess.py", line 672, in __init__
File "lib/python2.7/subprocess.py", line 1201, in _execute_child
OSError: [Errno 2] No such file or directory
I kept thinking there was a problem with the path in my tweak, but, now, I think the problem is that the path in the script doesn't match what's on my machine. Here are the "python" paths I've found which seem to relate to what the script is trying to do:
/Applications/Python\ 2.7

/Library/Python/2.6
It troubles me (mostly due to my ignorance, I'm sure) that I have a "Phython 2.7" sub-folder in my applications folder, but no "2.7" sub-folder in my /Library/Python folder.

Anyway, is there anything that jumps out as you as being an easy fix to my problem?

Thanks.
redynstruc is offline  
Old 01-22-2011, 11:42 PM   #245
nickdma
Enthusiast
nickdma began at the beginning.
 
Posts: 41
Karma: 12
Join Date: Oct 2010
Device: Tablet PC
Quote:
Originally Posted by kiwidude View Post
Ok, so I've had a brief read through the GoodReads API. To be honest, oauth looks to be a *pita* to work with. I'm sure Kovid can confirm this but I don't believe Calibre uses oauth anywhere already so no quick & easy Python code for me to copy from . Plus there is the filth of callback urls which implies having a website to callback to...
I initially thought that as well (the need for a website for the callbacks), but I don't think it's a requirement. I think the callback URL is intended for websites, as a nice way to redirect the user back to your site after they've logged in at GoodReads and approved your app to have access.

Once a user has granted access to your app, I think your app is allowed to make changes to their data until they revoke the app's access.

The bit about the 1 request per second is odd though. That has to be there so they can deny access to abusive apps. I can't imagine they hold every app to such a low threshold. Any popular app is likely to hit with that frequency.

Anyway, thanks for looking into it. Hopefully there's enough interest for someone to tackle it. If I was more fluent with python I'd give it a go, but my past attempts at doing much with python didn't go so well.

The OAught stuff was definitely the sticky part though. GoodReads recommends using a library for the OAuth work. There's a python one here https://github.com/simplegeo/python-oauth2, which you may have already found.
nickdma is offline  
Old 01-22-2011, 11:44 PM   #246
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,923
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I had a look at the goodreads api a while back and like most web 2.0 vintage APIs it is designed for use only from other websites, and low traffic ones at that. One request per second is unworkable, even routing through a central server, calibre has too many users. I'm not criticizing GoodReads for that, they have their business model, it's just not usable from calibre.

And no, there is no OAuth code in calibre, I've never been able to make heads or tails of OAuth, something about OAuth and my brain just don't get along.
kovidgoyal is offline  
Old 01-23-2011, 02:04 AM   #247
danwdoo
Zealot
danwdoo can teach chickens to fly.danwdoo can teach chickens to fly.danwdoo can teach chickens to fly.danwdoo can teach chickens to fly.danwdoo can teach chickens to fly.danwdoo can teach chickens to fly.danwdoo can teach chickens to fly.danwdoo can teach chickens to fly.danwdoo can teach chickens to fly.danwdoo can teach chickens to fly.danwdoo can teach chickens to fly.
 
danwdoo's Avatar
 
Posts: 114
Karma: 3546
Join Date: Jan 2009
Location: Texas
Device: PRS-505
That's a shame on the goodreads part but it makes since why it probably won't work. Just the thought of having my books lists synched to Goodreads seemed too good to be true. Though I also would never want to see the social stuff integreated. Maybe eventually Goodreads will see this as an opportunity and make some changes on their end to allow this. Stranger things have happened!

Danny
danwdoo is offline  
Old 01-23-2011, 06:49 AM   #248
Philosopher
Enthusiast
Philosopher began at the beginning.
 
Philosopher's Avatar
 
Posts: 43
Karma: 12
Join Date: Jun 2010
Device: Kindle
This is an incredibly helpful plugin. I would like to see it come with a search for Library of Congress as well. Not sure how to do it.
Philosopher is offline  
Old 01-23-2011, 07:56 AM   #249
kacir
Wizard
kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.
 
kacir's Avatar
 
Posts: 2,784
Karma: 3098803
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
Quote:
Originally Posted by kiwidude View Post
This plugin provides a way to quickly switch between certain preferences values without going into the preferences dialog.
Feedback after 3 weeks of use.

I can't imagine going back to using Calibre without this plugin.
Importing books is much more streamlined, and I can switch between several sets of Import Regular Expressions, and between "swap author names" or not.

The only thing that doesn't work on my Linux version of Calibre is Key Shortcuts. But it is no big deal, because usually I have to go to menu anyway to see what are the current settings.
kacir is offline  
Old 01-23-2011, 09:59 AM   #250
nickdma
Enthusiast
nickdma began at the beginning.
 
Posts: 41
Karma: 12
Join Date: Oct 2010
Device: Tablet PC
Quote:
Originally Posted by kovidgoyal View Post
I had a look at the goodreads api a while back and like most web 2.0 vintage APIs it is designed for use only from other websites, and low traffic ones at that. One request per second is unworkable, even routing through a central server, calibre has too many users. I'm not criticizing GoodReads for that, they have their business model, it's just not usable from calibre.

And no, there is no OAuth code in calibre, I've never been able to make heads or tails of OAuth, something about OAuth and my brain just don't get along.
I found a snippit on someone's blog that eluded to the "request per second" being when using "devkey" related API calls, and not "OAuth" calls. I'm trying to look further into that. I may just email Goodreads and ask them to clarify and see if what's being discussed here would be a problem.

I also found this, a python example to add books to a shelf, complete with OAuth.

http://www.goodreads.com/topic/show/...w-to-use-oauth

It uses a library for OAuth, and I don't know if a library can be part of a GUI plugin, or if the library would have to be included with Calibre for a plugin to use it. Hopefully it could be included with just the plugin so Calibre wouldn't have to carry additional libraries others may not use.

I didn't see any need for a web service to accept a callback URL. I think the plugin would require an additional menu entry (or a GUI) with a mechanism to send the user to the GoodReads site to login and approve plugin access. I think that's just a one time thing though, which is the nice part of OAuth, the user allows your app to access their data, and that's it, no login each use.

Edit: I posted on their dev forum asking for clarification on the TOS. http://www.goodreads.com/topic/show/...rvice-question

Last edited by nickdma; 01-23-2011 at 10:21 AM.
nickdma is offline  
Old 01-23-2011, 11:30 AM   #251
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,923
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can certainly include a library inside a plugin.
kovidgoyal is offline  
Old 01-23-2011, 04:55 PM   #252
Philosopher
Enthusiast
Philosopher began at the beginning.
 
Philosopher's Avatar
 
Posts: 43
Karma: 12
Join Date: Jun 2010
Device: Kindle
The one thing I would like to see is a way to use the internet search from the edit book window - so if downloading the metadata fails I can quickly click to search amazon or google.
Philosopher is offline  
Old 01-23-2011, 08:50 PM   #253
slantybard
my parent's oops...
slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.
 
Posts: 300
Karma: 1182942
Join Date: Feb 2009
Device: Vx->Handera->Clie-> Axim->505->650->KPW/Aura
Quote:
Originally Posted by Philosopher View Post
The one thing I would like to see is a way to use the internet search from the edit book window - so if downloading the metadata fails I can quickly click to search amazon or google.
This request was already discussed on page 16 of this thread:
http://www.mobileread.com/forums/sho...&postcount=235
slantybard is offline  
Old 01-24-2011, 02:43 AM   #254
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,224
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Quote:
Originally Posted by Philosopher View Post
This is an incredibly helpful plugin. I would like to see it come with a search for Library of Congress as well. Not sure how to do it.
I've included that LoC website in the list that will come with the plugin. To everyone waiting - I plan on posting the new version here tomorrow. I made a few more changes today and awaiting feedback from a few "testers" to make sure the last minute additions didn't break anything...
kiwidude is offline  
Old 01-24-2011, 02:58 AM   #255
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,224
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Quote:
Originally Posted by nickdma View Post
... I also found this, a python example to add books to a shelf, complete with OAuth...
Thanks for continuing the legwork on this one and also to Kovid for his thoughts which have confirmed a few things. If there is no need for any intermediary website and the OAuth Python library does the job then that does "only" leave the throughput issues. We'll see what sort of response you can get on that - it clearly isnt worthwhile doing unless more than one person can use the plugin at a time

If the T&C only apply to DevKey and not OAuth calls then we can probably get away with it for just your desired feature of adding to a shelf. We could just make the user specify the shelf name as part of the configuration preferences, rather than say giving them a popup dialog of "choosing a shelf" in response to the right-click. I don't think you could add too many other features to the plugin without DevKey support though, it was pretty integral to any kind of "read" query against GoodReads from the quick look I had.

Look forward to any clarification you are able to glean on that throughput stuff and see what happens...
kiwidude is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom external commands in the GUI janvanmaar Calibre 18 11-28-2010 10:35 AM
Calibre GUI behavior between machines phenomshel Calibre 2 08-21-2010 06:28 PM
Calibre 0.6.10 GUI crashes on startup Wagenius Calibre 1 09-03-2009 01:53 AM
--breadth-first option in calibre GUI osmo79 Calibre 1 05-30-2009 11:45 AM
Calibre GUI crash on convert aapezzuto Calibre 1 08-02-2008 06:39 PM


All times are GMT -4. The time now is 06:24 PM.


MobileRead.com is a privately owned, operated and funded community.