做了一个weibo自动登陆,授权和获取token的php脚本

2013-02-04 19:45:31 +08:00
 RelativeLayout
想到weico每次添加账户不需要跳转到浏览器就行oauth授权,于是花了点儿时间做了个后台程序,实现了相同功能。

https://github.com/xuanqinanhai/weibo-simulator

求star,求fork,求pull request。

希望大家合力来支持更多平台。
5117 次点击
所在节点    程序员
6 条回复
RelativeLayout
2013-02-20 11:23:02 +08:00
难道真的没有人用的上么?
RelativeLayout
2013-02-20 11:25:24 +08:00
这次更新还添加了本地的Python认证,跳过了浏览器
xing393939
2013-02-20 13:23:23 +08:00
不是有验证码的吗
arzusyume
2013-02-20 13:27:39 +08:00
sina登录如果IP为国外或者user-agant里有奇怪的东西(比如sae)时,需要验证码。。。
RelativeLayout
2013-02-20 14:53:36 +08:00
@arzusyume 没有处理验证码诶。过两天处理验证码。
snnn
2014-05-22 00:18:34 +08:00
Gson gson = new Gson();
java.util.List<NameValuePair> formparams = new java.util.ArrayList<NameValuePair>();
formparams.add(new BasicNameValuePair("client_id", appid));
formparams.add(new BasicNameValuePair("client_secret", appkey));
formparams.add(new BasicNameValuePair("grant_type", "password"));
formparams.add(new BasicNameValuePair("username", username));
formparams.add(new BasicNameValuePair("password", password));
org.apache.http.client.fluent.Response httpres = Request.Post("https://api.weibo.com/oauth2/access_token")
.bodyForm(formparams).execute();

org.apache.http.HttpResponse resp = httpres.returnResponse();

client_id=140226478

client_secret=42fcc96d3e64d9e248649369d61632a6

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/59759

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX