BufferedReader reader = null;
try {
longurl = URLEncoder.encode(longurl, "GBK");
URL url = new URL("外链网址已屏蔽;url_long=" + longurl);
InputStream iStream = url.openStream();
reader = new BufferedReader(new InputStreamReader(iStream));
String jsonStr = reader.readLine();
JSONObject jsonObj = JSONObject.parseArray(jsonStr).getJSONObject(0);
return jsonObj.getString("url_short");
} catch (Exception e) {
return longurl;
} finally {
IOUtils.closeQuietly(reader);
}