Best Buy Camel Graph

Add Camelbuy graph + link to Best Buy product pages.

  1. // ==UserScript==
  2. // @name Best Buy Camel Graph
  3. // @version 1.0.1
  4. // @description Add Camelbuy graph + link to Best Buy product pages.
  5. // @namespace null
  6. // @include http://www.bestbuy.*/*
  7. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js
  8. // ==/UserScript==
  9.  
  10.  
  11. var width = 350;
  12. var height = 250;
  13. var chart = "sale";
  14.  
  15.  
  16.  
  17. var country = "us";
  18.  
  19. var element = $(':input[id="skuIdPDP"]');
  20. var asin = $.trim(element.attr("value"));
  21. var link2 = "<a target='blank' href='http://" + country + ".camelbuy.com/product/" + asin + "'><img src='http://charts.camelbuy.com/" + country + "/" + asin + "/" + chart + ".png?force=1&zero=0&w=" + width + "&h=" + height + "&desired=false&legend=1&ilt=1&tp=all&fo=0' /></a>";
  22.  
  23. var camelurl = 'http://camelbuy.com/product/' + asin;
  24.  
  25. GM_xmlhttpRequest({
  26. method: 'GET',
  27. url: camelurl,
  28. onload: function(response) {
  29.  
  30. var parser = new DOMParser ();
  31. var responseDoc = parser.parseFromString (response.responseText, "text/html");
  32.  
  33. if (!responseDoc.getElementById('chart_option_details').disabled) {
  34. $("#instore-availability").append("<div id='camelbuy' style='margin-top: 15px; margin-left: -2px'>" + link2 + "</div>");
  35.  
  36. }
  37.  
  38.  
  39.  
  40. }
  41. });

QingJ © 2025

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