🏠 Home 

Price Variation

Embeds CamelCamelCamel price chart in Amazon


Install this script?
  1. // ==UserScript==
  2. // @name Price Variation
  3. // @namespace PriceVariation
  4. // @description Embeds CamelCamelCamel price chart in Amazon
  5. // @include http://www.amazon.*/*
  6. // @include https://www.amazon.*/*
  7. // @version 20160613
  8. // @grant none
  9. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js
  10. // ==/UserScript==
  11. var width=500;
  12. var height = 200;
  13. var duration = "1y";
  14. $(document).ready(function () {
  15. var element = $(':input[name="ASIN"]');
  16. var arr = document.domain.split(".");
  17. var country = arr[arr.length - 1];
  18. if (country == "com") { var country = "us"; }
  19. if (element) {
  20. var asin = $.trim(element.attr("value"));
  21. var link = "<a target='blank' href='http://"+country+".camelcamelcamel.com/product/" + asin + "'><img src='http://charts.camelcamelcamel.com/"+country+"/" + asin + "/amazon.png?force=1&zero=0&w="+width+"&h="+height+"&desired=false&legend=1&ilt=1&tp=" + duration + "&fo=0' /></a>";
  22. $("#availability").append("<div id='camelcamelcamel' style='margin-top: 0px; margin-left: 0px'>" + link + "</div>");
  23. }
  24. });