提交 | 用户 | age
|
4a551f
|
1 |
<!DOCTYPE html > |
a6a76f
|
2 |
<!-- saved from url=(0052)http://weibo.com/aj/static/sync.html?t=1397014439311 --> |
F |
3 |
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=GBK"> |
|
4 |
<title>sina sync page</title> |
|
5 |
</head> |
|
6 |
<body> |
|
7 |
<script type="text/javascript"> |
|
8 |
var dre = 'http://weibo.com/login?url='; |
|
9 |
var reg_sina = /^http\:\/\/login\.sina\.com\.cn/i; |
|
10 |
|
|
11 |
var regs = {}; |
|
12 |
regs['baidu'] = /^http\:\/\/cpro\.baidu\.com/i; |
|
13 |
regs['yunyun'] = /^http:\/\/(.+\.)?yunyun\.com/i; |
|
14 |
|
|
15 |
var to_website_url = {}; |
|
16 |
to_website_url['baidu'] = 'http://cpro.baidu.com/cpro/ui/html/sync.htm'; |
|
17 |
to_website_url['yunyun'] = 'https://passport.yunyun.com/WeiboSync.php'; |
|
18 |
|
|
19 |
var getCookie = function(sKey) { |
|
20 |
sKey = sKey.replace(/([\.\[\]\$])/g, '\\\$1'); |
|
21 |
var rep = new RegExp(sKey + '=([^;]*)?;', 'i'); |
|
22 |
var co = document.cookie + ';'; |
|
23 |
var res = co.match(rep); |
|
24 |
if (res) { |
|
25 |
return res[1] || ""; |
|
26 |
} else { |
|
27 |
return ''; |
|
28 |
} |
|
29 |
}; |
|
30 |
|
|
31 |
var checkReferrer = function(fromURL) { |
|
32 |
fromURL = fromURL || ''; |
|
33 |
var is_trust = false; |
|
34 |
for(var reg in regs){ |
|
35 |
if(regs[reg].test(document.referrer)){ |
|
36 |
is_trust = true; |
|
37 |
} |
|
38 |
} |
|
39 |
if(fromURL == 'sina' && !is_trust && reg_sina.test(document.referrer)){ |
|
40 |
is_trust = true; |
|
41 |
} |
|
42 |
return is_trust; |
|
43 |
}; |
|
44 |
|
|
45 |
var fromWebSite = function() { |
|
46 |
for(var reg in regs){ |
|
47 |
if(regs[reg].test(document.referrer)){ |
|
48 |
return reg; |
|
49 |
} |
|
50 |
} |
|
51 |
return ''; |
|
52 |
}; |
|
53 |
|
|
54 |
var suda = function(url) { |
|
55 |
if(1 === (Math.random()*1000 | 0)){ |
|
56 |
document.body.appendChild(document.createElement('img')).src = url + '&_t=' + (+new Date()); |
|
57 |
} |
|
58 |
}; |
|
59 |
|
|
60 |
;(function(){ |
|
61 |
if (checkReferrer('sina')) { |
|
62 |
var uid = decodeURIComponent(getCookie('SUP')).match( |
|
63 |
/uid\=([0-9]+)/i); |
|
64 |
uid = (uid && uid[1]) || ''; |
|
65 |
if (!uid) { |
|
66 |
uid = getCookie('myuid') || ''; |
|
67 |
} |
|
68 |
if (!uid && getCookie('ALF') && fromWebSite()) { |
|
69 |
var thisURL = location.href; |
|
70 |
//如果自动登录 会多传___ALF=1 |
|
71 |
location.href = dre + thisURL + (/\?/.test(thisURL)?'&':'?') + 'from=' + fromWebSite() + '&___ALF=1'; |
|
72 |
return; |
|
73 |
} |
|
74 |
if (uid) { |
|
75 |
suda('http://beacon.sina.com.cn/e.gif?h=1');//如果成功的suda |
|
76 |
var from = location.href.match(/[\&|\?]from\=([a-z]+)$/i); |
|
77 |
from = (from && from[1]) || fromWebSite() || ''; |
|
78 |
if(from && to_website_url[from]){ |
|
79 |
location.href = to_website_url[from] + '?sid=' + uid + '&t=' |
|
80 |
+ (new Date()).getTime(); |
|
81 |
} |
|
82 |
} else { |
|
83 |
suda('http://beacon.sina.com.cn/e.gif?h=0');//如果失败的suda |
|
84 |
} |
|
85 |
} |
|
86 |
})(); |
|
87 |
</script> |
|
88 |
|
|
89 |
|
|
90 |
</body></html> |