这是本文档旧的修订版!
登录新浪微博开发整账号:cinvestors\_app@tebon.com.cn,选择审核过的应用,查看[应用信息-基本信息]下的App Key,用于下面接口调用
String APP_KEY = "1570065866";//APP KEY String targetUrl = "http://www.cinvestors.com.cn/opmt-web/";//原始URL String sinaApiUrl = "http://api.t.sina.com.cn/short_url/shorten.json?source=" + APP_KEY + "&url_long=" + targetUrl;//SINA API URL String jsonStr = HttpClientUtils.getWebContentByGet(sinaApiUrl);//调用API System.out.println(jsonStr);//输出JSON串
结果中的url\_short即为新浪短网址
[{"url_short":"http://t.cn/RGKJv9Y","url_long":"http://www.cinvestors.com.cn/opmt-web/","type":0}]