Skip to content

Instantly share code, notes, and snippets.

@laomo
Created May 21, 2014 09:18
Show Gist options
  • Save laomo/c328834f23b26088b280 to your computer and use it in GitHub Desktop.
Save laomo/c328834f23b26088b280 to your computer and use it in GitHub Desktop.
一个利用飞信给自己发消息的脚本
#-*-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