Skip to content

Instantly share code, notes, and snippets.

View hondajojo's full-sized avatar
🏠
Working from home

maijver hondajojo

🏠
Working from home
View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
#import pymongo
#import MySQLdb
@hondajojo
hondajojo / denglu.py
Created May 18, 2015 13:23
login-logout-signup by tornado
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import torndb
from tornado.options import define,options
@hondajojo
hondajojo / rmfy.py
Created May 19, 2015 07:47
法院链接
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
from pyquery import PyQuery as pq
class Rmfy(object):
def __init__(self):
self.origin_url = 'http://www.rmfysszc.gov.cn/'
self.province_url = {}
self.city_url = {}
@hondajojo
hondajojo / 0_reuse_code.js
Last active August 29, 2015 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hondajojo
hondajojo / python_resources.md
Last active August 29, 2015 14:21 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

#!/usr/bin/env python
# -*- coding:utf-8 -*-
from pyquery import PyQuery as pq
import requests
def get_full(short_url, page):
for i in xrange(page):
if i == 0:
url = "http://www.court.gov.cn/zgcpwsw/" + short_url + "/index.htm"
@hondajojo
hondajojo / json_to_python_object.py
Created July 30, 2015 11:45
json to python object
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# json to python object
# refer to https://gist.github.com/clowwindy/1699170
import json
import requests
class storge(object):
def __init__(self,dct):
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import requests
import urllib
import sys
import json
if len(sys.argv) == 2:
quote_url = urllib.quote_plus(sys.argv[-1])
@hondajojo
hondajojo / unquote.py
Last active September 10, 2015 03:08
handle non-standard implementations && handle url encode decode
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from urllib import unquote
def unquote_u(source):
result = unquote(source)
print result
if '%u' in result:
result = result.replace('%u','\\u').decode('unicode_escape')
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import requests
from pyquery import PyQuery as pq
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36',
'Origin': 'http://www.icbc.com.cn',
'Referer': 'http://www.icbc.com.cn/ICBCDynamicSite2/other/rmbdeposit.aspx',