Skip to content

Instantly share code, notes, and snippets.

@laomo
Created May 21, 2014
Embed
What would you like to do?
一个利用飞信给自己发消息的脚本
#-*-coding: utf-8 -*-
#!/usr/bin/python
import requests
def sendMsg(msg):
url_space_login = 'http://f.10086.cn/huc/user/space/login.do?m=submit&fr=space'
url_login = 'http://f.10086.cn/im/login/cklogin.action'
url_sendmsg = 'http://f.10086.cn/im/user/sendMsgToMyselfs.action'
parameter= { 'mobilenum':'yourmobile', 'password':'yourpassword'}
session = requests.Session()
session.post(url_space_login, data = parameter)
session.get(url_login)
session.post(url_sendmsg, data = {'msg':msg})
print 'send success !'
if __name__ == '__main__':
sendMsg('python send fetion')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment