curl & python 更新新浪微博
2010-10-12 20:04
281 查看
利用curl 登录、更新新浪微博,用python包装为一个函数了。
整理自:http://isouth.org/archives/277.html
def main(user, pwd, message): try: cmd = 'curl -k -c sina.txt "https://login.sina.com.cn/sso/login.php?username=%s&password=%s&returntype=TEXT"' % (user, pwd) os.system( cmd) cmd = 'curl -e "http://t.sina.com.cn/" -b sina.txt -d "content=%s" "http://t.sina.com.cn/mblog/publish.php" ' % message os.system(cmd) os.system('rm sina.txt') print '\nsend msg ok\n' except Exception, e: print e
整理自:http://isouth.org/archives/277.html
相关文章推荐
- <PY>Python扩展包安装方法(待更新)
- Python之路Python3【第零篇】Python2 & Python3区别持续更新~
- jenkins 使用 curl 触发 jenkins 编译 & 自动从ftp上下载更新程序库
- python 可迭代对象之(列表解析,迭代器迭代) =>持续更新
- 解决多个版本的python共存时的问题 => 持续更新
- python 检索文件资源的方法 =>长期更新
- xcode更新到5.1,"__curl_rule_01__' declared as an array with a negative size"
- mac下更新pip时提示OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip-8.0.2-py2.
- python2《=》python3 某些库函数互相转换的个人总结 =>持续更新
- Let's-python视频教程发布专贴(更新下载方式: 纳米,电驴,迅雷快传)(2012年10月07日更新纳米部分资源)
- python脚本语言实现hosts自动更新
- 【leetcode】633. Sum of Square Numbers(Python & C++)
- python伪代码之爬取秒贷金融p2p信息运行代码持续更新:【内向即废物--沈吟秋】
- Google's Python Class(六)——Python 正则表达式
- 查看python,numpy,scipy,matplotlib的版本及版本更新
- 【Python】【Error】syntaxerror non-ascii character ' xb4' in file
- 【原创】python filter函数
- python3之socket&socketserver网络编程