Ejemplo n.º 1
0
 /**
  * 判断当前用户是否关注某话题
  *
  * @param trend_name 话题关键字,必须做URLencode
  * @return jsonobject
  * @throws WeiboException when Weibo service or network is unavailable
  * @version com.dengjintian.weibo2rss.weibo4j-V2 1.0.1
  * @throws JSONException
  * @see <a href="http://open.weibo.com/wiki/2/trends/is_follow">trends/is_follow</a>
  * @since JDK 1.5
  */
 public JSONObject isFollow(String trend_name) throws WeiboException {
   return client
       .get(
           WeiboConfig.getValue("baseURL") + "trends/is_follow.json",
           new PostParameter[] {new PostParameter("trend_name", trend_name)})
       .asJSONObject();
 }
Ejemplo n.º 2
0
 /**
  * 取消对某话题的关注
  *
  * @param trend_id 要取消关注的话题ID
  * @return jsonobject
  * @throws WeiboException when Weibo service or network is unavailable
  * @version com.dengjintian.weibo2rss.weibo4j-V2 1.0.1
  * @throws JSONException
  * @see <a href="http://open.weibo.com/wiki/2/trends/destroy">trends/destroy</a>
  * @since JDK 1.5
  */
 public JSONObject trendsDestroy(Integer trend_id) throws WeiboException {
   return client
       .post(
           WeiboConfig.getValue("baseURL") + "trends/destroy.json",
           new PostParameter[] {new PostParameter("trend_id", trend_id.toString())})
       .asJSONObject();
 }
Ejemplo n.º 3
0
 /**
  * 获取某人的话题列表
  *
  * @param uid 需要获取话题的用户的UID
  * @param page 返回结果的页码,默认为1
  * @return list of the userTrend
  * @throws WeiboException when Weibo service or network is unavailable
  * @version com.dengjintian.weibo2rss.weibo4j-V2 1.0.1
  * @see <a href="http://open.weibo.com/wiki/2/trends">trends</a>
  * @since JDK 1.5
  */
 public List<UserTrend> getTrends(String uid, Paging page) throws WeiboException {
   return UserTrend.constructTrendList(
       client.get(
           WeiboConfig.getValue("baseURL") + "trends.json",
           new PostParameter[] {new PostParameter("uid", uid)},
           page));
 }
Ejemplo n.º 4
0
 /**
  * 批量获取用户的粉丝数、关注数、微博数
  *
  * @param uids 需要获取数据的用户UID,多个之间用逗号分隔,最多不超过100个
  * @return jsonobject
  * @throws WeiboException when Weibo service or network is unavailable
  * @version com.dengjintian.weibo2rss.weibo4j-V2 1.0.1
  * @see <a href="http://open.weibo.com/wiki/2/users/domain_show">users/domain_show</a>
  * @since JDK 1.5
  */
 public JSONArray getUserCount(String uids) throws WeiboException {
   return client
       .get(
           WeiboConfig.getValue("baseURL") + "users/counts.json",
           new PostParameter[] {new PostParameter("uids", uids)})
       .asJSONArray();
 }
Ejemplo n.º 5
0
 /**
  * 通过个性化域名获取用户资料以及用户最新的一条微博
  *
  * @param domain 需要查询的个性化域名。
  * @return User
  * @throws WeiboException when Weibo service or network is unavailable
  * @version com.dengjintian.weibo2rss.weibo4j-V2 1.0.1
  * @see <a href="http://open.weibo.com/wiki/2/users/domain_show">users/domain_show</a>
  * @since JDK 1.5
  */
 public User showUserByDomain(String domain) throws WeiboException {
   return new User(
       client
           .get(
               WeiboConfig.getValue("baseURL") + "users/domain_show.json",
               new PostParameter[] {new PostParameter("domain", domain)})
           .asJSONObject());
 }
Ejemplo n.º 6
0
 /**
  * 根据用户ID获取用户信息
  *
  * @param screen_name 用户昵称
  * @return User
  * @throws WeiboException when Weibo service or network is unavailable
  * @version com.dengjintian.weibo2rss.weibo4j-V2 1.0.1
  * @see <a href="http://open.weibo.com/wiki/2/users/show">users/show</a>
  * @since JDK 1.5
  */
 public User showUserByScreenName(String screen_name) throws WeiboException {
   return new User(
       client
           .get(
               WeiboConfig.getValue("baseURL") + "users/show.json",
               new PostParameter[] {new PostParameter("screen_name", screen_name)})
           .asJSONObject());
 }
Ejemplo n.º 7
0
 /**
  * 根据用户ID获取用户信息
  *
  * @param uid 需要查询的用户ID
  * @return User
  * @throws WeiboException when Weibo service or network is unavailable
  * @version com.dengjintian.weibo2rss.weibo4j-V2 1.0.1
  * @see <a href="http://open.weibo.com/wiki/2/users/show">users/show</a>
  * @since JDK 1.5
  */
 public User showUserById(String uid) throws WeiboException {
   return new User(
       client
           .get(
               WeiboConfig.getValue("baseURL") + "users/show.json",
               new PostParameter[] {new PostParameter("uid", uid)})
           .asJSONObject());
 }
Ejemplo n.º 8
0
 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())}));
 }
Ejemplo n.º 9
0
 /**
  * 返回最近一小时内的热门话题
  *
  * @param base_app 是否只获取当前应用的数据。0为否(所有数据),1为是(仅当前应用),默认为0
  * @return list of trends
  * @throws WeiboException when Weibo service or network is unavailable
  * @version com.dengjintian.weibo2rss.weibo4j-V2 1.0.1
  * @throws JSONException
  * @see <a href="http://open.weibo.com/wiki/2/trends/hourly">trends/hourly</a>
  * @since JDK 1.5
  */
 public List<Trends> getTrendsHourly() throws WeiboException {
   return Trends.constructTrendsList(
       client.get(WeiboConfig.getValue("baseURL") + "trends/hourly.json"));
 }
Ejemplo n.º 10
0
 /**
  * 关注某话题
  *
  * @param trend_name 要关注的话题关键词。
  * @return UserTrend
  * @throws WeiboException when Weibo service or network is unavailable
  * @version com.dengjintian.weibo2rss.weibo4j-V2 1.0.1
  * @throws JSONException
  * @see <a href="http://open.weibo.com/wiki/2/trends/follow">trends/follow</a>
  * @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)}));
 }