Bitcoin Forum
November 03, 2024, 04:26:02 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Idea: Userscript for Bitcoin integration into Amazon  (Read 3211 times)
ineededausername (OP)
Hero Member
*****
Offline Offline

Activity: 784
Merit: 1000


bitcoin hundred-aire


View Profile
January 07, 2012, 04:48:06 AM
 #1

Clearly, Amazon isn't about to start accepting Bitcoin anytime soon.  This proposal outlines how a userscript could basically fully integrate Bitcoin into Amazon, whether they like it or not. 

For the developer's convenience, the proposal outline is so specific that all a developer has to do to fill this need is blindly and brainlessly code up a userscript.  I'm too lazy at the moment, but someone's probably going to code this up.

Now, you ask, what are the benefits?  One can already buy products on Amazon with Bitcoin. 
However, from the technically-challenged end users' viewpoint, a familiar interface is infinitely better than another site.  Also, integration is good for everyone... nobody likes having two tabs open when one would do, or ordering a gift code, waiting for it, and then finally receiving it and using it to buy things.

Requirements:

1. Service for placing Amazon orders via Bitcoin.  This must accept API calls for the following:
> Create new order with selected items and shipping/billing address
> Get new address for an order
> Get current price of one bitcoin
The service must also be able to detect if the appropriate amount has been paid to the address, upon which someone (bot or user) is notified and orders the product.
2. Cloud wallet API
3. Transaction radar websocket API

Actions taken on all pages: BTC / USD / Both options for price display.  Replaces all prices with the appropriate amounts using the Amazon service's determined price (whatever it is).
Actions taken during checkout: Add "Pay with Bitcoin" to the payment options.  This does not open a new page, but overwrites the current one.
New Bitcoin checkout page:
Displays payment address, final payment amount, deadline for payment and a QR code just for kicks, and also submits a request to the backend to create a new pending order. 
Opens a websocket connection to some transaction radar API, and listens for your payment, while displaying a scrolling address bar. 
A confirmation popup then appears, saying that you need to pay X bitcoins to address Y, and asking whether you authorize the transaction.  If you click OK, it executes the transaction with the cloud wallet.  (Alternatively, we could use a local Bitcoin client with RPC, but this is not necessary because of the demographic we're targeting.)
When you are done paying, the page hides the scrolling address bar and tells you that you're done, but that the order needs to confirm. 
While you go get a coffee, another scrolling address bar appears. 
When X confirmations have been detected by the transaction radar, the page displays a success message.  Big green check mark included.
To be clear, the backend does its own confirmation, and does not rely on the userscript for confirmation. (Of course!) 
This page must conform to Amazon UI standards and look exactly like an Amazon page.

This is probably not the most secure userscript (I don't know much about security).  However, I'm just throwing the idea out there, and maybe one of you can make it usable, intuitive and secure.

Is this a stupid idea?  If not, can it be made secure?  If not, are there any other problems with this implementation?

If this can work, one of you can code it up in 10 minutes and we can have a new marketing tool.

(BFL)^2 < 0
Maged
Legendary
*
Offline Offline

Activity: 1204
Merit: 1015


View Profile
January 07, 2012, 06:53:00 AM
 #2

The interesting part is that there is a place to enter a gift card on the final order page, AND it's AJAX. That would make it really easy to have the script wait for the gift card code from the server, submit the gift card code, and then submit the order.

grubles
Full Member
***
Offline Offline

Activity: 180
Merit: 100


mistaken for gribble since 2011


View Profile
January 07, 2012, 07:04:39 AM
 #3

If you decide to go through with your idea, BitVPS.com can help you host it! We have discounts for Bitcoin related projects that are hosted with us  Smiley. If you need more info you can visit www.bitvps.com or #bitvps on freenode.




grubles

BM-NBi5PcH8BBqDVp7WSJe2pNgqEVvTjd6T
scintill
Sr. Member
****
Offline Offline

Activity: 448
Merit: 254


View Profile WWW
January 07, 2012, 08:27:21 AM
Last edit: January 08, 2012, 07:57:47 AM by scintill
 #4

Cool idea!  Here's a stab at replacing the prices, with a hardcoded exchange rate.  Hover to see original price.  Tested in Chrome and Firefox, it seems to get most prices; I've noticed some that get loaded after the page has loaded don't get replaced.  I'm not sure the best way to handle that.  It's only USD right now.

Code:
// ==UserScript==
// @name           Amazon Bitcoins
// @namespace      joeyhewitt
// @description    Show prices on Amazon in Bitcoin
// @match          http://www.amazon.com/*
// @match          https://www.amazon.com/*
// ==/UserScript==

// https://gist.github.com/437513

(function(callback) {
    var script = document.createElement("script");
    script.textContent = "(" + callback.toString() + ")(jQuery);";
    document.body.appendChild(script);
})(function($) {

    var BTCPerUSD = 6.59;
    var convertUSD = function(text) {
        return text.replace(/\$\d+(\.\d\d)?/g, function(USD) {
            return (parseFloat(USD.substring(1)) / BTCPerUSD).toFixed(2)+ ' BTC';
        });
    };

    $('.t14, .price, .priceLarge, .listprice, .tmm_olpLinks>a, #actualPriceExtraMessaging, .fionaBuyBox font, .t11, .mbcPriceCell, .plusShippingText').each(function() {
        var $priceEl = $(this);
        var originalPriceText = $priceEl.text();
        var btcPriceText = convertUSD(originalPriceText);
        $priceEl.hover( function() { $(this).text(originalPriceText); },
                        function() { $(this).text(btcPriceText) } );
        $priceEl.text(btcPriceText);
    });

});
click to install

As for the actual purchasing part, http://spendbitcoins.com/ takes BTC and gives Amazon gift codes in several currencies.  If they could provide an AJAXable API for price quotes and retrieving the code (including updates on them waiting for confirmations, etc.), we'd be mostly done, right?

EDIT: Updated code and link

1SCiN5kqkAbxxwesKMsH9GvyWnWP5YK2W | donations
ineededausername (OP)
Hero Member
*****
Offline Offline

Activity: 784
Merit: 1000


bitcoin hundred-aire


View Profile
January 07, 2012, 03:16:16 PM
 #5

The interesting part is that there is a place to enter a gift card on the final order page, AND it's AJAX. That would make it really easy to have the script wait for the gift card code from the server, submit the gift card code, and then submit the order.

Hmm, that's another way to do it... we have two approaches then, essentially:
(1) Pay for the order in BTC, and don't actually complete the order.  Hand the order to the Bitcoin Amazon service and have it complete the order (whether through a human operator or by bot)
(2) Pay for the order in BTC, get an equivalent gift card code, and use that to complete the order instantly.

I do like the second one more.

(BFL)^2 < 0
Phinnaeus Gage
Legendary
*
Offline Offline

Activity: 1918
Merit: 1570


Bitcoin: An Idea Worth Spending


View Profile WWW
January 07, 2012, 04:07:57 PM
 #6

I recon this approach would work for any site or B&M that accepts their gift card. Let's say I want to go to dinner tonight at Applebees and want to use my re-loadable gift card which is low on funds at the moment. I could top it off via Bitcoin with your approach. Genius!
ineededausername (OP)
Hero Member
*****
Offline Offline

Activity: 784
Merit: 1000


bitcoin hundred-aire


View Profile
January 07, 2012, 04:10:07 PM
 #7

I recon this approach would work for any site or B&M that accepts their gift card. Let's say I want to go to dinner tonight at Applebees and want to use my re-loadable gift card which is low on funds at the moment. I could top it off via Bitcoin with your approach. Genius!


Oh wow, you're right.  This approach to Bitcoin integration actually has far-reaching implications.
We should probably get it working ASAP and have it mentioned on lovebitcoins.org.

(BFL)^2 < 0
ineededausername (OP)
Hero Member
*****
Offline Offline

Activity: 784
Merit: 1000


bitcoin hundred-aire


View Profile
January 08, 2012, 12:39:32 AM
 #8

bump... any devs interested?

(BFL)^2 < 0
Phinnaeus Gage
Legendary
*
Offline Offline

Activity: 1918
Merit: 1570


Bitcoin: An Idea Worth Spending


View Profile WWW
January 08, 2012, 12:45:31 AM
 #9

bump... any devs interested?

Nevermind! There's not as many as I thought, even though most below have an affiliate program attached to them.   Shocked

Source: http://www.icardgiftcard.com/gift-cards/   CHECK 'EM OUT!

1-800-Baskets
1-800-Flowers
77kids
A Pea In The Pod
Acapulco
Aerie
AMC Theatres
American Eagle Outfitters
Applebee's
Aquarium Restaurant
Athleta
Athleta.com
Babin's Seafood
Baby Gap
Bahama Breeze®
Banana Republic
BananaRepublic.com
Barnes & Noble Booksellers
Barnes & Noble College Bookstores
Barnes & Noble eGiftCards
Bass Pro Shops
Bass Pro Shops. com
BathandBodyWorks.com
Bealls
Bergner's
Big Cedar Lodge
Big Fish
Black Angus Steakhouse
Bloomingdale's
Boardwalk Inn
Bon-Ton
Bonefish Grill
Boscov's
Boston Store
Brenner's Steakhouse
Brookstone.com
Buca di Beppo
Cabela's.com
Cadillac Authentic Mexican Restaurant
Cadillac Bar
Carrabba's Italian Grill
Carson Pirie Scott
CB2
Celebrity Cruises
Charley's Crab
Chart House
Cheesecake Factory
Cheryl & Co. Fresh Baked Cookies
Chevy's Fresh Mex
Children's Place
Chili's
Chocolate.com
Claim Jumper Restaurants
Container Store
Courtyard by Marriott
Crate and Barrel
Crew Cuts
Crutchfield.com
CVS
CVS eGift Card
Darden Restaurants
Dell.com
Destination Maternity
Dick's Sporting Goods.com
Domino's Pizza
Downtown Aquarium
Drs. Foster & Smith
Edwards Theatres
El Torito
El Torito Grill
Elder-Beerman
Express
F.Y.E. Music, Movies, Games and More
Fairway Rewards
Fandango.com
Fannie May Chocolates
Fleming's Steakhouse
Foot Locker
FragranceNet.com
Gap
Gap Kids
Gap Maternity
Gap.com
GapBaby.com
GapKids.com
GapMaternity.com
giftback Charity Card
Golden Nugget
Goody's
Grand Concourse
Grotto
Guitar Center
Gymboree
H&M
Harlow's Restaurant
Harry London Chocolates
Herberger's
HomeGoods
HoneyBaked Ham
Inn at The Ballpark
iTunes
J.Crew
Journeys
Journeys Kidz
Kazoodles Toys
Kemah Boardwalk
Kids Foot Locker
Kmart.com
Kohl's
L'Occitane
L.L.Bean Digital Gift Cards
L.L.Bean Signature Digital Gift Cards
La Griglia
Lady Foot Locker
Landry's Seafood House
Landrys Restaurants
Lands' End
Lands' End CANVAS
Lands' End.com
Legal Sea Foods
Logan's Roadhouse
LongHorn® Steakhouse
Lord & Taylor
Macy's
Macys.com
Magazines.com
Maggiano's Little Italy
Marriott
Marriott Vacation Club Int'l (rentals only)
Marshalls
McMenamin's Historic Hotels
McMenamin's Pubs & Breweries
Meez
Meriwether's Restaurant
Modell's.com
Morton's The Steakhouse
Motherhood Maternity
Muer Seafood Restaurants
NASCAR.com
NFLShop.com
NHL.com
Nike
Nike.com
Ninety-Nine Restaurants
Nutrisystem.com
O'Charley's Restaurants
Old Navy
OldNavy.com
Olive Garden®
Omaha Steaks.com
On the Border Mexican Grill
Outback Steakhouse
Overstock.com
P.F. Chang's China Bistro
Palais Royal
Panera Bread
PapaJohns.com
PBteen
Peebles
Peohe's
Pesce
Pier 1 Imports
Piperlime
Piperlime.com
Pottery Barn
Pottery Barn eGiftCards
Pottery Barn Kids
Rainforest Cafe
Red Door Spas
Red Lobster®
Red Robin
Regal Entertainment Group Theatres
REI.com
Renaissance Hotels & Resorts
Residence Inn
Romano's Macaroni Grill
Roy's
Ruby Tuesday
Sally Beauty
Salon Wish
Saltgrass Steak House
Sears
Sears.com
Sephora.com
Sharper Image
Shi by Journeys
Shoebuy.com
Shutterfly.com
Spa Finder
Spaweek.com
Sports Authority.com
Stage Stores
Staples
Starbucks Coffee
Stardoll
Stoney River Legendary Steaks
Sunglass Hut
T-Rex
T.G.I. Friday’s
T.J. Maxx
Texas Roadhouse
The Crab House
The Popcorn Factory
The San Luis Resort, Spa & Conf Center
The Voice Library
Timberland.com
Tony Roma's
Tower of the Americas
TownePlace Suites
TravelocityIncentives.com
United Artists Theatres
Vic and Anthony's Steakhouse
WeeWorld
West Elm
Williams-Sonoma
Williams-Sonoma eGiftCards
Willie G's Seafood and Steakhouse
Wine.com
Yak & Yeti
Younkers
Zappos.com
Zwinky


scintill
Sr. Member
****
Offline Offline

Activity: 448
Merit: 254


View Profile WWW
January 08, 2012, 08:14:43 AM
 #10

I replied in the newbie area, but Maged has moved my post here, and I assume it was he that whitelisted me. (Thanks!)

I wasn't sure if anyone noticed the moved post, so if you haven't, check out my userscript for replacing the prices (hardcoded exchange rate right now) and let me know how to improve it.  I've also asked Jeremy West of spendbitcoins.com about an API to help us do the purchasing.

It would be awesome to get lots of gift cards working like this!  spendbitcoins.com might help in that respect; they've got several already.

1SCiN5kqkAbxxwesKMsH9GvyWnWP5YK2W | donations
Jeremy West spendbitcoins.com
Hero Member
*****
Offline Offline

Activity: 700
Merit: 501



View Profile WWW
January 08, 2012, 10:17:09 AM
 #11

We're actually working on something very similar... for a lot more than just Amazon.

Jeremy West spendbitcoins.com
Hero Member
*****
Offline Offline

Activity: 700
Merit: 501



View Profile WWW
January 08, 2012, 10:26:02 AM
 #12

Cool idea!  Here's a stab at replacing the prices, with a hardcoded exchange rate.  Hover to see original price.  Tested in Chrome and Firefox, it seems to get most prices; I've noticed some that get loaded after the page has loaded don't get replaced.  I'm not sure the best way to handle that.  It's only USD right now.

Code:
// ==UserScript==
// @name           Amazon Bitcoins
// @namespace      joeyhewitt
// @description    Show prices on Amazon in Bitcoin
// @match          http://www.amazon.com/*
// @match          https://www.amazon.com/*
// ==/UserScript==

// https://gist.github.com/437513

(function(callback) {
    var script = document.createElement("script");
    script.textContent = "(" + callback.toString() + ")(jQuery);";
    document.body.appendChild(script);
})(function($) {

    var BTCPerUSD = 6.59;
    var convertUSD = function(text) {
        return text.replace(/\$\d+(\.\d\d)?/g, function(USD) {
            return (parseFloat(USD.substring(1)) / BTCPerUSD).toFixed(2)+ ' BTC';
        });
    };

    $('.t14, .price, .priceLarge, .listprice, .tmm_olpLinks>a, #actualPriceExtraMessaging, .fionaBuyBox font, .t11, .mbcPriceCell, .plusShippingText').each(function() {
        var $priceEl = $(this);
        var originalPriceText = $priceEl.text();
        var btcPriceText = convertUSD(originalPriceText);
        $priceEl.hover( function() { $(this).text(originalPriceText); },
                        function() { $(this).text(btcPriceText) } );
        $priceEl.text(btcPriceText);
    });

});
click to install

As for the actual purchasing part, http://spendbitcoins.com/ takes BTC and gives Amazon gift codes in several currencies.  If they could provide an AJAXable API for price quotes and retrieving the code (including updates on them waiting for confirmations, etc.), we'd be mostly done, right?

EDIT: Updated code and link

Wow! Just downloaded the script. Pretty cool! This should help us big time in finishing up our browser extension. Thanks!

Phinnaeus Gage
Legendary
*
Offline Offline

Activity: 1918
Merit: 1570


Bitcoin: An Idea Worth Spending


View Profile WWW
January 08, 2012, 08:04:32 PM
 #13

Cool idea!  Here's a stab at replacing the prices, with a hardcoded exchange rate.  Hover to see original price.  Tested in Chrome and Firefox, it seems to get most prices; I've noticed some that get loaded after the page has loaded don't get replaced.  I'm not sure the best way to handle that.  It's only USD right now.

Code:
// ==UserScript==
// @name           Amazon Bitcoins
// @namespace      joeyhewitt
// @description    Show prices on Amazon in Bitcoin
// @match          http://www.amazon.com/*
// @match          https://www.amazon.com/*
// ==/UserScript==

// https://gist.github.com/437513

(function(callback) {
    var script = document.createElement("script");
    script.textContent = "(" + callback.toString() + ")(jQuery);";
    document.body.appendChild(script);
})(function($) {

    var BTCPerUSD = 6.59;
    var convertUSD = function(text) {
        return text.replace(/\$\d+(\.\d\d)?/g, function(USD) {
            return (parseFloat(USD.substring(1)) / BTCPerUSD).toFixed(2)+ ' BTC';
        });
    };

    $('.t14, .price, .priceLarge, .listprice, .tmm_olpLinks>a, #actualPriceExtraMessaging, .fionaBuyBox font, .t11, .mbcPriceCell, .plusShippingText').each(function() {
        var $priceEl = $(this);
        var originalPriceText = $priceEl.text();
        var btcPriceText = convertUSD(originalPriceText);
        $priceEl.hover( function() { $(this).text(originalPriceText); },
                        function() { $(this).text(btcPriceText) } );
        $priceEl.text(btcPriceText);
    });

});
click to install

As for the actual purchasing part, http://spendbitcoins.com/ takes BTC and gives Amazon gift codes in several currencies.  If they could provide an AJAXable API for price quotes and retrieving the code (including updates on them waiting for confirmations, etc.), we'd be mostly done, right?

EDIT: Updated code and link

Wow! Just downloaded the script. Pretty cool! This should help us big time in finishing up our browser extension. Thanks!

When you're done with Amazon, do The Popcorn Factory gift card, since popcorn was the first purchase from a vending machine retrofitted to accept Bitcoin. Then follow that up with the 100's of other gift card accepting companies. That should keep you busy for the rest of the year.

~Bruno~
ineededausername (OP)
Hero Member
*****
Offline Offline

Activity: 784
Merit: 1000


bitcoin hundred-aire


View Profile
January 08, 2012, 08:31:56 PM
 #14

We're actually working on something very similar... for a lot more than just Amazon.

Wonderful... hope it gets done soon Smiley

(BFL)^2 < 0
Jeremy West spendbitcoins.com
Hero Member
*****
Offline Offline

Activity: 700
Merit: 501



View Profile WWW
January 09, 2012, 10:42:22 AM
 #15

We're actually working on something very similar... for a lot more than just Amazon.

Wonderful... hope it gets done soon Smiley

Looking for a programmer to make it happen ASAP. https://bitcointalk.org/index.php?topic=57275.0

ineededausername (OP)
Hero Member
*****
Offline Offline

Activity: 784
Merit: 1000


bitcoin hundred-aire


View Profile
February 29, 2012, 05:12:51 PM
 #16

This looks like it's close to getting done Shocked

(BFL)^2 < 0
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!