01-22-2011, 09:56 AM | #1 |
Enthusiast
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!! |
01-22-2011, 09:31 PM | #2 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
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... |
Advert | |
|
01-22-2011, 11:42 PM | #3 | |
Enthusiast
Posts: 41
Karma: 12
Join Date: Oct 2010
Device: Tablet PC
|
Quote:
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. |
|
01-22-2011, 11:44 PM | #4 |
creator of calibre
Posts: 43,859
Karma: 22666666
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. |
01-23-2011, 09:59 AM | #5 | |
Enthusiast
Posts: 41
Karma: 12
Join Date: Oct 2010
Device: Tablet PC
|
Quote:
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 |
|
Advert | |
|
01-24-2011, 02:58 AM | #6 | |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Quote:
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... |
|
01-24-2011, 05:00 PM | #7 | |||
Enthusiast
Posts: 41
Karma: 12
Join Date: Oct 2010
Device: Tablet PC
|
Quote:
Quote:
Quote:
While I suspect a GoodReads plugin such as this would be popular with Calibre, and I suspect Calibre is popular, I find it hard to imagine it would appear on GoodRead's radar as abusive. If anything, it should bring additional traffic to their site, as users would still need to go there to SEE their shelves. |
|||
01-24-2011, 07:17 PM | #8 | |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Quote:
If this feature was developed as an optional GUI plugin like others in this thread rather than coming with Calibre by default then the actual volume of user hits will be miniscule by comparison. I can't help but wonder if perhaps part of Kovid's previous investigation was looking into GoodReads as a metadata reader source, which would most definitely hit the volume issues. So - sounds like it might be feasible to give it a try then. I have a few other plugins I am in the process of updating so won't look into it further for a few days but provided no-one else jumps in first I don't mind taking it on as a challenge. I could well end up bugging a few people like Kovid/chaley again for words of wisdom such as how to include a library in a plugin though |
|
01-29-2011, 03:11 PM | #9 | |
my parent's oops...
Posts: 466
Karma: 1477570
Join Date: Feb 2009
Device: Vx->Handera->Clie-> Axim->505->650->KPW/Aura ->iOS/L2
|
Wanted: Goodreads plug-in
Quote:
Last edited by slantybard; 01-30-2011 at 07:13 PM. |
|
02-01-2011, 01:38 AM | #10 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Right, so I've just spent a few hours on this and the good news is I got the Python sample to work and think I now have my head wrapped around oauth enough in terms of all the challenge/response tokens/secrets etc. I also don't anticipate any issues with including all of this in a plugin.
Here is the basic sequence that will take place for anyone interested:
So all pretty simple really in the end... In terms of the UI for the plugin. I'm going to describe below what I have in mind, if anyone has objections/changes let me know asap.
Any comments or ideas for other functionality you would like to see? The full list of the API is listed here. I have some ideas but as I'm not a hardcore GoodReads user I'm more interested in what others are wishing for. |
02-01-2011, 06:04 AM | #11 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Ok, new issue I have come across - no biggie but for that annoying Goodreads thoughput threshold rearing it's head again...
The API to add to a shelf requires a Goodreads bookid for the book. So for every book you first have to do an API call giving the ISBN to retrieve their bookid (if it is known). Then a second call to actually add the book to the shelf. If we were running the calls through a centralised server, you could store a database cache of ISBN to Goodreads id mappings, and over time reduce the throughput. However for now at least we aren't... Given the similar issues with LibraryThing currently being discussed in the main forum this plugin could fairly quickly share a similar demise... |
02-01-2011, 09:30 AM | #12 |
Enthusiast
Posts: 41
Karma: 12
Join Date: Oct 2010
Device: Tablet PC
|
Glad to see some progress on this. I saw your post on GoodReads, I hope they response favorably.
Just a note on shelves. The 3 default shelves are "exclusive", which means a book can only be on one at any given time. Adding a book to "read" takes it off "to-read/currently-reading" for you. I actually did some playing around with the GoodReads api this weekend. I put together a perl script (cause that's what I'm comfortable with) to fetch a user's shelf content, and update a custom column in calibre. I created a "tag" column in calibre with a value for each person in the family. I now run my script daily to fetch their "read" and "to-read" lists, compare those with the calibre db, and update the "read" custom column adding their name if they've read the book. This lets me maintain a single library (it gets rsynced to their computers) with read tracking. The final missing piece is an easy way to put a calibre book on a GoodReads shelf. I had a bugger of a time dealing with comparing books between calibre and goodreads. Variations in title and author spelling, etc. ISBN helps, but not everyone placed the book on their shelf using the same ISBN. This has been a big help. Now when I go to look for content to send to my reader, I can use a saved query to restrict calibre to all the books I haven't read, and then poke around by series/author etc. I can easily see which of those books someone else has read as well. I like to try to read things the kids are reading. |
02-01-2011, 11:37 AM | #13 | |
Groupie
Posts: 157
Karma: 259661
Join Date: Feb 2009
Location: Socal
Device: eBookwise 1150, Sony PRS-505, Sony PRS-T1
|
Quote:
|
|
02-01-2011, 05:00 PM | #14 | |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Quote:
As the interaction is "one way" (Calibre sucking data from Goodreads) and they gain no direct benefit from it I can't see them being "lenient" about it. Last edited by kiwidude; 02-01-2011 at 05:06 PM. |
|
02-01-2011, 05:29 PM | #15 | |
Groupie
Posts: 157
Karma: 259661
Join Date: Feb 2009
Location: Socal
Device: eBookwise 1150, Sony PRS-505, Sony PRS-T1
|
Quote:
And I'm also guessing there's no way to make each Calibre installation look independent and unique, so they're not all lumped together under the same application umbrella. You'd think the goodwill from users and Calibre bringing them more readers to check the site out would be a benefit, but I guess not. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wanted: Plug-in to do ODPS via DropBox | Frank Lowney | Plugins | 9 | 02-07-2011 10:09 AM |
Is goodreads.com up? | KenJackson | General Discussions | 15 | 01-02-2011 12:34 AM |
Anyone else here on Goodreads? | davidhburton | General Discussions | 13 | 04-25-2010 09:28 AM |
Goodreads! | Gideon | News | 13 | 08-14-2008 02:43 PM |