O'Reilly logo

Amazon Hacks by Paul Bausch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Share the Love (and Savings!) with Your Friends

Amazon’s Share the Love program lets you and your friends save money by buying the same products. Here’s a way to keep track of who wants what.

Amazon’s “Share The Love” feature lets you send a 10% discount to people for the products you’ve purchased. For example, as you’re checking out while purchasing The Matrix DVD, you’re given the option to send a Share the Love discount via email. If anyone you send the discount to purchases the The Matrix DVD within a week, you’ll receive a credit (the amount the 10% provides off of the regular price—so the more expensive an item, the bigger the credit).

The problem is, it’s hard to know who among your friends is interested in the products you’re purchasing. (Not to mention the struggle to remember their email address while you’re checking out.)

This script comes to the rescue by gathering product requests from your friends, allowing all of you to share the savings with each other when you purchase products from Amazon. As you check out at Amazon, you can stop by this script to see if any of your friends have requested discounts for the products you’re purchasing.

The Code

This PHP script performs two separate actions depending on what variables are passed to it. If someone is adding a product they’d like to receive a discount on, it adds their email address to a text file. (The file is written to the same directory as the script with the name of the ASIN as the title, ASIN.db.) If someone is looking ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required