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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-03-2008, 07:24 PM   #1
RoninTech
Groupie
RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.
 
RoninTech's Avatar
 
Posts: 168
Karma: 1000036
Join Date: Oct 2008
Location: Citizen of the World
Device: iPod Touch, Nook Colour, Kobo Touch, Kobo Glo, Nexus 7, Nexus 5, Pixel
Feature Request for Edit Meta Information window's Rating field

Hi Kovid,

I was wondering if the Rating field could be one of the fields populated by the fetch from server button? Say the Amazon or B&N rating accessed via links on the isnbdb page. As with the rest of these fields a user could override the results of the fetch if they disagree.

Cheers,
Crazy
RoninTech is offline   Reply With Quote
Old 11-03-2008, 07:47 PM   #2
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: 43,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If you can outline the procedure to get the ratings, I'm happy to code it
kovidgoyal is offline   Reply With Quote
Advert
Old 11-03-2008, 10:26 PM   #3
RoninTech
Groupie
RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.
 
RoninTech's Avatar
 
Posts: 168
Karma: 1000036
Join Date: Oct 2008
Location: Citizen of the World
Device: iPod Touch, Nook Colour, Kobo Touch, Kobo Glo, Nexus 7, Nexus 5, Pixel
Quote:
Originally Posted by kovidgoyal View Post
If you can outline the procedure to get the ratings, I'm happy to code it
You bet. Amazon is great about this stuff. Lets say we want the review score for a book with ISBN 0596007973. First we'll need an Amazon API developers ECS ID to make API queries. Then you just construct a URL such as:

http://ecs.amazonaws.com/onca/xml?Se...eGroup=Reviews

1CE7SK4ZPTNDQZCWBP82 is your ID key and 0596007973 is the ISBN. The rest of the URL is boilerplate.

It returns some XML. If we drill down to ItemLookupResponse->Items->Item->CustomerReviews->AverageRating we see the book got a score of 4.5.



Here's an example script that gets the rating for the above book:

Code:
import urllib2 
from xml.dom import minidom
ACCESS_KEY_ID = "1CE7SK4ZPTNDQZCWBP82"
books_isbn = "0596007973"
ecsURL = "http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId="+ACCESS_KEY_ID+"&Operation=ItemLookup&ItemId="+books_isbn+"&ResponseGroup=Reviews" 
ecsNameSpace = "http://webservices.amazon.com/AWSECommerceService/2005-10-05" 
respXML = minidom.parse(urllib2.urlopen(ecsURL)) 
for items in respXML.getElementsByTagNameNS(ecsNameSpace, "Items"): 
    print items.getElementsByTagName("Item")[0].getElementsByTagName("AverageRating")[0].toxml()
Cheers,
Crazy
RoninTech is offline   Reply With Quote
Old 11-03-2008, 10:37 PM   #4
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: 43,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
What are amazon's policies about conccurrent key usage? Am I going to have to ask users to each sign up for an account?
kovidgoyal is offline   Reply With Quote
Old 11-03-2008, 11:11 PM   #5
RoninTech
Groupie
RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.
 
RoninTech's Avatar
 
Posts: 168
Karma: 1000036
Join Date: Oct 2008
Location: Citizen of the World
Device: iPod Touch, Nook Colour, Kobo Touch, Kobo Glo, Nexus 7, Nexus 5, Pixel
Yeah, that would make it a hassle if all users had to sign up for it rather than just your developer one. If you sign up for one at the link I gave above there should be an EULA shown. I didn't pay attention to it and I'm having trouble locating it after the fact.

Cheers,
Crazy

Found it:

http://aws.amazon.com/agreement/

Last edited by RoninTech; 11-03-2008 at 11:18 PM.
RoninTech is offline   Reply With Quote
Advert
Old 11-03-2008, 11:22 PM   #6
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: 43,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Looks like a no go:

You are not permitted to use Amazon Associates Web Service
with any Application or for any use that does not have, as its principal
purpose, driving traffic to the Amazon Website and driving sales of products
and services on the Amazon Website.
kovidgoyal is offline   Reply With Quote
Old 11-03-2008, 11:27 PM   #7
RoninTech
Groupie
RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.
 
RoninTech's Avatar
 
Posts: 168
Karma: 1000036
Join Date: Oct 2008
Location: Citizen of the World
Device: iPod Touch, Nook Colour, Kobo Touch, Kobo Glo, Nexus 7, Nexus 5, Pixel
Doh. Yeah, just read that and it gets worse the more you read. Ah well. Worth a shot. Fortunately its easy to just use my own script that appends this rating info to the content section of the stanza feed entries for each book.

Cheers,
Crazy
RoninTech is offline   Reply With Quote
Old 11-04-2008, 09:45 AM   #8
RoninTech
Groupie
RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.
 
RoninTech's Avatar
 
Posts: 168
Karma: 1000036
Join Date: Oct 2008
Location: Citizen of the World
Device: iPod Touch, Nook Colour, Kobo Touch, Kobo Glo, Nexus 7, Nexus 5, Pixel
I was thinking about this and by using the stanza feed aspect, I'll be inserting the books rating along with a link to the book's amazon page. So now when you view the book in Stanza on your iPhone or Ipod Touch there'll be a link to amazon next to the rating. I believe this is a heck of an argument to justifying the use of Amazon's web service as it'll be used to link people to their site.

Thoughts?
RoninTech is offline   Reply With Quote
Old 11-04-2008, 11:46 AM   #9
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: 43,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Should be fine for the stanza feed, if Amazon complains, it can always be removed
kovidgoyal is offline   Reply With Quote
Old 11-10-2008, 04:35 PM   #10
RoninTech
Groupie
RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.
 
RoninTech's Avatar
 
Posts: 168
Karma: 1000036
Join Date: Oct 2008
Location: Citizen of the World
Device: iPod Touch, Nook Colour, Kobo Touch, Kobo Glo, Nexus 7, Nexus 5, Pixel
Hi Kovid,

I have a python script working that gets the Amazon rating for every book in the Calibre DB via ISBN and then updates the meta information using this rating. I did this using the "show_metadata --as-opf" to get the original info and then updating it with "set_metadata". If I give a rating of 4, the book gets 2 stars. A rating of 8 gets 4 stars. Is this expected behaviour? The amazon rating is actually a float which I round to an int as thats what it looked like calibre was expecting. Are these the only acceptable values?:

0 - 0 stars
2 - 1 star
4 - 2 stars
6 - 3 stars
8 - 4 stars
10 - 5 stars

Also, I am adding a link to the Amazon review page in the dc:description field. This would show a hotlink to the books amazon review page when viewing the book info summary in stanza. Unfortunately the URL is not getting added when I do the set_metadata. Is html stripped from the opf file for this operation? The funny thing is that Pilotbob's post https://www.mobileread.com/forums/showpost.php?p=286521&postcount=25 would suggest otherwise.

Cheers,
Crazy
RoninTech is offline   Reply With Quote
Old 11-10-2008, 05:52 PM   #11
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: 43,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
yeah number of starts = rating/2 (rationale was to allow for half starts, which I never got around to implementing)

As for markup in the description field, it's not supported. Results are undefined.
kovidgoyal is offline   Reply With Quote
Old 11-10-2008, 07:37 PM   #12
RoninTech
Groupie
RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.
 
RoninTech's Avatar
 
Posts: 168
Karma: 1000036
Join Date: Oct 2008
Location: Citizen of the World
Device: iPod Touch, Nook Colour, Kobo Touch, Kobo Glo, Nexus 7, Nexus 5, Pixel
Cool. I've added the odd numbers back in and tossed the amazon URL. I've attached the script in case anyone else wants to update their library ratings. It takes a few seconds per book so do the math if you have a huge collection.

Cheers,
Crazy
Attached Files
File Type: zip amazon.zip (1.7 KB, 273 views)

Last edited by RoninTech; 02-05-2009 at 08:35 PM. Reason: Updated script to remove dependency on year 2008 and support new opf format
RoninTech is offline   Reply With Quote
Old 11-12-2008, 01:51 PM   #13
RoninTech
Groupie
RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.
 
RoninTech's Avatar
 
Posts: 168
Karma: 1000036
Join Date: Oct 2008
Location: Citizen of the World
Device: iPod Touch, Nook Colour, Kobo Touch, Kobo Glo, Nexus 7, Nexus 5, Pixel
I just added a new version of the script above that lets you run it numerous times on your calibre collection for when you add books.

Last edited by RoninTech; 11-12-2008 at 01:54 PM.
RoninTech is offline   Reply With Quote
Old 02-05-2009, 08:13 PM   #14
RoninTech
Groupie
RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.
 
RoninTech's Avatar
 
Posts: 168
Karma: 1000036
Join Date: Oct 2008
Location: Citizen of the World
Device: iPod Touch, Nook Colour, Kobo Touch, Kobo Glo, Nexus 7, Nexus 5, Pixel
I just updated it again to not count on it being the year 2008.
RoninTech is offline   Reply With Quote
Old 02-05-2009, 08:39 PM   #15
RoninTech
Groupie
RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.RoninTech ought to be getting tired of karma fortunes by now.
 
RoninTech's Avatar
 
Posts: 168
Karma: 1000036
Join Date: Oct 2008
Location: Citizen of the World
Device: iPod Touch, Nook Colour, Kobo Touch, Kobo Glo, Nexus 7, Nexus 5, Pixel
Hi Kovid,

Noticed my script is no longer able to update the CalibreDB with amazon's ratings for my books. I made the change to use the new opf metadata syntax but for some reason the metadata isn't being updated (0.4.133). Does the set_metadata feature of calibredb.exe still work?

"show_metadata --as-opf" still works to get the info. I modify this output with the rating and then feed it back via the set_metadata feature but it doesn't take.
RoninTech is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Meta Editor (Adding another field?) Guns4Hire Sigil 9 09-19-2010 09:44 PM
offer a CHOICE of covers in "edit meta information"? captain Calibre 3 08-04-2010 08:56 AM
Feature Request - Edit File Option fcoulter Calibre 10 07-22-2010 12:56 AM
Bulk edit - how to set the rating to 0 stars? highwaykind Calibre 3 02-01-2010 01:17 PM
Author Sort Field in Edit Meta Information Window RoninTech Calibre 4 11-13-2008 04:08 AM


All times are GMT -4. The time now is 09:14 AM.


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