parent
a55e307269
commit
345680903a
5 changed files with 74 additions and 1 deletions
@ -0,0 +1,47 @@ |
||||
|
||||
var __isCookie = 0; |
||||
|
||||
(function heartbeat_get() |
||||
{ |
||||
cookie.set("fp",fp); |
||||
cookie.set("fp_",fp); |
||||
$.post("https://log.yimian.xyz/heartbeat_get.php",{"ip":ip,"fp":fp,"city":ipCity},function(msg){ |
||||
|
||||
var obj = eval('(' + msg + ')'); |
||||
var arr=Object.keys(obj); |
||||
var t = Date.parse(new Date())/1000; |
||||
|
||||
if(t > obj.t && t < obj.t + 30) __isCookie = 1; |
||||
|
||||
for(var i = 0; i < arr.length; i++){ |
||||
|
||||
cookie.set(arr[i], obj[arr[i]]); |
||||
} |
||||
}); |
||||
})(); |
||||
|
||||
|
||||
(function heartbeat_log() |
||||
{ |
||||
setTimeout(function(){ |
||||
setInterval(function(){ |
||||
|
||||
if(__isCookie){ |
||||
var aCookie = document.cookie.split("; ");
|
||||
var obj = new Object(); |
||||
for(var i = 0; i < aCookie.length; i++){
|
||||
|
||||
var aCrumb = aCookie[i].split("=");
|
||||
obj[aCrumb[0]] = aCrumb[1]; |
||||
}
|
||||
|
||||
$.post("https://log.yimian.xyz/heartbeat.php",obj); |
||||
cookie.set('fp',fp); |
||||
} |
||||
},4000); |
||||
|
||||
},3000); |
||||
|
||||
})(); |
||||
|
||||
|
@ -0,0 +1,6 @@ |
||||
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script> |
||||
<script src="https://cdn.yimian.xyz/cookie/cookie.js"></script> |
||||
<script src="https://pv.sohu.com/cityjson?ie=utf-8"></script> |
||||
<script type="text/javascript">ip=returnCitySN.cip;ipCity=returnCitySN.cname;</script> |
||||
<script src="https://cdn.yimian.xyz/fp/fp.js"></script> |
||||
<script src="heartbeat.min.js"></script> |
@ -0,0 +1,8 @@ |
||||
<?php |
||||
include '../functions.php'; |
||||
|
||||
header("Access-Control-Allow-Origin: *"); |
||||
|
||||
$fp=$_REQUEST['fp']; |
||||
|
||||
echo json_encode(array("t1"=>"11","t2"=>"ee","t"=>time())); |
Loading…
Reference in new issue