本文整理匯總了Java中weibo4j.util.WeiboConfig類的典型用法代碼示例。如果您正苦於以下問題:Java WeiboConfig類的具體用法?Java WeiboConfig怎麽用?Java WeiboConfig使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
WeiboConfig類屬於weibo4j.util包,在下文中一共展示了WeiboConfig類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: suggestionsUsersByStatus
import weibo4j.util.WeiboConfig; //導入依賴的package包/類
public UserWapper suggestionsUsersByStatus(String content, int num)
throws WeiboException {
return User.constructWapperUsers(client.get(
WeiboConfig.getValue("baseURL")
+ "suggestions/users/by_status.json",
new PostParameter[] { new PostParameter("content", content),
new PostParameter("num", num) }, access_token));
}
示例2: parseSignedRequest
import weibo4j.util.WeiboConfig; //導入依賴的package包/類
public String parseSignedRequest(String signed_request) throws IOException,
InvalidKeyException, NoSuchAlgorithmException {
String[] t = signed_request.split("\\.", 2);
// 為了和 url encode/decode 不衝突,base64url 編碼方式會將
// '+','/'轉換成'-','_',並且去掉結尾的'='。 因此解碼之前需要還原到默認的base64編碼,結尾的'='可以用以下算法還原
int padding = (4 - t[0].length() % 4);
for (int i = 0; i < padding; i++)
t[0] += "=";
String part1 = t[0].replace("-", "+").replace("_", "/");
SecretKey key = new SecretKeySpec(WeiboConfig
.getValue("client_SERCRET").getBytes(), "hmacSHA256");
Mac m;
m = Mac.getInstance("hmacSHA256");
m.init(key);
m.update(t[1].getBytes());
String part1Expect = BASE64Encoder.encode(m.doFinal());
// sun.misc.BASE64Decoder decode = new sun.misc.BASE64Decoder();
// String s = new String(decode.decodeBuffer(t[1]));
String s = new String(java.util.Base64.getUrlDecoder().decode(t[1]));
if (part1.equals(part1Expect)) {
return ts(s);
} else {
return null;
}
}
示例3: getBilateralTimeline
import weibo4j.util.WeiboConfig; //導入依賴的package包/類
public StatusWapper getBilateralTimeline(Integer base_app, Integer feature)
throws WeiboException {
return Status.constructWapperStatus(client.get(
WeiboConfig.getValue("baseURL")
+ "statuses/bilateral_timeline.json",
new PostParameter[] { new PostParameter("base_app", base_app),
new PostParameter("feature", feature) }, access_token));
}
示例4: suggestionsUsersMayInterested
import weibo4j.util.WeiboConfig; //導入依賴的package包/類
public JSONArray suggestionsUsersMayInterested(int count, int page)
throws WeiboException {
return client.get(
WeiboConfig.getValue("baseURL")
+ "suggestions/users/may_interested.json",
new PostParameter[] { new PostParameter("count", count),
new PostParameter("page", page) }, access_token)
.asJSONArray();
}
示例5: getFriendsTimelineIds
import weibo4j.util.WeiboConfig; //導入依賴的package包/類
public JSONObject getFriendsTimelineIds(Integer baseAPP, Integer feature,
Paging paging) throws WeiboException {
return client.get(
WeiboConfig.getValue("baseURL")
+ "statuses/friends_timeline/ids.json",
new PostParameter[] {
new PostParameter("base_app", baseAPP.toString()),
new PostParameter("feature", feature.toString()) },
paging, access_token).asJSONObject();
}
示例6: authorize
import weibo4j.util.WeiboConfig; //導入依賴的package包/類
public String authorize(String response_type, String state, String scope)
throws WeiboException {
return WeiboConfig.getValue("authorizeURL").trim() + "?client_id="
+ WeiboConfig.getValue("client_ID").trim() + "&redirect_uri="
+ WeiboConfig.getValue("redirect_URI").trim()
+ "&response_type=" + response_type + "&state=" + state
+ "&scope=" + scope;
}
示例7: getUserTimelineIdsByName
import weibo4j.util.WeiboConfig; //導入依賴的package包/類
public JSONObject getUserTimelineIdsByName(String screen_name)
throws WeiboException {
return client.get(
WeiboConfig.getValue("baseURL")
+ "statuses/user_timeline/ids.json",
new PostParameter[] { new PostParameter("screen_name",
screen_name) }, access_token).asJSONObject();
}
示例8: getUnreadCountOfRemind
import weibo4j.util.WeiboConfig; //導入依賴的package包/類
public JSONObject getUnreadCountOfRemind(String callback)
throws WeiboException {
return client
.get(WeiboConfig.getValue("baseURL")
+ "remind/unread_count.json",
new PostParameter[] { new PostParameter("callback",
callback) }, access_token).asJSONObject();
}
示例9: getUserTimelineByName
import weibo4j.util.WeiboConfig; //導入依賴的package包/類
public StatusWapper getUserTimelineByName(String screen_name)
throws WeiboException {
return Status
.constructWapperStatus(client.get(
WeiboConfig.getValue("baseURL")
+ "statuses/user_timeline.json",
new PostParameter[] { new PostParameter("screen_name",
screen_name) }, access_token));
}
示例10: suggestionsStatusesReorder
import weibo4j.util.WeiboConfig; //導入依賴的package包/類
public StatusWapper suggestionsStatusesReorder(int section, int count,
Paging page) throws WeiboException {
return Status
.constructWapperStatus(client.get(
WeiboConfig.getValue("baseURL")
+ "suggestions/statuses/reorder.json",
new PostParameter[] {
new PostParameter("section", section),
new PostParameter("count", count) }, page,
access_token));
}
示例11: getTrendsHourly
import weibo4j.util.WeiboConfig; //導入依賴的package包/類
public List<Trends> getTrendsHourly(Integer base_app) throws WeiboException {
return Trends.constructTrendsList(client.get(
WeiboConfig.getValue("baseURL") + "trends/hourly.json",
new PostParameter[] { new PostParameter("base_app", base_app
.toString()) }, access_token));
}
示例12: getCommentById
import weibo4j.util.WeiboConfig; //導入依賴的package包/類
/**
* 根據微博ID返回某條微博的評論列表
*
* @param id
* 需要查詢的微博ID
* @param count
* 單頁返回的記錄條數,默認為50。
* @param page
* 返回結果的頁碼,默認為1。
* @param filter_by_author
* 作者篩選類型,0:全部、1:我關注的人、2:陌生人,默認為0。
* @return list of Comment
* @throws WeiboException
* when Weibo service or network is unavailable
* @version weibo4j-V2 1.0.1
* @see http://open.weibo.com/wiki/2/comments/show
* @since JDK 1.5
*/
public CommentWapper getCommentById(String id, Paging page,
Integer filter_by_author) throws WeiboException {
return Comment.constructWapperComments(client.get(
WeiboConfig.getValue("baseURL") + "comments/show.json",
new PostParameter[] {
new PostParameter("id", id),
new PostParameter("filter_by_author", filter_by_author
.toString()) }, page, access_token));
}
示例13: searchPoisByGeoByCenname
import weibo4j.util.WeiboConfig; //導入依賴的package包/類
/**
* 根據中心點關鍵字查詢周邊poi
*
* @param q
* 查詢的關鍵詞,必須進行URLencode
* @param cenname
* 中心點名稱
* @return
* @throws WeiboException
* when Weibo service or network is unavailable
* @version weibo4j-V2 1.0.2
* @see http://open.weibo.com/wiki/2/location/pois/search/by_geo
* @since JDK 1.5
*/
public JSONObject searchPoisByGeoByCenname(String q, String cenname)
throws WeiboException {
return client.get(
WeiboConfig.getValue("baseURL")
+ "location/pois/search/by_geo.json",
new PostParameter[] { new PostParameter("q", q),
new PostParameter("cenname", cenname) }, access_token)
.asJSONObject();
}
示例14: getCommentByMe
import weibo4j.util.WeiboConfig; //導入依賴的package包/類
/**
* 獲取當前登錄用戶所發出的評論列表
*
* @param count
* 單頁返回的記錄條數,默認為50
* @param page
* 返回結果的頁碼,默認為1
* @param filter_by_source
* 來源篩選類型,0:全部、1:來自微博的評論、2:來自微群的評論,默認為0
* @return list of Comment
* @throws WeiboException
* when Weibo service or network is unavailable
* @version weibo4j-V2 1.0.1
* @see http://open.weibo.com/wiki/2/comments/by_me
* @since JDK 1.5
*/
public CommentWapper getCommentByMe(Paging page, Integer filter_by_source)
throws WeiboException {
return Comment.constructWapperComments(client.get(
WeiboConfig.getValue("baseURL") + "comments/by_me.json",
new PostParameter[] { new PostParameter("filter_by_author",
filter_by_source.toString()) }, page, access_token));
}
示例15: trendsFollow
import weibo4j.util.WeiboConfig; //導入依賴的package包/類
/**
* 關注某話題
*
* @param trend_name
* 要關注的話題關鍵詞。
* @return UserTrend
* @throws WeiboException
* when Weibo service or network is unavailable
* @version weibo4j-V2 1.0.1
* @throws JSONException
* @see http://open.weibo.com/wiki/2/trends/follow
* @since JDK 1.5
*/
public UserTrend trendsFollow(String trend_name) throws WeiboException {
return new UserTrend(client.post(WeiboConfig.getValue("baseURL")
+ "trends/follow.json",
new PostParameter[] { new PostParameter("trend_name",
trend_name) }, access_token));
}