07-11-2012, 03:49 AM | #1 |
The Night Parrot
Posts: 23
Karma: 138516
Join Date: Feb 2011
Location: Codfish Island, NZ
Device: Palm Vx, Kindle Keyboard (wifi)
|
Bookmarklet to check if Kindle "free" books are really free
One of my favourite foraging grounds for free books for my Kindle was Amazon's Best Sellers in Kindle eBooks. That shows the top paid and free in the US books. Many books have stopped being free in the Asia-Pacific region so i wrote a bookmarklet to which ones were actually free to me. It will show the ones that are free to you by loading the pages with your login and region.
(If you've not heard of bookmarklets before, they're a bookmark that is some JavaScript code. So instead of going to a new location, they perform an action on the current page.) I can't make a javascript: url in this forum, so it's a two step process to add it. Drag this link to your browser's bookmarks toolbar: Kindle Best Seller price correction Then change the url to: Code:
javascript:amznJQ.jQuery('.zg_availability').each(function(){if(amznJQ.jQuery(this).html().trim()=='Currently%20unavailable'){amznJQ.jQuery(this).parent().parent().css('opacity',0.2);}});amznJQ.jQuery('.price').each(function(){var%20url=amznJQ.jQuery(this).parent().parent().find('a').attr('href').trim();var%20price=amznJQ.jQuery(this).html().trim();if(price=='Free'||price=='$0.00'){(function(price_node,old_price,url){amznJQ.jQuery.get(url,{},function(data,textStatus){var%20pos0=data.indexOf('class="priceLarge"');var%20pos1=data.indexOf('>',pos0);var%20pos2=data.indexOf('<',pos1);var%20new_price=data.substring(pos1+1,pos2).trim();amznJQ.jQuery(price_node).after('%20actual:'+new_price);if(new_price!='$0.00'){amznJQ.jQuery(price_node).parent().parent().parent().css('opacity',0.2);}},'text');})(this,price,url);}else{amznJQ.jQuery(this).parent().parent().parent().css('opacity',0.2);}});void(0); Hopefully this is useful to someone. If you'd like to modify the bookmarket (eg turn it into a GreaseMonkey script or Chrome extension) or just to see how it works, here is the code before i removed all the whitespace: Code:
javascript: amznJQ.jQuery('.zg_availability').each(function() { if (amznJQ.jQuery(this).html().trim() == 'Currently unavailable') { amznJQ.jQuery(this).parent().parent().css('opacity', 0.2); } }); amznJQ.jQuery('.price').each(function() { var url = amznJQ.jQuery(this).parent().parent().find('a').attr('href').trim(); var price = amznJQ.jQuery(this).html().trim(); if (price == 'Free' || price == '$0.00') { (function(price_node, old_price, url) { amznJQ.jQuery.get(url, {}, function (data, textStatus) { var pos0 = data.indexOf('class="priceLarge"'); var pos1 = data.indexOf('>', pos0); var pos2 = data.indexOf('<', pos1); var new_price = data.substring(pos1 + 1, pos2).trim(); amznJQ.jQuery(price_node).after(' actual:' + new_price); if (new_price != '$0.00') { amznJQ.jQuery(price_node).parent().parent().parent().css('opacity', 0.2); } }, 'text'); })(this, price, url); } else { amznJQ.jQuery(this).parent().parent().parent().css('opacity', 0.2); } }); void(0); |
07-11-2012, 12:49 PM | #2 |
IOC Chief Archivist
Posts: 3,950
Karma: 53868218
Join Date: Dec 2010
Location: Fruitland Park, FL, USA
Device: Meebook M7, Paperwhite 2021, Fire HD 8+, Fire HD 10+, Lenovo Tab P12
|
YES, it is useful!!
Okay, one of the things that has been irking me about Amazon is if you sort by price, it includes "free for Prime lending" books in with the actual free books. Your bookmarklet whites out the ones that are only free for Prime lending. Yay! Thank you for this, and welcome to MR! |
Advert | |
|
07-11-2012, 02:18 PM | #3 |
...still a Zealot
Posts: 268
Karma: 319949
Join Date: Feb 2012
Location: Kansas City, Kansas, USA
Device: Palm Pixi & PC
|
Very cool, Kakapo! And very kind of you to share the fruits of your labor!
I'm in the US, and have other methods of checking for free Kindle books, but I can definitely see where this is a big help for those in other countries! Karma given, where Karma is due! KentE |
07-11-2012, 06:44 PM | #4 |
Junior Member
Posts: 6
Karma: 6916
Join Date: Dec 2011
Device: Sony e-reader
|
Wow! Thanks!
|
07-11-2012, 06:55 PM | #5 |
Guru
Posts: 725
Karma: 9209502
Join Date: Apr 2007
Location: Virginia
Device: Boox Palma, Kdle Scribe & Paperwhite, Kobo Eclipsa 2e & Libra 2, Ipads
|
Very useful! Thanks!
|
Advert | |
|
07-12-2012, 01:21 PM | #6 |
Junior Member
Posts: 1
Karma: 10
Join Date: Jul 2012
Device: Kindle Keyboard
|
Greasemonkey script It makes finding free books really easy. (Sets height of result div to 0px for non-free books.) credits to kakapo
Code:
// ==UserScript== // @name Amazon Free Books // @namespace ecky.public // @include http://www.amazon.com/* // @version 1 // ==/UserScript== function runClear() { unsafeWindow.amznJQ.jQuery('.zg_availability').each(function() { if (unsafeWindow.amznJQ.jQuery(this).html().trim() == 'Currently unavailable') { unsafeWindow.amznJQ.jQuery(this).parent().parent().css('opacity', 0.2); unsafeWindow.amznJQ.jQuery(this).parent().parent().css('height', 0); } }); unsafeWindow.amznJQ.jQuery('.price').each(function() { var url = unsafeWindow.amznJQ.jQuery(this).parent().parent().find('a').attr('href').trim(); var price = unsafeWindow.amznJQ.jQuery(this).html().trim(); if (price == 'Free' || price == '$0.00') { (function(price_node, old_price, url) { unsafeWindow.amznJQ.jQuery.get(url, {}, function (data, textStatus) { var pos0 = data.indexOf('class="priceLarge"'); var pos1 = data.indexOf('>', pos0); var pos2 = data.indexOf('<', pos1); var new_price = data.substring(pos1 + 1, pos2).trim(); unsafeWindow.amznJQ.jQuery(price_node).after(' actual:' + new_price); if (new_price != '$0.00') { unsafeWindow.amznJQ.jQuery(price_node).parent().parent().parent().css('opacity', 0.2); unsafeWindow.amznJQ.jQuery(price_node).parent().parent().parent().css('height', 0); } }, 'text'); })(this, price, url); } else { unsafeWindow.amznJQ.jQuery(this).parent().parent().parent().css('opacity', 0.2); unsafeWindow.amznJQ.jQuery(this).parent().parent().parent().css('height', 0); unsafeWindow.amznJQ.jQuery(this).parent().parent().parent().css('overflow', 'hidden'); } }); } document.addEventListener('click',function (){setTimeout(runClear,3000)},true); runClear(); |
07-13-2012, 07:33 AM | #7 |
Junior Junior Member
Posts: 87
Karma: 32996
Join Date: Jun 2011
Device: none
|
Thank you very much!
|
07-16-2012, 06:13 PM | #8 |
The Night Parrot
Posts: 23
Karma: 138516
Join Date: Feb 2011
Location: Codfish Island, NZ
Device: Palm Vx, Kindle Keyboard (wifi)
|
I'm glad everyone is enjoying the bookmarklet. I've written a new script for checking Kindle ebook prices directly in this forum. No more visiting a "free" link to find out it's not free for you.
Check it out at https://www.mobileread.com/forums/sho....php?p=2152684 |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Free books (Kindle) "Haunted" New York/Illinois/Virginia [Supernatural History] | ATDrake | Deals and Resources (No Self-Promotion or Affiliate Links) | 1 | 12-02-2011 05:54 PM |
Free books (Kindle) - 5 "Master the SAT" guides from Peterson[Study Guide] | ATDrake | Deals and Resources (No Self-Promotion or Affiliate Links) | 4 | 01-31-2011 06:34 PM |
Two Free "Books" (Kindle) - The Girl on the Beach & Mysterious Profile #24 | koland | Deals and Resources (No Self-Promotion or Affiliate Links) | 17 | 10-13-2010 06:17 PM |
Please restore the "free and inexpensive Kindle books" | kindlekitten | Amazon Kindle | 5 | 11-30-2009 04:07 PM |
Two free "books" on Kindle (extended samples) | koland | Deals and Resources (No Self-Promotion or Affiliate Links) | 0 | 08-23-2009 10:17 AM |