利用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

相关文章:

  • 2021-04-14
  • 2021-07-22
  • 2021-07-15
  • 2021-11-17
  • 2021-11-27
  • 2022-01-19
  • 2021-09-08
  • 2021-07-12
猜你喜欢
  • 2022-01-14
  • 2021-12-25
  • 2022-02-21
  • 2021-05-26
  • 2021-11-26
  • 2021-09-09
  • 2022-12-23
相关资源
相似解决方案