Greasy Fork is available in English.
单纯优惠券领取插件,购物省钱持家好助手,自动显示淘宝天猫、京东、拼多多、聚划算、国际频道、图书、大药房隐藏优惠券,让您购物省钱少花费,注意本插件会对商品地址进行转换,但不会造成安全问题,双方互惠的,你购买商品我获得一点推广收入。无法接受请不要使用,毕竟维护、服务器也需要成本
当前为
// ==UserScript==
// @name 获取淘宝天猫、京东、拼多多等隐藏优惠券。单纯优惠券领取脚本,无广告。让你购物实实在在省钱。支持三网搜券!
// @namespace https://tk.xunhuo.vip
// @version 1.51
// @description 单纯优惠券领取插件,购物省钱持家好助手,自动显示淘宝天猫、京东、拼多多、聚划算、国际频道、图书、大药房隐藏优惠券,让您购物省钱少花费,注意本插件会对商品地址进行转换,但不会造成安全问题,双方互惠的,你购买商品我获得一点推广收入。无法接受请不要使用,毕竟维护、服务器也需要成本
// @icon https://tk.xunhuo.vip/favicon.ico
// @author 寻货购物
// @connect xunhuo.vip
// @match *.taobao.com/*
// @match *.tmall.com/*
// @match *chaoshi.detail.tmall.com/*
// @match *.tmall.hk/*
// @match *.liangxinyao.com/*
// @match *.jd.com/*
// @match *.jd.hk/*
// @match *.yiyaojd.com/*
// @exclude *login.taobao.com/*
// @exclude *uland.taobao.com/*
// @exclude *pages.tmall.com/*
// @homepageURL https://tk.xunhuo.vip/?id=24557
// @require https://cdn.bootcdn.net/ajax/libs/jquery/1.8.3/jquery.min.js
// @require https://cdn.bootcdn.net/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js
// @antifeature referral-link 【本优惠券查询脚本将会对商品地址进行转换,但不会自动进行转跳,需自己点击领取或转跳,便不会隐私泄漏或支付安全等问题,请放心使用...】
// @grant unsafeWindow
// ==/UserScript==
(function() {
'use strict';
var style = document.createElement('link');
style.href = 'https://tb.xunhuo.vip/api/style.css';
style.rel = 'stylesheet';
style.type = 'text/css';
document.getElementsByTagName('head').item(0).appendChild(style);
var api = 'https://tb.xunhuo.vip/api/tb.php';
var url = location.href;
var name = $(document).attr('title');//$('input[name=title]').attr('value');
var biaoti = name.split('-');
var tbname = $('.tb-main-title').attr('data-title');
var so="https://tk.xunhuo.vip/m/item/list_s_super.aspx?id=24557&keyword=";
var maapi="https://api.qrserver.com/v1/create-qr-code/?data=";
//天猫
if (url.indexOf("//item.taobao.com/item.htm") > 0 || url.indexOf("//detail.tmall.com/item.htm") > 0 || url.indexOf("//chaoshi.detail.tmall.com/item.htm") > 0 || url.indexOf("//detail.tmall.hk/hk/item.htm") > 0 || url.indexOf("//detail.tmall.hk/item.htm") > 0) {
function QueryString(item)
{
var sValue=location.search.match(new RegExp("[\?\&]"+item+"=([^\&]*)(\&?)","i"))
return sValue?sValue[1]:sValue
}
$.getJSON(api+'?id='+QueryString("id"),function(data) {
console.log(data);
var mm ='mm_';
var quan = '<div class="coupon-wrap"><div class="coupon"><div class="coupon-info"><div class="coupon-desc">优惠券 ' + data.data.coupon_amount + '元</div><div class="coupon-info2">' + data.data.coupon_info + '</div></div>'+
'<a class="coupon-get" href="' + data.data.coupon_click_url + '">立即领取</a></div><div class="coupon-time">优惠券截止时间:' + data.data.coupon_end_time + ' <b>剩余:'+ data.data.coupon_total_count +'张</b></div>';
var wuquan = '<div class="coupon-wrap"><div class="coupon"><div class="coupon-info"><div class="coupon-desc">无优惠券</div><div class="coupon-info2">支持我们,<a target="blank" href="' + data.data.coupon_short_url + '">请点这里购买</a></div></div>'+
'<a class="coupon-get" target="blank" href="' + so +''+ encodeURI(biaoti[0]) +'">搜索类似商品</a></div>';
var wuyouhui = '<div class="coupon-wrap"><div class="coupon"><div class="coupon-info"><div class="coupon-desc">未查询到优惠券</div><div class="coupon-info2">本商品没有优惠,请尝试搜索</div></div>'+
'<a class="coupon-get" target="blank" href="' + so +''+ encodeURI(biaoti[0]) +'">搜索类似商品</a></div>';
var jiage = '<div class="coupon-time"><b>历史最低价:' + data.data.zuidijia + '元</b> 历史高最价:'+ data.data.zuigaojia +'元(仅供参考)</div>';
var saoma = '<div id="qrcode" style="position: fixed;bottom: 10px;right:35px;z-index: 9999;"><p class="coupon-time"><b>手机扫码领取优惠券</b></p></div>';
var taobao = '<div class="tb-btn-buy" style="padding-top:10px;"><a href="https://tk.xunhuo.vip/api_gaoyong_url_m.aspx?id=24557&type=0&type2=0&code='+ QueryString("id") +'" title="进入后请选择浏览器打开" target="_blank">领取优惠券</a></div><div class="tb-btn-add" style="padding-top:10px;"><a href="https://tk.xunhuo.vip/m/item/list_s_super.aspx?id=24557&sid=&relationId=&keyword='+ encodeURI(biaoti[0]) +'" title="搜索全部宝贝,如果想要搜索到更多商品,请修改搜索关键字,尽量简短,因为很多商家为了做优化添加了很多无用的词,造成无法搜索到更多商品。!" target="_blank">全网搜券</a></div>';
var taobao2 = '<div class="tb-btn-buy" style="padding-top:10px;"><a href="https://tk.xunhuo.vip/jiudianjiu.aspx?id=24557" target="_blank">九块九包邮</a></div><div class="tb-btn-add" style="padding-top:10px;"><a href="https://tk.xunhuo.vip/jingxuan.aspx?id=24557" target="_blank">每日精选</a></div>';
//var taobao2 = '<div class="tb-btn-buy" style="padding-top:10px;"><a href="https://m.tb.cn/h.4uPNe5e?sm=76cd28 " title="每天可领取三次" target="_blank">淘宝618红包领取</a></div><div class="tb-btn-add" style="padding-top:10px;"><a href="https://u.jd.com/8zqcZ0E" title="每天可领取三次" target="_blank">京东618红包领取</a></div>';
var taobao3 = '<div class="tb-btn-buy" style="padding-top:10px;"><a href="https://jk.xunhuo.vip/?ah=total&kw='+ encodeURI(biaoti[0]) +'" target="_blank" title="搜索京东有优惠券的商品,请自行输入关键字,尽量简短。">京东搜索</a></div><div class="tb-btn-add" style="padding-top:10px;"><a href="https://gouwu.xunhuo.vip/?cid=sUMNV07a#/search?pt=1&keyword='+ encodeURI(biaoti[0]) +'" target="_blank" title="搜索不到或商品较少,请自行修改关键字,尽量简短。">拼多多搜索</a></div>';
var taobao4 = '<div class="xunhuo" style="padding-top: 250px;"><a class="xunhuoapp" href="javascript:" role="button" data-spm-anchor-id="a220o.1000855.0.0"><img class="xunhuoapp qrcode" src="https://tvax1.sinaimg.cn/large/63953719gy1ggbgh6ripyj208c08c749.jpg" alt="领券版app">领券版app下载</a></div>';
var taobao5 = '<div class="xunhuo" style="padding-top: 20px;"><a class="xunhuoapp" href="javascript:"><img class="xunhuoapp qrcode" src="https://api.qrserver.com/v1/create-qr-code/?data='+ encodeURIComponent(so) +''+ encodeURI(biaoti[0]) +'" ><p style="color: #F40;">扫码领券</p></a><a class="xunhuoapp" href="javascript:"><img class="xunhuoapp qrcode" src="https://api.qrserver.com/v1/create-qr-code/?data=https://tk.xunhuo.vip/m/?id=24557" >手机网页领券版(扫码后,保存书签)</a></div>';
var tmall = '<div class="tb-btn-buy tb-btn-sku" style="padding-top:10px;"><a href="https://tk.xunhuo.vip/m/item/list_s_super.aspx?id=24557&keyword='+ QueryString("id") +'" title="进入后请选择浏览器打开" target="_blank">领取优惠券</a></div><div class="tb-btn-basket tb-btn-sku" style="padding-top:10px;"><a href="https://tk.xunhuo.vip/m/item/list_s_super.aspx?id=24557&sid=&relationId=&keyword='+ encodeURI(biaoti[0]) +'" title="点这里可以搜索全部店铺相同名称的全部宝贝,如果想要搜索到更多商品,请修改搜索关键字,尽量简短,因为很多商家为了做优化添加了很多无用的词,造成无法搜索到更多商品。!" target="_blank">全网搜券</a></div>';
//var tmall2 = '<div class="tb-btn-buy tb-btn-sku" style="padding-top:10px;"><a href="https://m.tb.cn/h.4uPNe5e?sm=76cd28 " title="每天可领取三次" target="_blank">淘宝618红包领取</a></div><div class="tb-btn-basket tb-btn-sku" style="padding-top:10px;"><a href="https://u.jd.com/8zqcZ0E" title="每天可领取三次" target="_blank">京东618红包领取</a></div>';
var tmall2 = '<div class="tb-btn-buy tb-btn-sku" style="padding-top:10px;"><a href="https://tk.xunhuo.vip/jiudianjiu.aspx?id=24557" target="_blank">九块九包邮</a></div><div class="tb-btn-basket tb-btn-sku" style="padding-top:10px;"><a href="https://tk.xunhuo.vip/jingxuan.aspx?id=24557" target="_blank">每日精选</a></div>';
var tmall3 = '<div class="tb-btn-buy tb-btn-sku" style="padding-top:10px;"><a href="https://jk.xunhuo.vip/?ah=total&kw='+ encodeURI(biaoti[0]) +'" target="_blank" title="搜索京东有优惠券的商品,请自行输入关键字,尽量简短。">京东搜索</a></div><div class="tb-btn-basket tb-btn-sku" style="padding-top:10px;"><a href="https://gouwu.xunhuo.vip/?cid=sUMNV07a#/search?pt=1&keyword='+ encodeURI(biaoti[0]) +'" target="_blank" title="搜索不到或商品较少,请自行修改关键字,尽量简短。">拼多多搜索</a></div>';
var tmall4 = '<div style="padding-top: 250px;"><a class="xunhuoapp" href="javascript:"><img class="xunhuoapp qrcode" src="https://api.qrserver.com/v1/create-qr-code/?data=https://tb.xunhuo.vip/app_download/" alt="领券版app">领券版app下载</a></div>';
var tmall5 = '<a class="xunhuoapp" href="https://api.qrserver.com/v1/create-qr-code/?data=https://m.tb.cn/h.4G3mvez?sm=b55619" target="_blank" title="活动互助,点击后手淘扫码">618超级星秀猫互助群</a><br/><a class="xunhuoapp" href="javascript:"><img class="xunhuoapp qrcode" src="https://api.qrserver.com/v1/create-qr-code/?data='+ encodeURIComponent(so) +''+ encodeURI(biaoti[0]) +'" >扫码领券</a><br/><a class="xunhuoapp" href="javascript:"><img class="xunhuoapp qrcode" src="https://api.qrserver.com/v1/create-qr-code/?data=https://tk.xunhuo.vip/m/?id=24557" >手机网页领券版(扫码后,保存书签)</a>';
if (url.indexOf('//detail.tmall.') != -1 || url.indexOf('//chaoshi.detail.tmall.') != -1) {
if (data.data.coupon_amount && data.data.zuidijia) {
$('.tm-fcs-panel').after(quan + jiage + saoma);
} else if (data.data.coupon_amount) {
$('.tm-fcs-panel').after(quan + saoma);
$('.tb-action').append(tmall + tmall2 + tmall3 + tmall4);
} else if (data.data.zuidijia) {
if (data.data.coupon_amount == '' || data.data.status_code == 1) {
$('.tm-fcs-panel').after(wuquan + jiage);
} else {
window.location.replace(data.data.coupon_short_urls);
}
} else {
if (data.data.coupon_click_url || data.data.status_code == 200) {
$('.tm-fcs-panel').after(wuquan);
$('.tb-action').append(tmall + tmall2 + tmall3 + tmall4);
} else {
if (data.data == '' || data.data.status_code == 1)
{
$('.tm-fcs-panel').after(wuyouhui);
$('.tb-action').append(tmall + tmall2 + tmall3 + tmall4);
}
//window.location.replace(data.data.coupon_short_url);
}
}
}
//淘宝市集
else {
if (data.data.coupon_amount && data.data.zuidijia) {
$('ul.tb-meta').after(quan + jiage + saoma);
}
else if (data.data.coupon_amount) {
$('ul.tb-meta').after(quan + saoma);
$('.tb-action').append(taobao + taobao2 + taobao3 + taobao4);
} else if (data.data.zuidijia) {
if (data.data.coupon_amount == '' || data.data.error_response.code == 15) {
$('ul.tb-meta').after(wuquan + jiage);
} else {
// window.location.replace(data.data.coupon_short_url);
}
} else{
if (data.data.coupon_click_url || data.data.status_code == 200) {
$('ul.tb-meta').after(wuquan);
$('.tb-action').append(taobao + taobao2 + taobao3 + taobao4);
} else {
if (data.data == '' || data.data.status_code == 1) {
$('ul.tb-meta').after(wuyouhui);
$('.tb-action').append(taobao + taobao2 + taobao3 + taobao4);
}
//window.location.replace(data.data.coupon_short_url);
}
}
}
$("#qrcode").qrcode({
width:156,
height:156,
text:'https://tk.xunhuo.vip/api_gaoyong_url.aspx?id=24557&code='+QueryString("id")
})
})
}
//京东
else if (url.indexOf("//item.jd.com/") > 0 || url.indexOf("//npcitem.jd.hk/") > 0 || url.indexOf("//item.yiyaojd.com/") > 0 || url.indexOf("//pcitem.jd.hk/") > 0 || url.indexOf("//pro.jd.com/") > 0 || url.indexOf("//pro.m.jd.com/") > 0 || url.indexOf("//story.m.jd.com/") > 0 || url.indexOf("//prodev.m.jd.com/") > 0 || url.indexOf("//prodev.jd.com/") > 0) {
var sojd='http://jk.xunhuo.vip/?ah=total&kw=';
var id=window.location.pathname;
id = id.split("/")[1];
id = id.split(".html")[0];
name = $('meta[name=keywords]').attr('content');
$.getJSON('https://tb.xunhuo.vip/api/jd.php?id='+id,function(data) {
console.log(data);
var quan = '<div class="coupon-wrap"><div class="coupon"><div class="coupon-info"><div class="coupon-desc">优惠券 ' + data.data.discount + '元</div><div class="coupon-info2"></div></div>'+
'<a class="coupon-get" href="' + data.data.couponurl + '">立即领取</a></div><div class="coupon-time"></div>';
var wuquan = '<div class="coupon-wrap"><div class="coupon"><div class="coupon-info"><div class="coupon-desc">无优惠券,支持我们请点下方</div><div class="coupon-info2"><a href="https://jk.xunhuo.vip/?ah=detail&id=' + id + '">点我购买</a></div></div>'+
'<a class="coupon-get" target="blank" href="' + sojd + '' + data.data.goods_name + '">搜索类似商品</a></div>';
var saoma = '<div id="qrcode" style="position: fixed;bottom: 3px;right:39px;z-index: 9999;"><p class="coupon-time"><b>使用手机扫码领取优惠券</b></p></div>';
var jd = '<a href="https://jk.xunhuo.vip/?ah=detail&id='+ encodeURI(id) +'" class="btn-special2 btn-lg" style="margin-right: 10px;" target="_blank">领取优惠券</a>';
var jd2 = '<a href="http://jk.xunhuo.vip/?ah=total&kw=' + data.data.goods_name + '" class="btn-special2 btn-lg" style="margin-right: 10px;" title="搜索全网有优惠券的商品,请自行输入关键字,尽量简短。" target="_blank">京东全网搜索</a>';
var jd3 = '<a href="https://tk.xunhuo.vip/m/index_super.aspx?id=24557&keyword=' + data.data.goods_name + '" class="btn-special2 btn-lg" title="搜索淘宝有优惠券的商品,请自行输入关键字,尽量简短。" target="_blank">淘宝搜索</a>';
var jd4 = '<a href="https://youhui.pinduoduo.com/search/landing?keyword=' + data.data.goods_name + '&pid=1687692_15178080&cpsSign=CM_200617_1687692_15178080_73246e704c0b4a7cc45c9fbf914dc98c&duoduo_type=2" class="btn-special2 btn-lg" style="margin-right: 10px; margin-top: 10px;" title="搜索拼多多有优惠券的商品,请复制标题或自行输入关键字,尽量简短。" target="_blank">拼多多搜索</a>';
//var jd5 = '<a href="https://m.tb.cn/h.4uPNe5e?sm=76cd28 " class="btn-special2 btn-lg" style="margin-right: 10px;" target="_blank">淘宝618超级红包</a>';
//var jd6 = '<a href="https://u.jd.com/8zqcZ0E" title="每天可领取三次" class="btn-special2 btn-lg" style="margin-top: 10px;" target="_blank">618红包领取</a>';
if (data.data.discount) {
$('.summary-top').after(quan + saoma);
$('div#choose-btns').after(jd + jd2 + jd3 + jd4);
} else {
if (data.data.discount ==0 || data.status_code ==-200) {
$('.summary-top').after(wuquan);
$('div#choose-btns').after(jd + jd2 + jd3 + jd4);
}else {
//window.location.replace();
}
}
$("#qrcode").qrcode({
width:156,
height:156,
text:'https://jk.xunhuo.vip/?ah=detail&id='+id
})
})
}
else {
var jc = {};
jc.initSearchItem = function (selector) {
var $tmthis = $(selector);
if ($tmthis.hasClass("tb-cool-box-already")) {
return;
} else {
$tmthis.addClass("tb-cool-box-already")
}
var nid = $tmthis.attr("data-id");
if (!nid || parseInt(nid) != nid || nid <= 10000) {
nid = $tmthis.attr("data-itemid");
}
if (!nid || parseInt(nid) != nid || nid <= 10000) {
if ($tmthis.attr("href")) {
nid = location.protocol + $tmthis.attr("href");
} else {
var $tma = $tmthis.find("a");
if (!$tma.length) {
return;
}
nid = $tma.attr("data-nid");
if (!nid || parseInt(nid) != nid || nid <= 10000) {
if ($tma.hasClass("j_ReceiveCoupon") && $tma.length > 1) {
nid = location.protocol + $($tma[1]).attr("href");
} else {
nid = location.protocol + $tma.attr("href");
}
}
}
}
//淘宝搜
var soquan = '<div class="tb-cool-box-area tb-cool-box-wait" data-nid="' + nid + '"><a class="tb-cool-box-info tb-cool-box-info-default" title="点击查询">待查询</a></div>'
if (nid.indexOf('http') >= 0) {
if (nid.indexOf("//detail.ju.taobao.com/home.htm") > 0 || nid.indexOf("//item.taobao.com/item.htm") > 0 || nid.indexOf("//detail.tmall.com/item.htm") > 0 || nid.indexOf("//chaoshi.detail.tmall.com/item.htm") > 0 || nid.indexOf("//detail.tmall.hk/hk/item.htm") > 0 || nid.indexOf("//detail.tmall.hk/item.htm") > 0) {
$tmthis.append(soquan);
}
} else if (nid) {
$tmthis.append(soquan);
}
};
jc.basicQueryItem = function (selector) {
var $tmthis = $(selector);
$tmthis.removeClass("tb-cool-box-wait");
var nid = $tmthis.attr("data-nid");
$.getJSON(api+'?id='+nid,function(data) {
if (data.data.coupon_amount) {
$tmthis.html('<a target="_blank" class="tb-cool-box-info tb-cool-box-info-find" title="隐藏">有优惠(减' + data.data.coupon_amount + '元)</a>');
} else {
$tmthis.addClass("tb-cool-box-info-translucent");
$tmthis.html('<a href="javascript:void(0);" class="tb-cool-box-info tb-cool-box-info-empty" title="隐藏">暂无优惠</a>');
}
})
};
var tmselectorList = [];
if (url.indexOf("//s.taobao.com/search") > 0 || url.indexOf("//s.taobao.com/list") > 0) {
tmselectorList.push(".items .item");
} else if (url.indexOf("//list.tmall.com/search_product.htm") > 0 || url.indexOf("//list.tmall.com//search_product.htm") > 0 || url.indexOf("//list.tmall.com/coudan/search_product.htm") > 0) {
tmselectorList.push(".product");
tmselectorList.push(".chaoshi-recommend-list .chaoshi-recommend-item");
} else if (url.indexOf("//list.tmall.hk/search_product.htm") > 0) {
tmselectorList.push("#J_ItemList .product");
} else if (document.getElementById('J_ShopSearchResult')) {
tmselectorList.push("#J_ShopSearchResult .item");
}
if (tmselectorList && tmselectorList.length > 0) {
setInterval(function () {
tmselectorList.forEach(function (selector) {
$(selector).each(function () {
jc.initSearchItem(this);
});
});
}, 1500);
$(document).on("click", ".tb-cool-box-area", function () {
var $tmthis = $(this);
if ($tmthis.hasClass("tb-cool-box-wait")) {
jc.basicQueryItem(this);
} else if ($tmthis.hasClass("tb-cool-box-info-translucent")) {
$tmthis.removeClass("tb-cool-box-info-translucent");
} else {
$tmthis.addClass("tb-cool-box-info-translucent");
}
});
setInterval(function () {
$(".tb-cool-box-wait").each(function () {
jc.basicQueryItem(this);
});
}, 1500);
}
}
})();