use of org.qii.weiciyuan.bean.MessageBean in project weiciyuan by qii.
the class MentionsWeiboTimeLineDao method getGSONMsgListWithoutClearUnread.
public MessageListBean getGSONMsgListWithoutClearUnread() throws WeiboException {
String json = getMsgListJson();
Gson gson = new Gson();
MessageListBean value = null;
try {
value = gson.fromJson(json, MessageListBean.class);
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
/**
* sometime sina weibo may delete message,so data don't have any user information
*/
if (value != null && value.getItemList().size() > 0) {
List<MessageBean> msgList = value.getItemList();
Iterator<MessageBean> iterator = msgList.iterator();
while (iterator.hasNext()) {
MessageBean msg = iterator.next();
if (msg.getUser() == null) {
iterator.remove();
} else {
msg.getListViewSpannableString();
TimeUtility.dealMills(msg);
}
}
}
return value;
}
use of org.qii.weiciyuan.bean.MessageBean in project weiciyuan by qii.
the class SearchDao method getStatusList.
public SearchStatusListBean getStatusList() throws WeiboException {
String url = URLHelper.STATUSES_SEARCH;
Map<String, String> map = new HashMap<String, String>();
map.put("access_token", access_token);
map.put("count", count);
map.put("page", page);
map.put("q", q);
String jsonData = null;
jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Get, url, map);
Gson gson = new Gson();
SearchStatusListBean value = null;
try {
value = gson.fromJson(jsonData, SearchStatusListBean.class);
List<MessageBean> list = value.getItemList();
Iterator<MessageBean> iterator = list.iterator();
while (iterator.hasNext()) {
MessageBean msg = iterator.next();
//message is deleted by sina
if (msg.getUser() == null) {
iterator.remove();
} else {
msg.getListViewSpannableString();
TimeUtility.dealMills(msg);
}
}
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
return value;
}
use of org.qii.weiciyuan.bean.MessageBean in project weiciyuan by qii.
the class SearchTopicDao method getGSONMsgList.
public TopicResultListBean getGSONMsgList() throws WeiboException {
String json = getMsgListJson();
Gson gson = new Gson();
TopicResultListBean value = null;
try {
value = gson.fromJson(json, TopicResultListBean.class);
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
return null;
}
if (value != null && value.getStatuses() != null && value.getStatuses().size() > 0) {
List<MessageBean> msgList = value.getStatuses();
Iterator<MessageBean> iterator = msgList.iterator();
while (iterator.hasNext()) {
MessageBean msg = iterator.next();
if (msg.getUser() == null) {
iterator.remove();
} else {
msg.getListViewSpannableString();
TimeUtility.dealMills(msg);
}
}
}
return value;
}
use of org.qii.weiciyuan.bean.MessageBean in project weiciyuan by qii.
the class ShareShortUrlTimeLineDao method getGSONMsgList.
public ShareListBean getGSONMsgList() throws WeiboException {
String json = getMsgListJson();
Gson gson = new Gson();
ShareListBean value = null;
try {
value = gson.fromJson(json, ShareListBean.class);
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
if (value != null) {
Iterator<MessageBean> iterator = value.getItemList().iterator();
while (iterator.hasNext()) {
MessageBean msg = iterator.next();
if (msg.getUser() == null) {
iterator.remove();
} else {
msg.getListViewSpannableString();
TimeUtility.dealMills(msg);
}
}
}
return value;
}
use of org.qii.weiciyuan.bean.MessageBean in project weiciyuan by qii.
the class RepostsTimeLineByIdDao method getGSONMsgList.
public RepostListBean getGSONMsgList() throws WeiboException {
String url = URLHelper.REPOSTS_TIMELINE_BY_MSGID;
Map<String, String> map = new HashMap<String, String>();
map.put("access_token", access_token);
map.put("id", id);
map.put("since_id", since_id);
map.put("max_id", max_id);
map.put("count", count);
map.put("page", page);
map.put("filter_by_author", filter_by_author);
String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Get, url, map);
Gson gson = new Gson();
RepostListBean value = null;
try {
value = gson.fromJson(jsonData, RepostListBean.class);
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
if (value != null && value.getItemList().size() > 0) {
List<MessageBean> msgList = value.getItemList();
Iterator<MessageBean> iterator = msgList.iterator();
while (iterator.hasNext()) {
MessageBean msg = iterator.next();
if (msg.getUser() == null) {
iterator.remove();
} else {
msg.getListViewSpannableString();
TimeUtility.dealMills(msg);
}
}
}
return value;
}
Aggregations