PageSourceSearch

http://stat.xywy.com/a.js

js xywy.com collected 2026-10-02 07:56:50 UTC 16,122 bytes, 398 lines download raw bytes

1function recordVisitLink(link, action, category, position) {
2    try {
3        new Image().src = "http://stat-y.xywy.com/club_click.png?k=" + category + "&p=" + position + "&num=" + Math.random();
4        if (link.target == '_blank')
5            setTimeout("window.open('" + link.href + "')", 100);
6        else
7            setTimeout('document.location = "' + link.href + '"', 100);
8    } catch (err) {
9    }
10}
11
12function recordVisitLinks(link, action, category, position) {
13    try {
14        new Image().src = "http://stat-y.xywy.com/club_click.png?k=" + category + "&p=" + position + "&num=" + Math.random();
15    } catch (err) {
16    }
17}
18
19(function() {
20    /* cookieдÈë */
21    function __setCookie(key, val, cotp) {
22        var _date = new Date();
23        var _year = _date.getFullYear();
24        var _day = _date.getDate();
25        var _cookie = "";
26
27        switch (cotp){
28            case 0:
29                _cookie = key + "=" + escape(val) + ";";
30                break;
31            case 1:
32                _date.setDate(_day + 1);
33                _date.setHours(0);
34                _date.setMinutes(0);
35                _date.setSeconds(0);
36                _cookie = key + "=" + escape(val) + ";expires=" + _date.toGMTString() + ";";
37                break;
38            case 2:
39                _date.setYear(_year + 10);
40                _cookie = key + "=" + escape(val) + ";expires=" + _date.toGMTString() + ";";
41                break;
42        }
43
44        var _domain = __getDomain(document.domain == "mipcache.bdstatic.com" ? "xywy.com" : document.domain);
45        if (_domain != "")
46            _cookie += "domain=." + _domain + ";";
47
48        _cookie += "path=" + "/;";
49        document.cookie = _cookie;
50    }
51
52    /* cookie¶ÁÈ¡ */
53    function __getCookie(key) {
54        var _cookie = document.cookie;
55        if (_cookie.length <= 0)
56            return "";
57
58        var _key = key + "=";
59        var _begin = _cookie.indexOf(_key);
60        if (_begin < 0)
61            return "";
62
63        _begin += _key.length;
64        var _end = _cookie.indexOf(";", _begin);
65        if (_end < 0) {
66            return unescape(_cookie.substring(_begin));
67        } else {
68            return unescape(_cookie.substring(_begin, _end));
69        }
70    }
71
72    /* Ò»¼¶ÓòÃû½ØÈ¡Ïà¹Ø */
73    function __ctryTopDomain(str) {
74        var pattern = /^aero$|^cat$|^coop$|^int$|^museum$|^pro$|^travel$|^xxx$|^com$|^net$|^gov$|^org$|^mil$|^edu$|^biz$|^info$|^name$|^ac$|^mil$|^co$|^ed$|^gv$|^nt$|^bj$|^hz$|^sh$|^tj$|^cq$|^he$|^nm$|^ln$|^jl$|^hl$|^js$|^zj$|^ah$|^hb$|^hn$|^gd$|^gx$|^hi$|^sc$|^gz$|^yn$|^xz$|^sn$|^gs$|^qh$|^nx$|^xj$|^tw$|^hk$|^mo$|^fj$|^ha$|^jx$|^sd$|^sx$/i;
75        if (str.match(pattern)) {
76            return 1;
77        }
78        return 0;
79    }
80
81    function __ctryDomain(str) {
82        var pattern = /^a[cdefgilmnoqrstuwz]$|^b[abdefghijmorstvwyz]$|^c[acdfghiklmnorsuvxyz]$|^d[ejkmoz]$|^e[ceghrstu]$|^f[ijkmor]$|^ly$|^h[kmnrtu]$|^i[delmnorst]$|^j[emop]$|^k[eghimnprwyz]$|^l[abcikrstuvy]$|^g[abdefghilmnpqrstuwy]$|^m[acdghklmnopqrstuvwxyz]$|^n[acefgilopruz]$|^om$|^r[eouw]$|^p[aefghklmrstwy]$|^qa$|^w[fs]$|^s[abcdeghijklmnortuvyz]$|^t[cdfhgjkmnoprtvwz]$|^u[agkmsyz]$|^v[aceginu]$|^y[etu]$|^z[amrw]$/i;
83        if (str.match(pattern)) {
84            return 1;
85        }
86        return 0;
87    }
88
89    function __getDomain(host) {
90        var _domain = host;
91        var _domainArray = _domain.split(".");
92        var _length = _domainArray.length;
93        var _ipRes;
94
95        if (_length < 3)
96            return _domain;
97
98        _ipRes = /^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})){3}$/;
99        if (host.match(_ipRes))
100            return _domain;//lt than 4 and digital, return all
101
102        if (__ctryTopDomain(_domainArray[_length - 2]) && __ctryDomain(_domainArray[_length - 1]) ) {
103            _domain = _domainArray[_length - 3] + "." + _domainArray[_length - 2] + "." + _domainArray[_length - 1];
104        } else {
105            _domain = _domainArray[_length - 2] + "." + _domainArray[_length - 1];
106        }
107        return _domain;
108    }
109
110
111    /* »ñÈ¡ÒýÓÃʱµÄ²ÎÊý */
112    /* ÔÚÒýÓñêÇ©ÉÏÌí¼Ódata-iptÊôÐÔ,²ÎÊýΪҪ´«ÈëµÄÊý¾Ý¡£Àý:<script type="text/javascript" src="htt**\/a.js?key=value&key2=value"></script> */
113    function getInputPara(){
114        var tempObj = {};
115        var tempArr = [];
116        var dataScript = document.getElementsByTagName('script');
117        var data_temp;
118		
119        for(var i=0;i < dataScript.length;i++){
120            if(dataScript[i].getAttribute('src') != undefined && dataScript[i].getAttribute('src') != null && dataScript[i].getAttribute('src').toString().indexOf('stat.xywy.
120com/a.js') > -1 ){
121            data_temp = dataScript[i]
122            .getAttribute('src')
123            .split('?')[1];
124            break;
125            }
126        }
127        
128        if (!data_temp)
129            return {};
130
131        tempArr = data_temp.split('&');
132        for (var i = 0;i < tempArr.length;i++){
133            if (!(tempArr[i] && tempArr[i].split('=')[0] && tempArr[i].split('=')[1]))
134                continue;
135
136            tempObj[tempArr[i].split('=')[0]] = tempArr[i].split('=')[1];
137        }
138
139        return tempObj
140    }
141
142    /* ͳ¼Æ´úÂëÖØ¸´²¿Êð¼ì²â */
143    function duplicateDetect(){
144        var scripts = document.getElementsByTagName('script');
145        var j = 0;
146        for(var i=0;i < scripts.length;i++){
147            if(scripts[i].getAttribute('src') != undefined && scripts[i].getAttribute('src') != null && scripts[i].getAttribute('src').toString().indexOf('stat.xywy.com/a.js') > -1 ){
148                j++;
149            }
150        }
151        return j > 1 ? true : false;
152    }
153
154    /* ¶¯Ì¬´´½¨iframe,½â¾ö¿çÓòʱ²»ÄÜÅжÏcookieΪͬһÓû§µÄÎÊÌâ */
155    function sendAc(data){
156        var mipUrl = document.URL;
157        var oIframe = document.createElement('iframe');
158        var url = 'https://stat.xywy.com/cross_domain.html';
159        if(mipUrl.indexOf('mipcache.bdstatic.com') > -1){
160            if (typeof url !== 'undefined') {
161                oIframe.name = '__XYWY__';
162                oIframe.style.display = 'none';
163                oIframe.src = url + '?clientId=' + data + '&t=' + new Date().getTime();
164                document.body.appendChild(oIframe);
165            }
166        }
167    }
168	function setCz(cn, cv, ds) {
169	    var d = new Date();
170	    d.setTime(d.getTime() + (ds*24*60*60*1000));
171	    var expires = "expires="+d.toUTCString();
172	    document.cookie = cn + "=" + cv + "; " + expires;
173	}
174	function clrCz(){
175		var ack = document.cookie.split(";");  
176		for (var i = 0; i < ack.length; i++) {  
177			var cnm = ack[i].split("=");
178			if(cnm[0].toString().trim().indexOf('CNZZDATA')==0){
179				setCz(cnm[0].toString().trim(), "", -1);
180			}
181		}
182	}
183	clrCz();
184    try{
185        /* Èç¹ûûÓÐÖØ¸´,´¦ÀíÏà¹ØÐÅÏ¢ */
186        if (!duplicateDetect()){ 
187            var requestColumn = [],
188                ac_location = document.location.href;
189
190            //param²ÎÊý´¦Àí
191            var dataIptObj = getInputPara();
192            var paramTemp;
193            if (dataIptObj.param){
194                paramTemp = dataIptObj.param.split(',');
195                for (var i = 0;i < paramTemp.length;i++){
196                    if (paramTemp[i]){
197                        requestColumn.push('param' + (i+1) + '=' + paramTemp[i]);
198                    }else{
199                        requestColumn.push('param' + (i+1) + '=');
200                    }
201                }
202            }
203            if (dataIptObj.projectid)
204                requestColumn.push('projectid=' + dataIptObj.projectid);
205
206            var ref = document.referrer,
207                redomain = "";
208            if (ref) {
209                var redomains = ref.match(/http[s]?:\/\/(.*?)([:\/]|$)/i);
210                redomain = redomains[1];
211                requestColumn.push('ref=' + encodeURIComponent(ref));
212                requestColumn.push('redoman=' + redomain);
213            }
214
215            var clientId = "",
216                date = new Date();
217            if (__getCookie('clientac')) {
218                sendAc(__getCookie('clientac')); //´«Èëclientac
219                clientId = __getCookie('clientac');
220            }else{
221                var rmu = String(parseInt(Math.random() * 1000000));
222                if(rmu.length < 6){
223                    for (var rmul = rmu.length; rmul < 6; rmul++) {
224                        rmu += "0"
225                    }
226                }
227                clientId = date.getTime() + rmu;
228                sendAc(clientId); //´«Èëclientac
229                __setCookie('clientac', clientId, 2);
230                //½«clientID´æÈëcookieÖÐ ²ÎÊýÃûΪacÖÐ  ²»ÔÚÓÃclientID×÷Ϊ¼üÖµ´æ´¢
231            }
232            requestColumn.push('clientID=' + (clientId+'clientID'));
233
234            //sessionÐÅÏ¢
235            var dataSessionStr = __getCookie('ajsDataSession');
236            var cookieSessionStrA = [];
237            var expireTime = 1800;
238            var sessionId = "";
239            var sessionNumber = 1;
240            var timeTemp = parseInt(date.getTime() / 1000);
241            var isHistory = "true";
242            var history = window.history.length;
243            var lastHistory = -1;
244            var lastUrl = __getCookie('xywylastUrl');
245            var lastRef = __getCookie('xywylastRef');
246            if (dataSessionStr == "") {
247                isHistory = "false";
248                sessionNumber = 1;
249                //sessionId ¼ÆË㷽ʽ´ý¶¨
250                sessionId = date.getTime() + String(parseInt(Math.random() * 1250)) + String(parseInt(Math.random() * 2500));
251            } else {
252                var arr = dataSessionStr.split("@");
253                var sessionTimeTemp = parseInt(arr[2]);
254                lastHistory = parseInt(arr[3]);
255                if (timeTemp - sessionTimeTemp > expireTime) {
256                    isHistory = "false";
257                    sessionNumber = 1;
258                    //sessionId ¼ÆË㷽ʽ´ý¶¨
259                    sessionId = date.getTime() + String(parseInt(Math.random() * 1250)) + String(parseInt(Math.random() * 2500));
260                } else {
261                    sessionId = arr[0];
262                    sessionNumber = parseInt(arr[1]) + 1;
263                    if (history != lastHistory) {
264                        isHistory = "false";
265                    } else if (document.referrer == lastRef && document.location.href != lastUrl) {
266                        isHistory = "false";
267                    }
268                }
269            }
270            requestColumn.push('SessionId=' + sessionId);
271            requestColumn.push('SessionNumber=' + sessionNumber);
272            requestColumn.push('History=' + String(history));
273            requestColumn.push('IsHistory=' + isHistory);
274            cookieSessionStrA.push(sessionId);
275            cookieSessionStrA.push(sessionNumber);
276            cookieSessionStrA.push(String(timeTemp));
277            if (history == 1 || isHistory == "false") {
278                cookieSessionStrA.push(String(history));
279                __setCookie('xywylastUrl',encodeURIComponent(document.location.href),0);
280                __setCookie('xywylastRef',encodeURIComponent(document.referrer),0);
281
282            } else {
283                cookieSessionStrA.push(String(lastHistory));
284                __setCookie('xywylastUrl',lastUrl,0);
285                __setCookie('xywylastRef',lastRef,0);
286            }
287            __setCookie('ajsDataSession',cookieSessionStrA.join('@'),0);
288
289            //subject_pid, subjectûÓÐȡֵ
290            var pid = 0,
291                sid = 0;
292            if (typeof (subject_pid) == 'number') {
293                pid = subject_pid;
294            } else if (typeof (subject_pid) != 'undefined') {
295                if (Number(subject_pid) >= 0)
296                    pid = Number(subject_pid);
297            }
298            if (typeof (subject) == 'number') {
299                sid = subject;
300            } else if (typeof (subject) != 'undefined') {
301                if (Number(subject) >= 0)
302                    sid = Number(subject);
303            }
304            requestColumn.push('Pid=' + (pid + 'Pid'));
305            requestColumn.push('Sid=' + (sid + 'Sid'));
306
307            /** ´¦ÀíÓû§id **/
308            var _loginId = "",
309                userType = "";
310            if (__getCookie("cookie_user") != "")
311                _loginId = __getCookie("cookie_user");
312            if (__getCookie("cookie_usertype") != "")
313                userType = __getCookie("cookie_usertype");
314            requestColumn.push('LoginID=' + _loginId);
315            requestColumn.push('usertype=' + userType);
316            /** ´¦ÀíÓû§id½áÊø  **/
317
318            /* Ìí¼Óµ±Ç°url */
319            requestColumn.push('AcT=' + encodeURIComponent(ac_location) + 'AcT');
320
321            /* Ìí¼ÓÈÕÖ¾ÀàÐͲÎÊý */
322            requestColumn.push('clickType=' + 0);
323
324            /* É豸ÐÅÏ¢ */
325            var title = document.title;
326            requestColumn.push('title=' + encodeURIComponent(title));
327            /** È¡²ÎÊý½áÊø **/
328
329            /* ´¦Àícookie´æ´¢ËÑË÷´ÊµÄÎÊÌâtitle */
330            var wd ="",
331                rd="";
332            /* ûÓлñÈ¡wd,rdµÄ²Ù×÷ */
333            if(wd != ""){
334                __setCookie('cookie_wd',wd,2);
335                __setCookie('cookie_wd_redoman',rd,2)
336            }
337            requestColumn.push('cookie_wd=' + __getCookie('cookie_wd')+'cookie_wd');
338            requestColumn.push('cookie_wd_redoman=' + __getCookie('cookie_wd_redoman')+'cookie_wd_redoman');
339            requestColumn.push('tempid=' + Math.random());
340
341            requestColumn.push('wd=' + encodeURIComponent(wd));//´Ë´¦¿ÉÄÜÓëcookie_wdÖØ¸´?
342            requestColumn.push('Tkt=' + (Math.round(date.getTime() / 1000) + "Tkt"));
343
344            /* ¼Ç¼²¢´¦ÀíÐÂÀϷÿÍcookie */
345            /* ¼ÆËãÓû§·ÃÎʵÄÈÕÆÚ ÒÔÌìΪµ¥Î» */
346            /* Óû§·ÃÎÊÍøÕ¾µÄÈÕÆÚΪ¿Õ ˵Ã÷֮ǰûÓдæ¹ýÕâ¸öcookie ÄÇôÕâÊÇÒ»¸öзÿÍ
347            /* ÈôÒѾ­¼Ç¼ÁË·ÃÎÊÍøÕ¾µÄÈÕÆÚ ÄÇôÐèÒª±È½Ïһϵ±Ç°ÈÕÆÚºÍÕâ¸öÈÕÆÚ Èç¹û²»ÊÇͬһÌì ˵Ã÷ÊÇÀÏ·Ã¿Í Èç¹ûÊÇÒ»Ìì ˵Ã÷ÊÇÐÂ·Ã¿Í */
348            var vd_day = new Date(),
349                vd_dt = vd_day.getFullYear() + '-' + vd_day.getMonth() + '-' + vd_day.getDate();
350            if(!__getCookie('visit_dt')){
351                __setCookie('visit_dt', vd_dt, 2);
352                requestColumn.push('isNew_User=' + 'trueisNew_User');
353            }else{
354                if(__getCookie('visit_dt') == vd_dt){
355                    requestColumn.push('isNew_User=' + 'trueisNew_User');
356                }else{
357                    requestColumn.push('isNew_User=' + 'falseisNew_User');
358                }
359            }
360            /**  ´Ë²¿·Ö½áÊø **/
361
362            /** ´¦Àí¶ñÒâˢРµ¼ÖÂpvͳ¼Æ²»×¼µÄÎÊÌâ ¸ù¾ÝcookieÖд¢´æµÄÉÏÒ»¸öÇëÇóºÍÇëÇóʱ¼ä ÅжÏÊÇ·ñÐèÒª·¢³öz.pngÇëÇó **/
363
364            var canSendZpng = true,
365                tjLastUrl = __getCookie("tj_lastUrl"),
366                tjLastUrlTime = __getCookie("tj_lastUrl_time");
367            if(tjLastUrl && (ac_location == tjLastUrl) && tjLastUrlTime){
368                /*var offset = parseInt(new Date().getTime()) - parseInt(tjLastUrlTime);
369                if((document.location.host == 'm.so.xywy.com' || document.location.host == 'so.xywy.com') && parseInt(offset) < 10000){
370                    canSendZpng = false;
371                }else if(parseInt(offset) < 120000){
372                    canSendZpng = false;
373                }*/
374            }
375            /* ¼ÇÔØ·ÃÎÊurlºÍʱ¼ä */
376            __setCookie('tj_lastUrl',ac_location, 2);
377            __setCookie('tj_lastUrl_time',new Date().getTime(), 2);
378
379            /** ´¦ÀíÍê±Ï **/
380            if(canSendZpng){
381                var img = new Image;
382                var protocol = 'http';
383                if (document.location.protocol.match(/https/)){
384                    protocol = 'https';
385                }
386                img.src = protocol + ":\/\/stat-y.xywy.com\/z0.1.png?" + requestColumn.join('&');
387            }
388
389            //console.log(requestColumn.join('&'));
390        } 
391    }catch(err){
392            console.log(err);
393            /*
394            var img = new Image;
395            img.src = "http:\/\/stat-y.xywy.com\/vperr.png?msg=" + err.message + "&ErrRandomNum=" + Math.random() + "&" + requestColumn.join('&');
396            */
397    }
398})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.