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
# -*- coding: utf-8 -*- | |
import md5 | |
def md5_encode(str): | |
u""" | |
summary: | |
MD5 encode | |
author: | |
Jason Lee <[email protected]> | |
""" |
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
# -*- coding: utf-8 -*- | |
# ## ## ## ## ## ## ## ## ## | |
# upload file library | |
# ## ## ## ## ## ## ## ## ## | |
import sys,os | |
import time | |
from StringIO import StringIO | |
from PIL import Image | |
from tmitter.settings import * | |
import ImageFilter |
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
# -*- coding: utf-8 -*- | |
#!/usr/bin/python | |
import sqlite3,os,traceback | |
import re | |
# #################################### | |
# config | |
# #################################### |
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
#-*- coding: UTF-8 -*- | |
import flickr,image,imagecache | |
import urllib | |
from PIL import Image | |
import os | |
##### configs ###### | |
SEARCH_LIST_FNAME = './searchlist.txt' | |
PROXY_FNAME = './proxy.txt' |
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
# -*- coding: utf-8 -*- | |
from settings import * | |
import os,time,traceback | |
def write(ex): | |
""" | |
summary: | |
写日志,此功能主要是用于为方便记录运行期的错误,另外也可用做开发时的Ajax调试,为方便得到错误信息 | |
params: | |
ex 文本 或 traceback对象 |
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
import os,sys,urllib2 | |
PROXY_INFO = { | |
'user' : 'demo' , | |
'pass' : '123123' , | |
'host' : '192.168.1.104' , | |
'port' : 8080 | |
} | |
def load_url(url): |
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
# -*- coding: utf-8 -*- | |
#!/usr/bin/python | |
# This code is original from jsmin by Douglas Crockford, it was translated to | |
# Python by Baruch Even. The original code had the following copyright and | |
# license. | |
# | |
# /* jsmin.c | |
# 2007-05-22 | |
# |
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
# | |
# Ruby scrapi 采集口碑房源数据 | |
# Author: Huacnlee <[email protected]> | |
# Blog: http://huacnlee.com | |
# | |
# Gems install: | |
# sudo gem install scrapi | |
# | |
require 'rubygems' | |
require 'scrapi' |
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
/** | |
* 验证是否是一个数值型 | |
* 合法格式: 32位整型值 如1 52 5555 414 | |
*/ | |
String.prototype.isInt32 = function() { | |
var regex = new RegExp("^[\d]{1,32}$"); | |
return regex.exec(this); | |
} | |
/** |
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
/** | |
* 取得对向的大小和坐标 兼容多种浏览器 | |
* @param {Object} owner | |
*/ | |
var getPos = function(owner){ | |
if(owner == undefined){ | |
return {top : 0, left:0 , width : 0, height : 0}; | |
} | |
var e = owner; |
OlderNewer