This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
String HM_T_URL = "http://crs.baidu.com/s?siteId=b85f7b63582228b88367e25879c8ae89&planId=23"; | |
String HM_T_CHARSET = "utf-8"; | |
StringBuilder hm_t_html = new StringBuilder(); | |
try { | |
String referer = java.net.URLEncoder.encode(request.getHeader("Referer")); | |
java.net.URL url = new java.net.URL(HM_T_URL + "&referer=" + referer); | |
java.net.URLConnection connection = url.openConnection(); | |
connection.setConnectTimeout(5000); | |
connection.setReadTimeout(5000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 创建百度统计事件转化目标 | |
* | |
* 1. 首先确保在页面中已经给需要监控的元素都添加上了id。 | |
* 2. 在下列代码中的 name='';id='';url='' 单引号中间分别填入事件转化目标名称、元素id、页面URL。 | |
* 页面URL可以留空,表示该事件转化目标在全站都生效。 | |
* (例如 name='事件转化目标名称';id='some-id';url='http://some-site.com/some-page') | |
* 3. 在百度统计里进入”网站中心" -> "事件转化目标”页面,把上述修改好的代码粘贴到浏览器中,并按回车键。 | |
* (如果是Chrome/Firefox/IE9及以上版本浏览器,就粘贴到JS控制台里;如果是IE6/7/8浏览器,就粘贴到顶部地址栏里) | |
* 4. 如果提示”OK”,说明添加成功;如果出现其他提示,就说明出现了提示所指出的错误,请修改后重试。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#智能手机浏览器 | |
70 UCBrowser/9.2 | |
70 UCWEB9.2 | |
71 UCBrowser/9.3 | |
71 UCWEB9.3 | |
72 UCBrowser/9.4 | |
72 UCWEB9.4 | |
73 UCBrowser/9.5 | |
73 UCWEB9.5 | |
74 UCBrowser/9.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 百度统计订单跟踪 | |
* | |
* 注意事项: | |
* 1. 页面需要安装百度统计的异步js代码,建议安装在页面顶部 </head> 标签之前,详情请参考获取代码页面的帮助信息。 | |
* 2. 调用订单跟踪接口的位置,要在百度统计异步js代码的后面,至少要在 var _hmt = _hmt || []; 语句之后。 | |
* 3. 所有字段名必须与示例中给出的名称保持字母和大小写完全一致。 | |
*/ | |
// 接口格式。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 默认广告配置 | |
var CPRO_STYLE_API = { | |
"tn": "template_inlay_all_normal", // 模板 | |
"at": "text", // 物料类型 | |
"urlis": 0, // 是否显示广告链接 | |
"desis": 0, //是否显示主题标题描述词 | |
"consl": 0, //是否显示广告块LOGO | |
"titsu": 0, //是否显示文字下划线 | |
"titpl": 6, //广告块文字左填充值,右填充为titpr | |
"conpt": 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var on = function(elem, event, handler) { | |
if (elem.addEventListener) { | |
elem.addEventListener(event, handler, false); | |
} else if (elem.attachEvent) { | |
elem.attachEvent('on' + event, handler); | |
} | |
}; | |
var getAncestorByTag = function(element, tagName) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file trigger click on an element and capture the url | |
* @author wangyang02 | |
* | |
* @example | |
* phantomjs click.js https://www.baidu.com/ 'a[name=tj_trnews]' | |
* phantomjs click.js https://www.baidu.com/ '#su' | |
*/ | |
/* eslint-disable */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var PriorityQueue = require('bull/lib/priority-queue'); | |
var queue = new PriorityQueue('jobQueue', 6379, '127.0.0.1'); | |
var MAX = 10000; | |
var n = 0; | |
var addToQueue = function() { | |
queue.add( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TARGET_URL='http://hm.baidu.com/h.js?5bd903f7f409c54caa0df0909fbf2a76'; | |
TARGET_ETAG='cab267c293ff3512bd775692a76b1586'; | |
EXPECT_RESPONSE_STATUS='304 Not Modified'; | |
LOG_URL='http://q.hm.baidu.com/gfw-hijack-detector-server/log'; | |
CONNECT_TIMEOUT=30; | |
LOAD_MAX_TIME=60; | |
DETECT_TOTAL_COUNT=5; | |
DETECT_INTERVAL=10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isPicked = function(rate) { | |
var id = baidu.cookie.get('BAIDUID'); | |
if (!id) { return false; } | |
id = id.replace(/:.*/, ''); | |
for (var i = 0, l = id.length, sum = 0; i < l; i++) { | |
sum += id.charCodeAt(i); | |
} | |
return (sum % 100 < rate); | |
}; | |
if (isPicked(30)) { |
OlderNewer