// ==UserScript== // @name ! 超简洁的网购省钱小助手,自动显示京东、淘宝、聚划算、天猫隐藏优惠券与历史价格。简洁无广告,一目了然,让您告别虚假降价。持续维护中... // @name:zh ! 超简洁的网购省钱小助手,自动显示京东、淘宝、聚划算、天猫隐藏优惠券与历史价格。简洁无广告,一目了然,让您告别虚假降价。持续维护中... // @name:zh-TW ! 超簡潔的網購省錢小助手,自動顯示京東、淘寶、聚劃算、天貓隱藏優惠券與歷史價格。簡潔無廣告,一目了然,讓您告別虛假降價。持續維護中... // @namespace http://shop.xuelg.com // @version 2.0.0 // @description 或许是最简洁好用的购物小助手啦~ 自动显示京东(jd.com)、淘宝(taobao.com)、天猫(tmall.com)、聚划算、天猫超市、天猫国际(tmall.hk)、京东国际(jd.hk)、京东图书、京东大药房(yiyaojd.com)隐藏优惠券与历史价格。不止让您省钱开心购物,更可以告别虚假降价,以最优惠的价格,把宝贝抱回家。 // @description:zh 或許是最簡潔好用的購物小助手啦~ 自動顯示京東(jd.com)、淘寶(taobao.com)、天貓(tmall.com)、聚劃算、天貓超市、天貓國際(tmall.hk)、京東國際(jd.hk)、京東圖書、京東大藥房(yiyaojd.com)隱藏優惠券與歷史價格。不止讓您省錢開心購物,更可以告別虛假降價,以最優惠的價格,把寶貝抱回家。 // @description:zh-TW 或許是最簡潔好用的購物小助手啦~ 自動顯示京東(jd.com)、淘寶(taobao.com)、天貓(tmall.com)、聚劃算、天貓超市、天貓國際(tmall.hk)、京東國際(jd.hk)、京東圖書、京東大藥房(yiyaojd.com)隱藏優惠券與歷史價格。不止讓您省錢開心購物,更可以告別虛假降價,以最優惠的價格,把寶貝抱回家。 // @author 血莲 // @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/* // @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 【应GreasyFork代码规范要求:含有优惠券查询功能的脚本必须添加此提示!在此感谢大家的理解...】 // @grant unsafeWindow // @downloadURL none // ==/UserScript== (function() { 'use strict'; var style = document.createElement('link'); style.href = 'https://cdn.xuelg.com/shop/style.css'; style.rel = 'stylesheet'; style.type = 'text/css'; document.getElementsByTagName('head').item(0).appendChild(style); var apijiekou = 'https://api.shop.xuelg.com/'; var url = location.href; 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 } $.get(apijiekou+'?id='+QueryString("id"),function(data) { console.log(data); var yhq = '
优惠券 ' + data.coupon_amount + '元
' + data.coupon_info + '
'+ '立即领取
优惠券截止时间:' + data.coupon_end_time + ' 剩余:'+ data.coupon_remain_count +'张
'; var wyh = '
未查询到优惠券
' + data.qun + '
'+ '搜索类似商品
'; var lsj = '
历史最低价:' + data.zuidijia + '元 历史高最价:'+ data.zuigaojia +'元(仅供参考)
'; var ewm = '

使用淘宝APP扫码领取优惠券

'; if (url.indexOf('//detail.tmall.') != -1 || url.indexOf('//chaoshi.detail.tmall.') != -1) { if (data.coupon_amount && data.zuidijia) { $('.tm-fcs-panel').after(yhq + lsj + ewm); } else if (data.coupon_amount) { $('.tm-fcs-panel').after(yhq + ewm); } else if (data.zuidijia) { if (url.indexOf(data.sign) != -1 || data.urltz == null) { $('.tm-fcs-panel').after(wyh + lsj); } else { window.location.replace(data.urltz); } } else { if (url.indexOf(data.sign) != -1 || data.urltz == null) { $('.tm-fcs-panel').after(wyh); } else { window.location.replace(data.urltz); } } } else { if (data.coupon_amount && data.zuidijia) { $('ul.tb-meta').after(yhq + lsj + ewm); } else if (data.coupon_amount) { $('ul.tb-meta').after(yhq + ewm); } else if (data.zuidijia) { if (url.indexOf(data.sign) != -1 || data.urltz == null) { $('ul.tb-meta').after(wyh + lsj); } else { window.location.replace(data.urltz); } } else { if (url.indexOf(data.sign) != -1 || data.urltz == null) { $('ul.tb-meta').after(wyh); } else { window.location.replace(data.urltz); } } } $("#qrcode").qrcode({ width:156, height:156, text:data.shorturl }) }) } 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) { $.get(apijiekou+'jd/?url='+url,function(data) { console.log(data); var yhq = '
优惠券 ' + data.coupon_money + '元
' + data.coupon_info + '
'+ '立即领取
优惠券截止时间:' + data.coupon_final + '
'; var wyh = '
未查询到优惠券
' + data.qun + '
'+ '搜索相关优惠
'; var ewm = '

使用京东APP扫码领取优惠券

'; if (data.coupon_money) { $('.summary-top').after(yhq + ewm); } else { if (url.indexOf(data.sign) != -1) { $('.summary-top').after(wyh); }else { window.location.replace(data.urltz); } } $("#qrcode").qrcode({ width:156, height:156, text:data.shortURL }) }) } else { var objs = {}; objs.initSearchItem = function (selector) { var $this = $(selector); if ($this.hasClass("tb-cool-box-already")) { return; } else { $this.addClass("tb-cool-box-already") } var nid = $this.attr("data-id"); if (!nid || parseInt(nid) != nid || nid <= 10000) { nid = $this.attr("data-itemid"); } if (!nid || parseInt(nid) != nid || nid <= 10000) { if ($this.attr("href")) { nid = location.protocol + $this.attr("href"); } else { var $tma = $this.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 ssqun = '' 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) { $this.append(ssqun); } } else if (nid) { $this.append(ssqun); } }; objs.basicQueryItem = function (selector) { var $this = $(selector); $this.removeClass("tb-cool-box-wait"); var nid = $this.attr("data-nid"); $.get(apijiekou+'?id='+nid,function(data) { if (data.coupon_amount) { $this.html('有券(减' + data.coupon_amount + '元)'); } else { $this.addClass("tb-cool-box-info-translucent"); $this.html('暂无优惠'); } }) }; var selectorList = []; if (url.indexOf("//s.taobao.com/search") > 0 || url.indexOf("//s.taobao.com/list") > 0) { selectorList.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) { selectorList.push(".product"); selectorList.push(".chaoshi-recommend-list .chaoshi-recommend-item"); } else if (url.indexOf("//list.tmall.hk/search_product.htm") > 0) { selectorList.push("#J_ItemList .product"); } else if (document.getElementById('J_ShopSearchResult')) { selectorList.push("#J_ShopSearchResult .item"); } if (selectorList && selectorList.length > 0) { setInterval(function () { selectorList.forEach(function (selector) { $(selector).each(function () { objs.initSearchItem(this); }); }); }, 1500); $(document).on("click", ".tb-cool-box-area", function () { var $this = $(this); if ($this.hasClass("tb-cool-box-wait")) { objs.basicQueryItem(this); } else if ($this.hasClass("tb-cool-box-info-translucent")) { $this.removeClass("tb-cool-box-info-translucent"); } else { $this.addClass("tb-cool-box-info-translucent"); } }); setInterval(function () { $(".tb-cool-box-wait").each(function () { objs.basicQueryItem(this); }); }, 1500); } } })();