通过curl命令发布微博

获得access token需要下面两步:
1> 在浏览器上获得code
          https://api.weibo.com/oauth2/authorize?client_id=568220280&redirect_uri=https://api.weibo.com/oauth2/default.html&response_type=code
        在打开的页面上输入用户名和密码,点授权按钮。
获得的code 在地址栏中,如下:https://api.weibo.com/oauth2/default.html? code=d9412acdd7e1a9c60b8c84892d7e80ce

  2> 在终端输入如下命令获得access token
          curl -d "client_id=568220280&client_secret=56114b682ef16f47fe2d6d46 7381ba5c&grant_type=authorization_code& code=d9412acdd7e1a9c60b8c84892d7e80ce&redirect_uri=https://api.weibo.com/oauth2/default.html" "https://api.weibo.com/oauth2/access_token"



curl -k -F access_token=2.00hone4D0ODM9ccc404334c137PJFB -F status=testing -F visible=0 -F pic=@/home/zhanglanyue/tmp/test.jpg https://upload.api.weibo.com/2/statuses/upload.json
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值