zoukankan      html  css  js  c++  java
  • 百度统计中js获取SEO数据的代码

    var a = document;
    //var e = a.referrer;
    var e = 'http://www.google.com.hk/search?hl=zh-CN&newwindow=1&safe=strict&q=w3ctech&aq=f&aqi=&aql=&oq=';
    
    function f() {
    	this.tags = {};
    	this.clicks = [];
    	this.getSt()
    }
    f.prototype = {
    	sindex: [1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
    	sengin: ["baidu.com", "baidu.com", "google.com", "google.cn", "sogou.com", "zhongsou.com", "search.yahoo.com", "one.cn.yahoo.com", "soso.com", "114search.118114.cn", "search.live.com", "youdao.com", "gougou.com", "bing.com"],
    	sword: ["word", "wd", "q", "q", "query", "w", "p", "p", "w", "kw", "q", "q", "search", "q"],
    
    	getValue: function(m, n) {
    		var l = new RegExp("(^|&|\\?)" + m + "=([^&]*)(&|\x24|#)");
    		var k = n.match(l);
    		return k ? k[2] : ""
    	},
    
    	getSt: function() {
    		var x = null;
    		var k = e;
    		var w = this.sengin;
    		var u = this.sword;
    		var q = this.sindex;
    		for (var o = 0; o < w.length; o++) {
    			if ((k.indexOf(w[o]) > -1) && (this.getValue(u[o], k))) {
    				this.tags.sw = this.getValue(u[o], k);
    				this.tags.se = q[o];
    				this.tags.st = "2";
    				return;
    			}
    		}
    		return  this.tags;
    	}
    }
    var b = new f();
    alert(b.tags);
    for (var k in b.tags) {
    	alert(b.tags[k]);
    	
    }
    
  • 相关阅读:
    js学习
    console用法
    Oracle 数据库加密
    Oracle 内存结构
    Oracle 锁
    Oracle 索引
    怎么理解“平均负载”
    Oracle分区表
    Oracle 数据库表(常见的表)
    PostgreSQL 监控磁盘使用
  • 原文地址:https://www.cnblogs.com/greengnn/p/js_seo.html
Copyright © 2011-2022 走看看