Amazon Price Variation (Fork)

Embeds CamelCamelCamel price chart in Amazon

  1. // ==UserScript==
  2. // @name Amazon Price Variation (Fork)
  3. // @namespace dsr-price-variation-camel
  4. // @description Embeds CamelCamelCamel price chart in Amazon
  5. // @include http://www.amazon.*/*
  6. // @include https://www.amazon.*/*
  7. // @include http://smile.amazon.*/*
  8. // @include https://smile.amazon.*/*
  9. // @version 20171209
  10. // @grant none
  11. // @require https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js
  12. // ==/UserScript==
  13.  
  14. var width = 500;
  15. var height = 200;
  16. var duration = "1y";
  17.  
  18. //Possible other values are "amazon", "new", "used", "new-used", & "amazon-new-used"
  19. var chart = "amazon-new";
  20.  
  21. $(document).ready(function () {
  22. var element = $(':input[name="ASIN"]');
  23. var arr = document.domain.split(".");
  24. var country = arr[arr.length - 1];
  25. if (country == "com") {
  26. country = "us";
  27. }
  28.  
  29. if (element) {
  30. var prot = window.location.protocol;
  31. var asin = $.trim(element.attr("value"));
  32. var link = "<a target='blank' href='" + prot + "//" + country + ".camelcamelcamel.com/product/" + asin + "'>" +
  33. "<img src='" + prot + "//charts.camelcamelcamel.com/" + country + "/" + asin + "/" + chart + ".png?force=1&zero=0&w=" + width + "&h=" + height + "&desired=false&legend=1&ilt=1&tp=" + duration + "&fo=0'/>" +
  34. "</a>";
  35.  
  36. $("#availability").append("<div id='camelcamelcamel' style='margin-top: 0px; margin-left: 0px'>" + link + "</div>");
  37. }
  38. });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址