自己更新一下box-z比价脚本

最近box-z比价脚本(原脚本地址:Box-z userccript)突然无效了,看了一下,只是box-z网站调整的图片的地址,改为了相对地址导致脚本替换错误,随手改了一下,想用的自己复制后替换即可。


// ==UserScript==
// @name           Box-z Price History Image
// @namespace      qixinglu.com
// @description    在网上商店产品页面,自动插入一张从 www.box-z.com 里的价格历史波动图片。
// @include        http://mvd.360buy.com/*
// @include        http://book.360buy.com/*
// @include        http://www.360buy.com/product/*
// @include        http://www.newegg.com.cn/product/*
// @include        http://www.newegg.com.cn/Product/*
// @include        http://www.amazon.cn/gp/product/*
// @include        http://www.amazon.cn/*/dp/*
// @include        http://www.amazon.cn/mn/detailApp*
// @include        http://product.dangdang.com/product.aspx?product_id=*
// @include        http://product.dangdang.com/Product.aspx?product_id=*
// @include        http://item.51buy.com/item-*
// @include        http://www.suning.com/emall/prd_10052_10051_-7_*.html*
// @include        http://www.suning.com/emall/snupgbpv_10052_10051_*_.html
// @include        http://www.suning.com/emall/sngbv_10052_10051_*_.html
// @include        http://www.gome.com.cn/ec/homeus/jump/product/*.html*
// @include        http://www.lusen.com/product-*
// @include        http://www.efeihu.com/Product/*.html*
// @include        http://www.tao3c.com/product/*
// @include        http://www.coo8.com/product/*.html*
// @include        http://www.yihaodian.com/product/detail.do?*
// @include        http://www.yihaodian.com/product/*
// @include        http://www.ouku.com/goods*
// @include        http://www.redbaby.com.cn/*/*.html*
// @include        http://www.bookschina.com/*
// @include        http://www.wl.cn/*
// @include        http://product.china-pub.com/*
// @include        http://www.winxuan.com/product/*
// @include        http://www.99read.com/product/*
// @include        http://www.99read.com/Product/*
// @include        http://www.new7.com/product/*
// ==/UserScript==

// 获得价格历史图片
function create_history_image_node(response) {
    var temp_document, img_node, img_node_src, image_node;
    temp_document = document.createElement('html');
    temp_document.innerHTML = response.responseText;
    img_node = temp_document.querySelector('div.fNumber img');
    if (img_node === null) {
        image_node = document.createElement('p');
        image_node.innerHTML = '这个产品貌似没有历史价格数据,<a href="' + response.finalUrl + '">查看链接</a>。';
    } else {
        // 修改样式
	img_node_src = "http://www.box-z.com" + img_node.getAttribute('src');
        //img_node_src = img_node.src.replace('chs=630x180', 'chs=720x240');
        img_node_src = img_node_src.replace('chts=FF0000%2c13', 'chts=FF0000%2c14');
        //img_node_src = img_node_src + '&chdls=,14';
        img_node.src = img_node_src;
	img_node.width = 630;
        img_node.height = 180;
        //img_node.width = 720;
        //img_node.height = 240;
        img_node.style.marginTop = "10px";
        img_node.style.marginBottom = "10px";
        // 加上链接
        image_node = document.createElement('a');
        image_node.href = response.finalUrl;
        image_node.appendChild(img_node);
    }
    return image_node;
}

function create_product_history_url(prefix, product_uid) {
    return "http://www.box-z.com/products/" + prefix + "-
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值