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; /*w ww. j ava 2s . com*/ 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#.E6.94.B6.E8.97.8F">??????</a> * @author xiaowei6@staff.sina.com.cn * */ public class FavoritesAPI extends WeiboAPI { public FavoritesAPI(Oauth2AccessToken accessToken) { super(accessToken); } private static final String SERVER_URL_PRIX = API_SERVER + "/favorites"; /** * ????????????????? * * @param count ?????????????????50? * @param page ????????????1? * @param listener */ public void favorites(int count, int page, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("count", count); params.add("page", page); request( SERVER_URL_PRIX + ".json", params, HTTPMETHOD_GET, listener); } /** * ????????????????ID * * @param count ?????????????????50? * @param page ????????????1 * @param listener */ public void ids( int count, int page, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("count", count); params.add("page", page); request( SERVER_URL_PRIX + "/ids.json", params, HTTPMETHOD_GET, listener); } /** * ???????ID?????????????? * * @param id ?????????ID? * @param listener */ public void show(long id, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("id", id); request( SERVER_URL_PRIX + "/show.json", params, HTTPMETHOD_GET, listener); } /** * ??????????????????????????? * * @param tid ????????ID? * @param count ?????????????????50? * @param page ????????????1? * @param listener */ public void byTags(long tid, int count, int page, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("tid", tid); params.add("count", count); params.add("page", page); request( SERVER_URL_PRIX + "/by_tags.json", params, HTTPMETHOD_GET, listener); } /** * ??????????????????? * * @param count ?????????????????10? * @param page ????????????1? * @param listener */ public void tags( int count, int page, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("count", count); params.add("page", page); request( SERVER_URL_PRIX + "/tags.json", params, HTTPMETHOD_GET, listener); } /** * ??????????????????????ID * * @param tid ????????ID? * @param count ?????????????????50? * @param page ????????????1? * @param listener */ public void byTagsIds( long tid, int count, int page, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("tid", tid); params.add("count", count); params.add("page", page); request( SERVER_URL_PRIX + "/by_tags/ids.json", params, HTTPMETHOD_GET, listener); } /** * ??????????????? * * @param id ??????????ID? * @param listener */ public void create( long id, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("id", id); request( SERVER_URL_PRIX + "/create.json", params, HTTPMETHOD_POST, listener); } /** * ??????????????? * * @param id ??????????????ID? * @param listener */ public void destroy( long id, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("id", id); request( SERVER_URL_PRIX + "/destroy.json", params, HTTPMETHOD_POST, listener); } /** * ???????ID?????????? * * @param ids ?????????????ID???????10?? * @param listener */ public void destroyBatch( long[] ids, RequestListener listener) { WeiboParameters params = new WeiboParameters(); StringBuilder strb = new StringBuilder(); for (long id : ids) { strb.append(String.valueOf(id)).append(","); } strb.deleteCharAt(strb.length() - 1); params.add("ids", strb.toString()); request( SERVER_URL_PRIX + "/destroy_batch.json", params, HTTPMETHOD_POST, listener); } /** * ??????????????? * * @param id ?????????ID? * @param tags ?????????????????2???? * @param listener */ public void tagsUpdate( long id, String[] tags, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("id", id); StringBuilder strb = new StringBuilder(); for (String tag : tags) { strb.append(tag).append(","); } strb.deleteCharAt(strb.length() - 1); params.add("tags", strb.toString()); request( SERVER_URL_PRIX + "/tags/update.json", params, HTTPMETHOD_POST, listener); } /** * ???????????????????? * * @param id ????????ID? * @param tag ?????????? * @param listener */ public void tagsUpdateBatch( long id, String tag, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("tid", id); params.add("tag", tag); request( SERVER_URL_PRIX + "/tags/update_batch.json", params, HTTPMETHOD_POST, listener); } /** * ???????????????????? * * @param tid ????????ID? * @param listener */ public void tagsDestroyBatch( long tid, RequestListener listener) { WeiboParameters params = new WeiboParameters(); params.add("tid", tid); request( SERVER_URL_PRIX + "/tags/destroy_batch.json", params, HTTPMETHOD_POST, listener); } }