Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pzzrudlf/b3c0d740ba0d8b0afce83879c2da21a6 to your computer and use it in GitHub Desktop.
Save pzzrudlf/b3c0d740ba0d8b0afce83879c2da21a6 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>数据加载中,请稍等...</title>
<script language="javascript">window.onerror = function(){return true;}</script>
<!-- <script type="text/javascript" src="./jquery.js"></script> -->
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<style type="text/css">
#show{width:400px; height: 50px; padding: 10px; border: 8px solid #E8E9F7; background-color: white; text-align:center; line-height:50px; vertical-align:middle; overflow:hidden; font-size:16px; margin:0 auto}
</style>
</head>
<body>
<div style=" margin:0 auto; text-align:center; padding:50px 0">
<div id="show">数据加载中,请稍等...</div>
</div>
<script language="javascript">
function get_et()
{
var s = new Date(),
l = +s / 1000 | 0,
r = s.getTimezoneOffset() * 60,
p = l + r,
m = p + (3600 * 8),
q = m.toString().substr(2, 8).split(""),
o = [6, 3, 7, 1, 5, 2, 0, 4],
n = [];
for (var k = 0; k < o.length; k++) {
n.push(q[o[k]])
}
n[2] = 9 - n[2];
n[4] = 9 - n[4];
n[5] = 9 - n[5];
return n.join("")
}
function setCookie(j, k)
{
document.cookie = j + "=" + encodeURIComponent(k.toString()) + "; path=/"
}
function getCookie(l)
{
var m = (" " + document.cookie).split(";"),
j = "";
for (var k = 0; k < m.length; k++) {
if (m[k].indexOf(" " + l + "=") === 0) {
j = decodeURIComponent(m[k].split("=")[1].toString());
break
}
}
return j
}
function get_pgid()
{
var l = "",
k = "",
n,
o,
t,
u,
s = location,
m = "",
q = Math;
function r(x, z) {
var y = "",
v = 1,
w;
v = Math.floor(x.length / z);
if (v == 1) {
y = x.substr(0, z)
} else {
for (w = 0; w < z; w++) {
y += x.substr(w * v, 1)
}
}
return y
}
n = (" " + document.cookie).split(";");
for (o = 0; o < n.length; o++) {
if (n[o].indexOf(" cna=") === 0) {
k = n[o].substr(5, 24);
break
}
}
if (k === "") {
cu = (s.search.length > 9) ? s.search: ((s.pathname.length > 9) ? s.pathname: s.href).substr(1);
n = document.cookie.split(";");
for (o = 0; o < n.length; o++) {
if (n[o].split("=").length > 1) {
m += n[o].split("=")[1]
}
}
if (m.length < 16) {
m += "abcdef0123456789"
}
k = r(cu, 8) + r(m, 16)
}
for (o = 1; o <= 32; o++) {
t = q.floor(q.random() * 16);
if (k && o <= k.length) {
u = k.charCodeAt(o - 1);
t = (t + u) % 16
}
l += t.toString(16)
}
setCookie('amvid', l);
var p = getCookie('amvid');
if (p) {
return p
}
return l
}
var click_url = 'http://item.taobao.com/item.htm?id=534023240120';
var pid = 'mm_30489462_15594116_59634901';
var wt = '0';
var ti = '625';
var tl = '230x45';
var rd = '1';
var ct = encodeURIComponent('itemid=534023240120');
var st = '2';
var rf = encodeURIComponent("http://aitiaotiao.com");
var et = get_et();
console.log(et);
var pgid = get_pgid();
console.log(pgid);
var v = '2.0';
$(function(){
var dd = 'pid='+pid+'&wt='+wt+'&ti='+ti+'&tl='+tl+'&rd='+rd+'&ct='+ct+'&st='+st+'&rf='+rf+'&et='+et+'&pgid='+pgid+'&v='+v;
console.log(dd);
$.ajax({
url: 'http://g.click.taobao.com/display?cb=?',
type: 'GET',
dataType: 'jsonp',
jsonp: 'cb',
data: dd,
success: function(msg) {
if(msg.code == 200)
{
console.log(msg.data.items[0].ds_item_click);
alert(msg.data.items[0].ds_item_click);debugger;
//document.location.href = msg.data.items[0].ds_item_click;
}
else
{
debugger;document.location.href = click_url;
}
},
error: function(msg){
debugger;document.location.href = click_url;
}
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment