Back to project page Music-Share-Android.
The source code is released under:
GNU General Public License
If you think the Android project Music-Share-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.weibo.sdk.android.api; /*from www . jav a 2s . c o m*/ import com.weibo.sdk.android.Oauth2AccessToken; import com.weibo.sdk.android.WeiboParameters; import com.weibo.sdk.android.net.RequestListener; /** * ??????????????????????????<a href="http://open.weibo.com/wiki/API%E6%96%87%E6%A1%A3_V2#.E7.9F.AD.E9.93.BE">???????</a> * @author xiaowei6@staff.sina.com.cn */ public class ShortUrlAPI extends WeiboAPI { public ShortUrlAPI(Oauth2AccessToken accessToken) { super(accessToken); } private static final String SERVER_URL_PRIX = API_SERVER + "/short_url"; /** * ?????????????????? * * @param url_long ??????????????????20?? * @param listener */ public void shorten( String[] url_long, RequestListener listener) { WeiboParameters params = new WeiboParameters(); if(url_long!=null){ int length=url_long.length; for (int i=0;i<length;i++) { params.add("url_long", url_long[i]); } } request( SERVER_URL_PRIX + "/shorten.json", params, HTTPMETHOD_GET, listener); } /** * ??????????????????? * * @param url_short ????????????????20? ? * @param listener */ public void expand( String[] url_short, RequestListener listener) { WeiboParameters params = new WeiboParameters(); if(url_short!=null){ int length=url_short.length; for (int i=0;i<length;i++) { params.add("url_short", url_short[i]); } } request( SERVER_URL_PRIX + "/expand.json", params, HTTPMETHOD_GET, listener); } /** * ???????????? * * @param url_short ?????????????????????20?? * @param listener */ public void clicks( String[] url_short, RequestListener listener) { WeiboParameters params = new WeiboParameters(); if(url_short!=null){ int length=url_short.length; for (int i=0;i<length;i++) { params.add("url_short", url_short[i]); } } request( SERVER_URL_PRIX + "/clicks.json", params, HTTPMETHOD_GET, listener); } /** * ????????????referer????????? * * @param url_short ?????????????????? * @param listener */ public void referers( String url_short, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("url_short", url_short); request( SERVER_URL_PRIX + "/referers.json", params, HTTPMETHOD_GET, listener); } /** * ??????????????????????? * * @param url_short ?????????????????? * @param listener */ public void locations( String url_short, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("url_short", url_short); request( SERVER_URL_PRIX + "/locations.json", params, HTTPMETHOD_GET, listener); } /** * ????????????????????? * * @param url_short ?????????????????????20?? * @param listener */ public void shareCounts( String[] url_short, RequestListener listener) { WeiboParameters params = new WeiboParameters(); if(url_short!=null){ int length=url_short.length; for (int i=0;i<length;i++) { params.add("url_short", url_short[i]); } } request( SERVER_URL_PRIX + "/share/counts.json", params, HTTPMETHOD_GET, listener); } /** * ?????????????????????????? * * @param url_short ????????????????????? * @param since_id ????????????ID?since_id???????????since_id?????????????0? * @param max_id ????????????ID??????max_id?????????0? * @param count ?????????????????50???????200? * @param page ????????????1? * @param listener */ public void shareStatuses( String url_short, long since_id, long max_id, int count, int page, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("url_short", url_short); params.add("since_id", since_id); params.add("max_id", max_id); params.add("count", count); params.add("page", page); request( SERVER_URL_PRIX + "/share/statuses.json", params, HTTPMETHOD_GET, listener); } /** * ????????????????????? * * @param url_short ?????????????????????20?? * @param listener */ public void commentCounts( String[] url_short, RequestListener listener) { WeiboParameters params = new WeiboParameters(); if(url_short!=null){ int length=url_short.length; for (int i=0;i<length;i++) { params.add("url_short", url_short[i]); } } request( SERVER_URL_PRIX + "/comment/counts.json", params, HTTPMETHOD_GET, listener); } /** * ?????????????????????????? * * @param url_short ??????????????????????? * @param since_id ????????????ID?since_id?????????since_id???????????0? * @param max_id ????????????ID??????max_id???????0? * @param count ?????????????????50???????200? * @param page ????????????1? * @param listener */ public void comments( String url_short, long since_id, long max_id, int count, int page, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("url_short", url_short); params.add("since_id", since_id); params.add("max_id", max_id); params.add("count", count); params.add("page", page); request( SERVER_URL_PRIX + "/comment/comments.json", params, HTTPMETHOD_GET, listener); } }