Search in sources :

Example 1 with Groups

use of org.aisen.weibo.sina.sinasdk.bean.Groups in project AisenWeiBo by wangdan.

the class SinaSDK method friendshipGroups.

/**
	 * 获取好友的分组信息
	 * 
	 * @return
	 */
public Groups friendshipGroups() throws TaskException {
    Groups groups = doGet(getSetting("friendshipGroups"), configParams(null), Groups.class);
    Map<String, String> groupMap = new HashMap<String, String>();
    List<Group> groupList = new ArrayList<Group>();
    // fuck 有两个特别关注
    for (Group group : groups.getLists()) {
        if (!groupMap.containsKey(group.getIdstr())) {
            groupList.add(group);
            groupMap.put(group.getIdstr(), group.getIdstr());
        }
    }
    groups.setLists(groupList);
    return groups;
}
Also used : Group(org.aisen.weibo.sina.sinasdk.bean.Group) HashMap(java.util.HashMap) Groups(org.aisen.weibo.sina.sinasdk.bean.Groups) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Group (org.aisen.weibo.sina.sinasdk.bean.Group)1 Groups (org.aisen.weibo.sina.sinasdk.bean.Groups)1