request.addHeader(new BasicHeader("Referer",
"http://ctc.qzs.qq.com/qzone/v8/pages/visitors/refuse.html"));
request.addHeader(new BasicHeader("Accept-Language", "zh-cn,zh"));
HttpResponse response = http.execute(request);
if (!Http.isRequestSuccess(response)) {
throw new SocialException("Step 9, get visitor simple failed.");
}
LOGGER.debug("Qzone visitor getSimple end.");
String html = Http.responseToString(response);
JSONObject json =
new JSONObject(html.substring(html.indexOf("{"), html.lastIndexOf("}") + 1));
if (json.getInt("code") != 0) {
LOGGER.debug("Qzone visitor getSimple error: {}", html);
session = false;
http = Http.newClient();
loginUi = null;
loginSig = null;
skey = null;
return getSimple();
}
LOGGER.debug("Qzone visitor getSimple success.");
return json;
} catch (ClientProtocolException e) {
throw new SocialException(e);
} catch (IOException e) {
throw new SocialException(e);
} catch (HttpException e) {
throw new SocialException(e);
} catch (DecoderException e) {
throw new SocialException(e);
}
}