Amazon

From Makers Local 256
Jump to: navigation, search

Found a userscript that does the same thing I think. I modified it with our affiliate code. It should work on Firefox, Chrome and any other browser that supports user scripts. With Firefox you need greasemonkey but with Chrome is should just install. Also check out userscripts.org for other useful scripts.

Resources

Firefox

Chrome

Instructions

Firefox

  1. Go here, install greasemonkey. Restart Firefox.
  2. Sometimes greasemonkey installs in disabled mode. look for the monkey icon in the toolbar. If it is grayed out, you need to click it to enable greasemonkey. The icon should be full color now.
  3. Click on this link. If greasemonkey is correctly installed, it will ask you if you want to install the script. Restart Firefox browser.
  4. Go here, this will tell you if its working or not.
  5. Shop amazon.com normally
  6. You should see "makeloca256-20" in the url of the Amazon product you are looking at. You will have to be looking at the product itself, not a search result.

Chromium

  1. Click on this link.
  2. This doesn't actually need need your data on all sites, don't worry about that.
  3. Confirm install.
  4. Go here, this will tell you if its working or not.
  5. Shop amazon.com normally
  6. You should see "makeloca256-20" in the url of the Amazon product you are looking at

Chrome

From Google's help page: https://support.google.com/chrome_webstore/answer/2664769?p=crx_warning&rd=1

We recommend you only add extensions from other websites that you trust. In Chrome, you can follow these steps to add the extension:

  1. Download the extension file from the website and save it to your computer.
  2. Click the wrench icon on the browser toolbar.
  3. Select Tools > Extensions.
  4. Locate the extension file on your computer and drag the file onto the Extensions page.
  5. Review the list of permissions in the dialog that appears. If you would like to proceed, click Install.

Source

If the user script file is unavailable, you can open up a text editor and paste this source code in. Make sure the file has the extension .user.js (ex: something.user.js) Drag the file into your web browser, if greasemonkey is installed correctly it will pop up an installation page.


// ==UserScript==
// @name           Makers Local 256 Amazon Affiliate script
// @namespace      
// @description   Support Makers Local 256 via an easy Chrome Amazon Affiliate script.

// This is just a modification of Kelly Nielsen's script at http://userscripts.org/scripts/show/74583

// @include       *

// @author JimShoe
// ==/UserScript==


var associateID = 'makeloca256-20';

function getASIN(href) {
  var asinMatch;
  asinMatch = href.match(/\/exec\/obidos\/ASIN\/(\w{10})/i);
  if (!asinMatch) { asinMatch = href.match(/\/gp\/product\/(\w{10})/i); }
  if (!asinMatch) { asinMatch = href.match(/\/exec\/obidos\/tg\/detail\/\-\/(\w{10})/i); }
  if (!asinMatch) { asinMatch = href.match(/\/dp\/(\w{10})/i); }
  if (!asinMatch) { return null; }
  return asinMatch[1];
}

function getDomain() {
        if (document.location.hostname.substr(0,4) == 'www.')
                return document.location.hostname.substr(4) ;
        return document.location.hostname ;
}

(function() {
        var allLinks = document.getElementsByTagName("a");

        var asin = '';
        var currentDomain = getDomain();
        var linkDomain = (currentDomain.match(/amazon\./i) ? currentDomain : "amazon.com");
        for (i = 0; i < allLinks.length; i++) {
           var href = allLinks[i].href;
           if (href.match(/amazon\./i)) {
                   asin = getASIN(href);
                   if (asin != null) {
                                allLinks[i].setAttribute("href", "http://"+linkDomain+"/o/ASIN/" + asin + "/ref=nosim/"+associateID);
                        }
                }
        }
})();