public String getIdentifier(String token) throws UnirestException, InvalidAccountException {
String[] codes = token.split("\\|");
HttpResponse<JsonNode> me = Unirest.get("https://api.tumblr.com/v2/user/info?" + getOauthRequest("https://api.tumblr.com/v2/user/info", "oauth_token="+codes[0], "oob", "GET", codes[1]))
.header("User-Agent", "pxls.space")
.asJson();
JSONObject json = me.getBody().getObject();
if (json.has("error")) {
return null;
} else {
try {
return json.getJSONObject("response").getJSONObject("user").getString("name");
} catch (JSONException e) {
return null;
}
}
}
TumblrAuthService.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:Pxls
作者:
评论列表
文章目录