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
const http = require('http'); | |
const httpProxy = require('http-proxy'); | |
const port = 8128; | |
const username = 'username'; | |
const password = 'password'; | |
const authBuffer = Buffer.from(username + ':' + password, 'ascii'); | |
const authToken = 'Basic ' + authBuffer.toString('base64'); |
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 format url for phantom | |
* @author firedfox | |
*/ | |
/* | |
* format url before opened by a WebPage instance | |
* | |
* @param {string} url web page url | |
* @return {string} url formatted |
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
static function OnBeforeRequest(oSession: Session) { | |
if (oSession.HostnameIs("hm.baidu.com")) { oSession.host = "10.46.45.31:8001"; } | |
} |
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
/** | |
* @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
// example: | |
// phantomjs getComputedStyle.js "http://www.iqiyi.com/" ".usrTxGeneral-box_hover" "position,display,visibility,overflow" | |
var TIMEOUT = 60 * 1000; | |
var webPage = require('webpage'); | |
var system = require('system'); | |
var page = webPage.create(); | |
page.settings.loadImages = false; |
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
(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
// 默认广告配置 | |
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
/** | |
* 百度统计订单跟踪 | |
* | |
* 注意事项: | |
* 1. 页面需要安装百度统计的异步js代码,建议安装在页面顶部 </head> 标签之前,详情请参考获取代码页面的帮助信息。 | |
* 2. 调用订单跟踪接口的位置,要在百度统计异步js代码的后面,至少要在 var _hmt = _hmt || []; 语句之后。 | |
* 3. 所有字段名必须与示例中给出的名称保持字母和大小写完全一致。 | |
*/ | |
// 接口格式。 |