python的飞信发送类

pyfetionpyfetionpyfetion参照着php版的接口写的 目前测试使用没问题,预留了保存cookie和token的功能,可以减少几次请求,以后慢慢加吧! 目前给自己发通知还是妥妥的。

January 31, 2015 · 1 min · Me

模拟登录联通10010.com查询宽带余额

家里的宽带是包年按天扣费,时间长了就忘了改什么时候续费了。 抽时间写了个模拟登录10010.com的脚本,自动查询余额。 每天中午12点查一次,省得下次又欠费了。 模拟登录的过程很简单,获取查询的cookie需要两步请求,拿到cookie后可以随意查询。 有TX想看源码么? 已贴源码 #!/usr/bin/env python # encoding: utf-8 """ @version: 0.2 @author: phpergao @license: Apache Licence @contact: endoffight@gmail.com @site: http://www.phpgao.com @software: PyCharm @file: 10010.py @time: 15-1-3 下午6:06 一键查询联通宽带余额 """ import urllib2 import cookielib import json class Crawl(): def __init__(self, username, passwd, debug=False): (self.username, self.passwd) = (username, passwd) self.cookie = cookielib.CookieJar() cookieHandler = urllib2.HTTPCookieProcessor(self.cookie) self.is_debug = debug if self.is_debug: httpHandler = urllib2.HTTPHandler(debuglevel=1) httpsHandler = urllib2.HTTPSHandler(debuglevel=1) opener = urllib2.build_opener(cookieHandler, httpHandler, httpsHandler) else: opener = urllib2....

January 6, 2015 · 2 min · Me