PageSourceSearch

https://chinaguidedog.org/components/com_jwpagefactory/assets/js/statistics.js

js chinaguidedog.org collected 2026-10-02 20:21:14 UTC 3,630 bytes, 125 lines download raw bytes

1var jzt_url = window.location.hostname;
2var ishttps = ('https:' == document.location.protocol) ? 'https://': 'http://';
3var referrer = document.referrer;
4switch (jzt_url) {
5    case 'ijzt.china9.cn':
6        jzt_url = 'zhjzt.china9.cn';
7        break;
8    case 'jzt_dev_2.china9.cn':
9        jzt_url = 'jzt_dev_1.china9.cn';
10        break;
11    default :
12        jzt_url = 'zhjzt.china9.cn';
13        break;
14}
15function statistics() {
16    var url = window.location.hostname;
17    var fwtype = 1;
18    var fwleixing = 0;
19    console.log(referrer);
20    if (referrer.includes("www.google.")) {
21        fwtype = 3;
22        fwleixing = 2
23        console.log("访问来源是谷歌");
24    } else if (referrer.includes("www.baidu.")) {
25        fwtype = 3;
26        fwleixing = 1
27        console.log("访问来源是百度");
28    } else if (referrer.includes("cn.bing.")) {
29        fwtype = 3;
30        fwleixing = 3
31        console.log("访问来源是bing");
32    }else if (referrer.includes("www.sogou.")) {
33        fwtype = 3;
34        fwleixing = 5
35        console.log("访问来源是搜狗");
36    }else if (referrer.includes("www.so.")) {
37        fwtype = 3;
38        fwleixing = 4
39        console.log("访问来源是360");
40    } else {
41        console.log("访问来源不是百度或谷歌");
42    }
43    var shebei = detectDevice();
44    var statistics_f_id = getCookie('statistics_f_id')
45    console.log(shebei);
46    if (url != 'jzt_dev_2.china9.cn' && url != 'ijzt.china9.cn') {
47        var ip = '';
48        jQuery.get("https://api.china9.cn/api/getRealIpAddr", function(data) {
49            ip = data;
50            jQuery.post('https://zhjzt.china9.cn/api/statistics/submit', {'url': url,'ip':data,'path':window.location.pathname,'path_url':window.location.href,'shebei':shebei,'type':fwtype,'leixing':fwleixing,'id':statistics_f_id}, function (e) {
51                if(e.code == 200){
52                    if(!statistics_f_id)
53                    {
54                        setCookie('statistics_f_id',e.data)
55                        setCookie('statistics_c_id',e.data)
56                    }
57                    else
58                    {
59                        setCookie('statistics_c_id',e.data)
60                    }
61                }
62            });
63        });
64    }
65}
66if(jzt_url!='ijzt.china9.cn')
67{
68    statistics();
69}
70
71
72var url = window.location.hostname;
73function fetchData() 
74{
75    var statistics_c_id = getCookie('statistics_c_id')
76    jQuery.post('https://zhjzt.china9.cn/api/statistics/submittime', {'id':statistics_c_id}, function (e) {
77        
78    });
79}
80 
81// 设置定时器,每隔3000毫秒(3秒)调用一次fetchData函数
82if (url != 'ijzt.china9.cn' && url != 'ijzt.china9.cn')
83{
84    setInterval(fetchData, 6000);
85}
86
87function detectDevice() {
88    var userAgent = navigator.userAgent || navigator.vendor || window.opera;
89 
90    // 安卓手机
91    if (/android/i.test(userAgent)) {
92        return 2;
93    }
94 
95    // 苹果手机
96    if (/iPhone|iPad|iPod/i.test(userAgent)) {
97        return 3;
98    }
99 
100    // 平板设备,比如iPad
101    if (/iPad/i.test(userAgent)) {
102        return 4;
103    }
104 
105    // 检测Windows, Mac, Linux等PC系统
106    if (/Windows|Mac|Linux/i.test(userAgent)) {
107        return 1;
108    }
109 
110    // 其他设备或无法识别的设备
111    return 5;
112}
113
114function setCookie(cname,cvalue){
115    document.cookie = cname+"="+cvalue+";";
116}
117function getCookie(cname){
118    var name = cname + "=";
119    var ca = document.cookie.split(';');
120    for(var i=0; i<ca.length; i++) {
121        var c = ca[i].trim();
122        if (c.indexOf(name)==0) { return c.substring(name.length,c.length); }
123    }
124    return "";
125}

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.