Search in sources :

Example 21 with Setting

use of org.aisen.android.common.setting.Setting in project AisenWeiBo by wangdan.

the class SinaSDK method commentsShow.

/**
 * @param id
 *            (true) 需要查询的微博ID
 * @param since_id
 *            (false) 若指定此参数,则返回ID比since_id大的评论(即比since_id时间晚的评论),默认为0
 * @param max_id
 *            (false) 若指定此参数,则返回ID小于或等于max_id的评论,默认为0
 * @param count
 *            (false) 单页返回的记录条数,默认为50
 * @param page
 *            (false) 返回结果的页码,默认为1
 * @param filter_by_author
 *            (false) 作者筛选类型,0:全部、1:我关注的人、2:陌生人,默认为0
 * @return
 */
public StatusComments commentsShow(Params params) throws TaskException {
    if (!params.containsKey("count"))
        params.addParameter("count", getPageCount(getSetting("commentsShow")));
    Setting action = getSetting("commentsShow");
    action.getExtras().put(HTTP_UTILITY, newSettingExtra(HTTP_UTILITY, TimelineCommentHttpUtility.class.getName(), ""));
    return doGet(action, configParams(params), StatusComments.class);
}
Also used : Setting(org.aisen.android.common.setting.Setting)

Example 22 with Setting

use of org.aisen.android.common.setting.Setting in project AisenWeiBo by wangdan.

the class SinaSDK method webGetHotTopicsRecommendStatus.

/**
 * 热门话题的推荐微博列表
 *
 * @param uid
 * @param containerId
 * @return
 * @throws TaskException
 */
public StatusContents webGetHotTopicsRecommendStatus(String uid, String containerId, String sinceId) throws TaskException {
    Params params = new Params();
    params.addParameter("uid", uid);
    params.addParameter("containerid", String.format("230530%s__default__mobile_info_-_pageapp:2305576d91c8d1eef00b0e5caac7d245bc1350", containerId));
    if (!TextUtils.isEmpty(sinceId)) {
        params.addParameter("since_id", sinceId);
    }
    Setting action = newSetting("webGetHotTopicsStatus", "container/getIndex", "热门话题推荐微博");
    action.getExtras().put(HTTP_UTILITY, newSettingExtra(HTTP_UTILITY, TimelineHotTopicsHttpUtility.class.getName(), ""));
    try {
        return doGet(webConfig(), action, params, StatusContents.class);
    } catch (Exception e) {
        if (e instanceof TaskException)
            checkWebResult((TaskException) e);
        throw e;
    }
}
Also used : TaskException(org.aisen.android.network.task.TaskException) Setting(org.aisen.android.common.setting.Setting) Params(org.aisen.android.network.http.Params) ParseException(java.text.ParseException) TaskException(org.aisen.android.network.task.TaskException)

Example 23 with Setting

use of org.aisen.android.common.setting.Setting in project AisenWeiBo by wangdan.

the class SinaSDK method statusesToMe.

/**
 * 获取当前登录用户关注的人发给其的定向微博
 *
 * @param params
 * @param token
 * @return
 */
public StatusContents statusesToMe(Params params) throws TaskException {
    if (!params.containsKey("count"))
        params.addParameter("count", getPageCount(getSetting("statusesToMe")));
    Setting action = getSetting("statusesToMe");
    action.getExtras().put(HTTP_UTILITY, newSettingExtra(HTTP_UTILITY, TimelineHttpUtility.class.getName(), ""));
    return doGet(action, configParams(params), StatusContents.class);
}
Also used : Setting(org.aisen.android.common.setting.Setting)

Example 24 with Setting

use of org.aisen.android.common.setting.Setting in project AisenWeiBo by wangdan.

the class SinaSDK method searchTopics.

/**
 * 搜索某一话题下的微博
 *
 * @param count
 *            单页返回的记录条数,默认为50
 * @param page
 *            返回结果的页码,默认为1
 * @param token
 * @return
 */
public StatusContents searchTopics(String page, String topics, String count) throws TaskException {
    Params params = new Params();
    params.addParameter("page", page);
    if (!TextUtils.isEmpty(count))
        params.addParameter("count", count);
    else
        params.addParameter("count", getPageCount(getSetting("searchTopics")));
    params.addParameter("q", topics);
    params.setEncodeAble(false);
    Setting action = getSetting("searchTopics");
    action.getExtras().put(HTTP_UTILITY, newSettingExtra(HTTP_UTILITY, TimelineHttpUtility.class.getName(), ""));
    return doGet(action, configParams(params), StatusContents.class);
}
Also used : Setting(org.aisen.android.common.setting.Setting) Params(org.aisen.android.network.http.Params)

Example 25 with Setting

use of org.aisen.android.common.setting.Setting in project AisenWeiBo by wangdan.

the class SinaSDK method webGetUnread.

/**
 * 获取网页版未读消息
 *
 * @return
 * @throws TaskException
 */
public String webGetUnread() throws TaskException {
    Params params = new Params();
    params.addParameter("t", System.currentTimeMillis() + "");
    Setting action = newSetting("getWebUnread", "unread", "网页版未读");
    return doGet(webConfig(), action, params, String.class);
}
Also used : Setting(org.aisen.android.common.setting.Setting) Params(org.aisen.android.network.http.Params)

Aggregations

Setting (org.aisen.android.common.setting.Setting)26 Params (org.aisen.android.network.http.Params)17 TaskException (org.aisen.android.network.task.TaskException)11 HttpConfig (org.aisen.android.network.http.HttpConfig)7 ParseException (java.text.ParseException)6 JSONArray (com.alibaba.fastjson.JSONArray)3 JSONObject (com.alibaba.fastjson.JSONObject)3 ArrayList (java.util.ArrayList)2 LikeResultBean (org.aisen.weibo.sina.support.bean.LikeResultBean)2 SpannableString (android.text.SpannableString)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Calendar (java.util.Calendar)1 DefHttpUtility (org.aisen.android.network.http.DefHttpUtility)1 PicUrls (org.aisen.weibo.sina.sinasdk.bean.PicUrls)1 SearchsResultUser (org.aisen.weibo.sina.sinasdk.bean.SearchsResultUser)1 StatusContent (org.aisen.weibo.sina.sinasdk.bean.StatusContent)1 UrlsBean (org.aisen.weibo.sina.sinasdk.bean.UrlsBean)1 WallpaperBeans (org.aisen.weibo.sina.support.bean.WallpaperBeans)1 Document (org.jsoup.nodes.Document)1 Elements (org.jsoup.select.Elements)1