广发DIY签帐有货监控JS脚本

提示状态比较简明了,看图就能懂
步骤:
1、chrome或者360极速浏览器打开签帐页面:
https://shop.cgbchina.com.cn/mall/goods/03140714143403208122?itemCode=03140714143403208122
2、F12,console控制台粘贴以下代码,回车,允许通知权限,然后就可去浏览其他线报了,任何界面都可弹出通知
(一分钟检测一次)

效果:

var myajax=(function($){var Ajax=function(){this.$=$;this.headers={}};Ajax.prototype.addHeader=function(obj){for(var i in obj){this.headers[i]=obj[i]}return this};Ajax.prototype.removeHeader=function(key){delete this.headers[key];return this};Ajax.prototype.removeAllHeader=function(){this.headers={};return this};Ajax.prototype.get=function(url,data,succCallback,dataType,failCallback,middleware){dataType=dataType||"json";failCallback=failCallback||myajax.defaultFailCallback;middleware=middleware||myajax.defaultMiddleware;var opts={url:url,type:"GET",dataType:dataType,data:data};exec(opts,middleware,succCallback,failCallback);return this};Ajax.prototype.post=function(url,data,succCallback,dataType,failCallback,middleware){dataType=dataType||"json";failCallback=failCallback||myajax.defaultFailCallback;middleware=middleware||myajax.defaultMiddleware;var opts={url:url,type:"POST",dataType:dataType,data:data};exec(opts,middleware,succCallback,failCallback);return this};Ajax.prototype.file=function(url,data,succCallback,dataType,failCallback,middleware){dataType=dataType||"json";failCallback=failCallback||myajax.defaultFailCallback;middleware=middleware||myajax.defaultMiddleware;var opts={url:url,type:"POST",dataType:dataType,data:data,processData:false,contentType:false};exec(opts,middleware,succCallback,failCallback);return this};var exec=function(opts,middleware,succCallback,failCallback){opts.success=function(data){middleware&&middleware(data);succCallback&&succCallback(data)};opts.error=function(data){failCallback&&failCallback()};opts["headers"]=myajax.headers;myajax.$.ajax(opts)};return new Ajax()})(window.Zepto||jQuery);myajax.defaultFailCallback=function(){};myajax.defaultMiddleware=function(){};var timeUtil={parseTime:function(format,timeStamp){var date=new Date(timeStamp||Date.now()),o={"M+":date.getMonth()+1,"D+":date.getDate(),"h+":date.getHours(),"m+":date.getMinutes(),"s+":date.getSeconds(),"S":date.getMilliseconds()},format=format||"YYYY-MM-DD hh:mm:ss";if(/(Y+)/.test(format)){format=format.replace(RegExp.$1,(date.getFullYear()+"").substr(4-RegExp.$1.length))}for(var k in o){if(new RegExp("("+k+")").test(format)){format=format.replace(RegExp.$1,RegExp.$1.length==1?o[k]:("00"+o[k]).substr((""+o[k]).length))}}return format},getTimeShow:function(time_str){var now=new Date();var date=new Date(time_str);var inter=parseInt((now.getTime()-date.getTime())/1000/60);if(inter==0){return"刚刚"}else{if(inter<60){return inter.toString()+"分钟前"}else{if(inter<60*24){return parseInt(inter/60).toString()+"小时前"}else{if(now.getFullYear()==date.getFullYear()){return this.parseTime("MM-DD hh:mm:ss",time_str)}else{return this.parseTime("YY-MM-DD hh:mm:ss",time_str)}}}}}};const interval=1000*60*1;const url='https://shop.cgbchina.com.cn/mall/goods/03140714143403208122?itemCode=03140714143403208122';function show_notification(title,content){if(window.Notification){var popNotice=function(){if(Notification.permission=="granted"){var notification=new Notification(title,{body:content,icon:'https://pic.downk.cc/item/5e0b280a76085c328908f140.jpg'});notification.onclick=function(){notification.close()}}};if(Notification.permission=="granted"){popNotice()}else if(Notification.permission!="denied"){Notification.requestPermission(function(permission){popNotice()})}}else{console.error('浏览器不支持Notification')}}let interval_id=0;function run(){myajax.get(url,{},(data)=>{let index=data.indexOf('icon-item-state icon-sold-out stock-zero-img');if(index<=0){show_notification('签账单有货了','只要撸不死,就要往死里撸!')}else{console.log('无货',timeUtil.parseTime('YY-MM-DD hh:mm:ss',Date.now()))}},'text')}if(window.Notification)Notification.requestPermission();interval_id=setInterval(()=>{run()},interval);if(interval_id){show_notification('看到我,表示启动成功')}

原创文章,作者:智享谷,如若转载,请注明出处:http://www.weilaigu.cn/381.html

发表评论

电子邮件地址不会被公开。 必填项已用*标注

联系我们

400-800-8888

在线咨询:点击这里给我发消息

邮件:admin@weilaigu.cn

工作时间:周一至周五,9:30-18:30,节假日休息

QR code