Greasy Fork is available in English.

省钱购优惠券!-jie

搜索券+领取优惠券按钮

Tento skript by neměl být instalován přímo. Jedná se o knihovnu, kterou by měly jiné skripty využívat pomocí meta příkazu // @require https://greasyfork.org/scripts/376275-%E7%9C%81%E9%92%B1%E8%B4%AD%E4%BC%98%E6%83%A0%E5%88%B8-jie/code/%E7%9C%81%E9%92%B1%E8%B4%AD%E4%BC%98%E6%83%A0%E5%88%B8!-jie.js?version=659197

//优惠券超级搜索
var conpou='http://apis.vephp.com/super?vekey=V00001118Y34291109&para=';
//淘宝
var l="",s="";
setInterval(function(){

if(l!=document.URL){
$(".J_ItemPicA").each(function(index){
     var id=$(this).attr("data-nid");
     GM_xmlhttpRequest({
         url:conpou+id,
         method:"get",
         onload:function(d){
             var tmp=JSON.parse(d.responseText)
             if(tmp.data==undefined){s=$(".J_ItemPic").eq(index).attr("alt");if(s==undefined){s=$(".J_ItemPic").eq(index).attr("title");}}else{s=tmp.data.title}
             if(tmp.result==1){$(".price").eq(index).append("<a href='"+tmp.data.coupon_click_url+"' target='_blank'><strong style='border-radius:7px;background-color:red;padding:5px;font-size:15px;color:white;'>优惠券"+tmp.data.coupon_info.match(/减\d+元/)[0].replace(/减/,"")+"</strong></a>")}//else{$(".price").eq(index).append("<a href='http://lingquvip.com/index.php?r=searchlist&kwd="+encodeURIComponent(s)+"&type=1' target='_blank'><strong style='border-radius:7px;background-color:#0D9EE6;padding:5px;font-size:15px;color:white;'>领取优惠券</strong></a>")}
         }

     })

})
//天猫,天猫国际
$(".productTitle a").not(".lightspot").each(function(index){
   var id=$(this).attr("href").match(/id=\d+/)[0].replace(/id=/,"")
    if(id!=undefined){
        GM_xmlhttpRequest({
            url:conpou+id,
            method:"get",
            onload:function(d){
                var tmp=JSON.parse(d.responseText)
                //console.log(index+" "+tmp.data+" "+tmp.result)
                if(tmp.data==undefined){s=$(".productTitle a").eq(index).attr("title")}else{s=tmp.data.title}
                if(tmp.result==1){$(".productPrice").eq(index).append("<a href='"+tmp.data.coupon_click_url+"' target='_blank'><em style='border-radius:7px;background-color:red;padding:0px 3px;font-size:15px;color:white;'>优惠券"+tmp.data.coupon_info.match(/减\d+元/)[0].replace(/减/,"")+"</em></a>");}//else{$(".productPrice").eq(index).append("<a href='http://lingquvip.com/index.php?r=searchlist&kwd="+encodeURIComponent(s)+"&type=1' target='_blank'><em style='border-radius:7px;background-color:#0D9EE6;padding:0px 3px;font-size:15px;color:white'>领取优惠券</em></a>")}
            }

        })
    }
})  
//天猫超市
$(".product").each(function(index){
   var id=$(this).attr("data-itemid");
    if(id!=undefined){
        GM_xmlhttpRequest({
            url:conpou+id,
            method:"get",
            onload:function(d){
                var tmp=JSON.parse(d.responseText)
                //console.log(index+" "+tmp.data+" "+tmp.result)
                if(tmp.data==undefined){s=$(".product-title a").eq(index).text();}else{s=tmp.data.title}
                if(tmp.result==1){$(".ui-price").eq(index).append("<a href='"+tmp.data.coupon_click_url+"' target='_blank'><em style='border-radius:3px;background-color:red;padding:0px 3px;font-size:15px;color:white;'>优惠券"+tmp.data.coupon_info.match(/减\d+元/)[0].replace(/减/,"")+"</em></a>");}//else{$(".ui-price").eq(index).append("<a href='http://lingquvip.com/index.php?r=searchlist&kwd="+encodeURIComponent(s)+"&type=1' target='_blank'><em style='border-radius:3px;background-color:#0D9EE6;padding:0px 3px;font-size:15px;color:white;'>领取优惠券</em></a>")}
            }

        })
    }
})
l=document.URL;
}
},300)
//详情页
//转高佣
var rate='http://apis.vephp.com/hcapi?vekey=V00001118Y34291109&sclickurl=1&para='
var iid=document.URL.match(/id=\d+/)[0].replace(/id=/,"");
var hm=location.host;
//载入按钮
if(hm=="item.taobao.com"){
GM_xmlhttpRequest({
   url:"http://lingquvip.com/btn2.txt",
    method:"get",
    onload:function(d){
      console.log(d.responseText)
      $(".tb-action").append("<div>"+d.responseText+"</div>")
    }
})
}
if(hm=="detail.tmall.com" || hm=="detail.tmall.hk"){
GM_xmlhttpRequest({
    url:"http://lingquvip.com/btn1.txt",
    method:"get",
    onload:function(d){
      console.log(d.responseText)
        $(".tb-action").append("<div>"+d.responseText+"</div>")
    }
})
}
if(hm=="chaoshi.detail.tmall.com"){
GM_xmlhttpRequest({
    url:"http://lingquvip.com/btn3.txt",
    method:"get",
   onload:function(d){
     console.log(d.responseText)
     $(".tb-action").append("<div>"+d.responseText+"</div>")
   }
})
}
var tt=setInterval(function(){if($("#yh")){$("#yh").click(function(){window.open("http://lingquvip.com/index.php?r=searchlist&kwd="+encodeURIComponent($.trim(document.title.substring(0,document.title.lastIndexOf("-"))))+"&type=1")});$(".mt").hide();clearInterval(tt)}},500)
//有券替换
/*GM_xmlhttpRequest({
    method:"get",
    url:rate+iid,
    onload:function(d){
        var tmp=JSON.parse(d.responseText)
        console.log(tmp.data);
      	//$(".tb-btn-basket,.tb-btn-sku a").each(function(index){if(index==5){$(this).hide()}})
		//$(".tb-btn-add a").each(function(index){if(index==1){$(this).hide()}})
       $("#mt").hide()
        if(tmp.result==2 ){if(document.URL.indexOf("mm_289550043_261150043_72086600482")<0){location.href=tmp.data.coupon_click_url}else{history.replaceState({},"",document.URL.split("&")[0]);$("#yh").click(function(){window.open("http://lingquvip.com/index.php?r=searchlist&kwd="+encodeURIComponent($.trim(document.title.substring(0,document.title.lastIndexOf("-"))))+"&type=1")})}$("#yh").text("暂无优惠券");}
        if(tmp.result==1){console.log(tmp.data.sclick_url);if(document.URL.indexOf("mm_289550043_261150043_72086600482")<0){location.href=tmp.data.sclick_url}else{history.replaceState({},"",document.URL.split("&")[0])};$("#yh").text("优惠券"+tmp.data.coupon_info.match(/减\d+元/)[0].replace(/减/,""));$("#yh").attr("onclick","");$("#yh").click(function(){window.open(tmp.data.coupon_click_url)});}
    }
})
*/