title | description | date | categories | slug | |
---|---|---|---|---|---|
QQ协议分析 |
QQ协议分析 |
2014-04-16 |
|
qq-protocol |
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
from selenium import webdriver | |
from selenium.webdriver import DesiredCapabilities | |
desired_capabilities = DesiredCapabilities.PHANTOMJS.copy() | |
desired_capabilities['phantomjs.page.customHeaders.User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) ' \ | |
'AppleWebKit/537.36 (KHTML, like Gecko) ' \ | |
'Chrome/39.0.2171.95 Safari/537.36' | |
driver = webdriver.PhantomJS(desired_capabilities=desired_capabilities) |
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
// For node-mongodb-native (npm install mongodb) | |
var mongodb = require('mongodb'); | |
var MongoTransaction = function(db) { | |
this.db = db; | |
this.queue = []; | |
this.running = false; | |
this.failureFn = function(){}; | |
} |
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
#!flask/bin/python | |
from flask import Flask, jsonify, abort, request, make_response, url_for | |
from flask.ext.httpauth import HTTPBasicAuth | |
app = Flask(__name__, static_url_path = "") | |
auth = HTTPBasicAuth() | |
@auth.get_password | |
def get_password(username): | |
if username == 'fk': |