文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>curl & python 更新新浪微博

curl & python 更新新浪微博

时间:2010-10-12  来源:酷酷的小鱼儿

利用curl 登录、更新新浪微博,用python包装为一个函数了。

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

相关阅读 更多 +
排行榜 更多 +
幸运硬币官方正版下载

幸运硬币官方正版下载

休闲益智 下载
宝宝来找茬手机版 v9.86.00.00 安卓版

宝宝来找茬手机版 v9.86.00.00 安卓版

休闲益智 下载
翻滚飞机大战最新版 v1.0.4 安卓版

翻滚飞机大战最新版 v1.0.4 安卓版

飞行射击 下载