本文整理汇总了Java中com.sina.weibo.sdk.net.WeiboParameters类的典型用法代码示例。如果您正苦于以下问题:Java WeiboParameters类的具体用法?Java WeiboParameters怎么用?Java WeiboParameters使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WeiboParameters类属于com.sina.weibo.sdk.net包,在下文中一共展示了WeiboParameters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: queryMID
import com.sina.weibo.sdk.net.WeiboParameters; //导入依赖的package包/类
/**
* 通过微博(评论、私信)ID获取其MID。
*
* @param ids 需要查询的微博(评论、私信)ID,最多不超过20个。
* @param type 获取类型,1:微博、2:评论、3:私信,默认为1。可为几下几种:
* <li> {@link #TYPE_STATUSES}
* <li> {@link #TYPE_COMMENTS}
* <li> {@link #TYPE_MESSAGE}
* @param listener 异步请求回调接口
*/
public void queryMID(long[] ids, int type, RequestListener listener) {
WeiboParameters params = new WeiboParameters(mAppKey);
if (1 == ids.length) {
params.put("id", ids[0]);
} else {
params.put("is_batch", 1);
StringBuilder strb = new StringBuilder();
for (long id : ids) {
strb.append(id).append(",");
}
strb.deleteCharAt(strb.length() - 1);
params.put("id", strb.toString());
}
params.put("type", type);
requestAsync(SERVER_URL_PRIX + "/querymid.json", params, HTTPMETHOD_GET, listener);
}
示例2: requestSync
import com.sina.weibo.sdk.net.WeiboParameters; //导入依赖的package包/类
/**
* HTTP 同步请求。
*
* @param url 请求的地址
* @param params 请求的参数
* @param httpMethod 请求方法
*
* @return 同步请求后,服务器返回的字符串。
*/
protected String requestSync(String url, WeiboParameters params, String httpMethod) {
if (null == mAccessToken
|| TextUtils.isEmpty(url)
|| null == params
|| TextUtils.isEmpty(httpMethod)) {
LogUtil.e(TAG, "Argument error!");
return "";
}
params.put(KEY_ACCESS_TOKEN, mAccessToken.getToken());
return new AsyncWeiboRunner(mContext).request(url, params, httpMethod);
}
示例3: buildPoisParams
import com.sina.weibo.sdk.net.WeiboParameters; //导入依赖的package包/类
private WeiboParameters buildPoisParams(String poiid, int count, int page, boolean base_app) {
WeiboParameters params = new WeiboParameters(mAppKey);
params.put("poiid", poiid);
params.put("base_app", base_app ? 1 : 0);
params.put("count", count);
params.put("page", page);
return params;
}
示例4: buildCountsParams
import com.sina.weibo.sdk.net.WeiboParameters; //导入依赖的package包/类
private WeiboParameters buildCountsParams(long[] uids) {
WeiboParameters params = new WeiboParameters(mAppKey);
StringBuilder strb = new StringBuilder();
for (long cid : uids) {
strb.append(cid).append(",");
}
strb.deleteCharAt(strb.length() - 1);
params.put("uids", strb.toString());
return params;
}
示例5: buildSerarPoiByGeoParmas
import com.sina.weibo.sdk.net.WeiboParameters; //导入依赖的package包/类
private WeiboParameters buildSerarPoiByGeoParmas(Double longtitude, Double latitude, String keyWord) {
WeiboParameters params = new WeiboParameters(mAppKey);
String coordinate = longtitude + "," + latitude;
params.put("coordinate", coordinate);
params.put("q", keyWord);
return params;
}
示例6: tagsUpdate
import com.sina.weibo.sdk.net.WeiboParameters; //导入依赖的package包/类
/**
* 更新一条收藏的收藏标签。
*
* @param id 需要更新的收藏ID
* @param tags 需要更新的标签内容,最多不超过2条
* @param listener 异步请求回调接口
*/
public void tagsUpdate(long id, String[] tags, RequestListener listener) {
WeiboParameters params = new WeiboParameters(mAppKey);
params.put("id", id);
StringBuilder strb = new StringBuilder();
for (String tag : tags) {
strb.append(tag).append(",");
}
strb.deleteCharAt(strb.length() - 1);
params.put("tags", strb.toString());
requestAsync(SERVER_URL_PRIX + "/tags/update.json", params, HTTPMETHOD_POST, listener);
}
示例7: create
import com.sina.weibo.sdk.net.WeiboParameters; //导入依赖的package包/类
/**
* 创建好友分组。
*
* @param name 要创建的好友分组的名称,不超过10个汉字,20个半角字符
* @param description 要创建的好友分组的描述,不超过70个汉字,140个半角字符
* @param tags 要创建的好友分组的标签,多个之间用逗号分隔,最多不超过10个,每个不超过7个汉字,14个半角字符
* @param listener 异步请求回调接口
*/
public void create(String name, String description, String tags, RequestListener listener) {
WeiboParameters params = new WeiboParameters(mAppKey);
params.put("name", name);
if (TextUtils.isEmpty(description) == false) {
params.put("description", description);
}
if (TextUtils.isEmpty(tags) == false) {
params.put("tags", tags);
}
requestAsync(SERVER_URL_PRIX + "/create.json", params, HTTPMETHOD_POST, listener);
}
示例8: buildFriendIDParam
import com.sina.weibo.sdk.net.WeiboParameters; //导入依赖的package包/类
/** 组装FriendsID的参数 */
private WeiboParameters buildFriendIDParam(long uid, int count) {
WeiboParameters params = new WeiboParameters(mAppKey);
params.put("uid", uid);
params.put("count", count);
return params;
}
示例9: buildTimeLineBase
import com.sina.weibo.sdk.net.WeiboParameters; //导入依赖的package包/类
private WeiboParameters buildTimeLineBase(long since_id, long max_id, int count, int page) {
WeiboParameters params = new WeiboParameters(mAppKey);
params.put("since_id", since_id);
params.put("max_id", max_id);
params.put("count", count);
params.put("page", page);
return params;
}
示例10: friendsTimelineSync
import com.sina.weibo.sdk.net.WeiboParameters; //导入依赖的package包/类
/**
* @see #friendsTimeline(long, long, int, int, boolean, int, boolean, RequestListener)
*/
public String friendsTimelineSync(long since_id, long max_id, int count, int page, boolean base_app, int featureType,
boolean trim_user) {
WeiboParameters params = buildTimeLineParamsBase(since_id, max_id, count, page, base_app,
trim_user, featureType);
return requestSync(sAPIList.get(READ_API_FRIENDS_TIMELINE), params, HTTPMETHOD_GET);
}
示例11: buildCreateParams
import com.sina.weibo.sdk.net.WeiboParameters; //导入依赖的package包/类
private WeiboParameters buildCreateParams(String comment, long id, boolean comment_ori) {
WeiboParameters params = new WeiboParameters(mAppKey);
params.put("comment", comment);
params.put("id", id);
params.put("comment_ori", comment_ori ? 1: 0);
return params;
}
示例12: buildUpdateParams
import com.sina.weibo.sdk.net.WeiboParameters; //导入依赖的package包/类
private WeiboParameters buildUpdateParams(String content, String lat, String lon) {
WeiboParameters params = new WeiboParameters(mAppKey);
params.put("status", content);
if (!TextUtils.isEmpty(lon)) {
params.put("long", lon);
}
if (!TextUtils.isEmpty(lat)) {
params.put("lat", lat);
}
return params;
}
示例13: count
import com.sina.weibo.sdk.net.WeiboParameters; //导入依赖的package包/类
/**
* 批量获取指定微博的转发数评论数。
*
* @param ids 需要获取数据的微博ID,最多不超过100个
* @param listener 异步请求回调接口
*/
public void count(String[] ids, RequestListener listener) {
WeiboParameters params = new WeiboParameters(mAppKey);
StringBuilder strb = new StringBuilder();
for (String id : ids) {
strb.append(id).append(",");
}
strb.deleteCharAt(strb.length() - 1);
params.put("ids", strb.toString());
requestAsync(SERVER_URL_PRIX + "/count.json", params, HTTPMETHOD_GET, listener);
}
示例14: buildShowOrDestoryBatchParams
import com.sina.weibo.sdk.net.WeiboParameters; //导入依赖的package包/类
private WeiboParameters buildShowOrDestoryBatchParams(long[] cids) {
WeiboParameters params = new WeiboParameters(mAppKey);
StringBuilder strb = new StringBuilder();
for (long cid : cids) {
strb.append(cid).append(",");
}
strb.deleteCharAt(strb.length() - 1);
params.put("cids", strb.toString());
return params;
}
示例15: buildTimeLineWithApp
import com.sina.weibo.sdk.net.WeiboParameters; //导入依赖的package包/类
private WeiboParameters buildTimeLineWithApp(long since_id, long max_id, int count, int page, boolean base_app,
int featureType) {
WeiboParameters params = buildTimeLineBase(since_id, max_id, count, page);
params.put("feature", featureType);
params.put("base_app", base_app ? 1 : 0);
return params;
}