03-16-2013, 02:33 PM | #16 |
Banned
Posts: 39
Karma: 71226
Join Date: Apr 2009
Location: vancouver
Device: kindle 2
|
Thanks. This is very cool.
|
03-18-2013, 07:16 PM | #17 | |
The Night Parrot
Posts: 23
Karma: 138516
Join Date: Feb 2011
Location: Codfish Island, NZ
Device: Palm Vx, Kindle Keyboard (wifi)
|
Quote:
|
|
03-18-2013, 08:48 PM | #18 | |
The Night Parrot
Posts: 23
Karma: 138516
Join Date: Feb 2011
Location: Codfish Island, NZ
Device: Palm Vx, Kindle Keyboard (wifi)
|
Quote:
Just changing the (com) to (ca) would work, but that would only check links that go to amazon.ca. I have made a new version of the script that converts amazon.com links to amazon.ca before checking the price. This is at http://userscripts.org/scripts/show/162321. The original script at http://userscripts.org/scripts/show/138544 has a new feature of displaying "already own" next to the price if you have already purchased the book. Very handy for repeat freebies. Conversion scripts for the other 8 Amazon international sites are coming soon. |
|
03-22-2013, 09:13 AM | #19 |
Connoisseur
Posts: 93
Karma: 124056
Join Date: Nov 2010
Location: Canada
Device: Kobo Clara HD, Kindle Paperwhite 10th Gen, Kindle 7th Gen
|
Thanks very much. It's very nice that it states it's cdn currency, and that you've pointed the urls to .ca instead of .com. I have a very crappy internet connection at home, so this now saves a lot of time since I had to go to .com, see if I liked the book description, then go to .ca to see if it's free for Canadians. Now I can see the price before I go to the website, and save the bandwidth of loading .com & .ca.
Also, I've added kebooks.com in the includes section in options, since I get their once or twice a day emails of free / cheap books. |
03-24-2013, 07:08 PM | #20 | |
Wizard
Posts: 1,841
Karma: 9547754
Join Date: Jul 2009
Location: Newcastle, Australia
Device: iPhone SE2020
|
Quote:
|
|
03-24-2013, 11:22 PM | #21 |
The Night Parrot
Posts: 23
Karma: 138516
Join Date: Feb 2011
Location: Codfish Island, NZ
Device: Palm Vx, Kindle Keyboard (wifi)
|
Another update today. I have added support for all 10 Amazon sites, choose your version at http://userscripts.org/users/476972/scripts. I am also batching requests so that repeated urls on the page will not result in repeated requests to Amazon.
|
03-25-2013, 01:30 PM | #22 | |
Avid reader
Posts: 825
Karma: 6377682
Join Date: Apr 2009
Location: UK
Device: Samsung Galaxy Z Flip 4 / Kindle Paperwhite
|
Quote:
Andrew |
|
10-24-2013, 04:57 AM | #23 |
Wizard
Posts: 1,841
Karma: 9547754
Join Date: Jul 2009
Location: Newcastle, Australia
Device: iPhone SE2020
|
Also to be noted, works well in Safari on Mac, with Ninjakit installed
|
07-06-2014, 09:23 AM | #24 | |
Wizard
Posts: 2,082
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
|
Quote:
bernie |
|
10-13-2014, 09:29 PM | #25 | |
Wizard
Posts: 1,931
Karma: 5456284
Join Date: Nov 2010
Device: Kindle Paperwhite 2, iPhone, Kindle Fire HD 6
|
Quote:
|
|
10-13-2014, 09:31 PM | #26 | |
Wizard
Posts: 1,931
Karma: 5456284
Join Date: Nov 2010
Device: Kindle Paperwhite 2, iPhone, Kindle Fire HD 6
|
Quote:
|
|
10-13-2014, 09:35 PM | #27 |
Resident Curmudgeon
Posts: 73,957
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Use http://userscripts-mirror.org/scripts/show/138544 for a working link.
|
10-14-2014, 12:51 AM | #28 | |
Wizard
Posts: 1,931
Karma: 5456284
Join Date: Nov 2010
Device: Kindle Paperwhite 2, iPhone, Kindle Fire HD 6
|
Quote:
|
|
08-25-2015, 06:23 PM | #29 | |
Wizard
Posts: 1,931
Karma: 5456284
Join Date: Nov 2010
Device: Kindle Paperwhite 2, iPhone, Kindle Fire HD 6
|
Quote:
|
|
09-19-2015, 11:40 AM | #30 | |
Wizard
Posts: 2,082
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
|
Quote:
Edit the following line in the script Code:
var pos0 = data.indexOf('class="priceLarge"'); Code:
var pos0 = data.indexOf('class="a-size-small a-color-price"'); Code:
// @namespace kakapo.public // @description Checks price of Kindle ebook links in MobileRead forum posts. Translates amazon.com links into your local site, please install the correct version. // @include https://www.mobileread.com/forums/showthread.php* // @version 3 // @grant GM_xmlhttpRequest // ==/UserScript== var site_regex = /^(http|https):\/\/(www\.)?amazon\.(com)(\/.*)/; var migrate_regex = false; var migrate_replacement = ''; var currency_prefix = '$'; var ebook_url_regexs = [ /^\/dp\//, /^\/[^\/]+\/dp\//, /^\/gp\/product\//, /^\/exec\/obidos\/ASIN\// ]; var check_price = function (elements, url) { var xhr = GM_xmlhttpRequest({ method: 'GET', url: url, onload: function (response) { var data = response.responseText; var pos0 = data.indexOf('class="a-size-small a-color-price"'); var pos1 = data.indexOf('>', pos0); var pos2 = data.indexOf('<', pos1); var price = data.substring(pos1 + 1, pos2).trim(); if (price == '') { price = 'N/A'; } var color = price == 'Free' || price == currency_prefix + '0.00' || price == currency_prefix + '0,00' || price == currency_prefix + '0' ? 'red' : 'blue'; pos0 = data.indexOf('class="iou_cust"'); if (pos0 >= 0) { price += ' already own'; } for (var i = 0; i < elements.length; i++) { elements[i].insertAdjacentHTML('afterend', ' <span style="color:' + color + '">(' + price + ')</span>'); } } }); } var a = document.getElementsByTagName('a'); var to_check = { }; for (var i = 0; i < a.length; i++) { var url = a[i].href; var parts = site_regex.exec(url); if (parts) { if (migrate_regex) { url = url.replace(migrate_regex, migrate_replacement); a[i].href = url; } for (var j = 0; j < ebook_url_regexs.length; j++) { if (ebook_url_regexs[j].test(parts[parts.length - 1])) { if (!to_check[url]) { to_check[url] = [ ]; } to_check[url].push(a[i]); } } } } for (var k in to_check) { check_price(to_check[k], k); } bernie |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
WOW! The Kobo Forum is Almost Getting as Much Action as the Kindle Forum!!! | pokee | Kobo Reader | 16 | 11-13-2011 09:50 AM |
Hate high ebook prices? Check out this experiment | iq3 | News | 75 | 02-08-2011 06:02 AM |
A site to check on prices of ebooks | sadievan | Deals and Resources (No Self-Promotion or Affiliate Links) | 3 | 12-06-2010 03:55 PM |
Serious exploit in Greasemonkey 0.4 | Alexander Turcic | Lounge | 2 | 07-19-2005 04:59 AM |