本文整理了Java中twitter4j.Twitter.getFriendsIDs()
方法的一些代码示例,展示了Twitter.getFriendsIDs()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Twitter.getFriendsIDs()
方法的具体详情如下:
包路径:twitter4j.Twitter
类名称:Twitter
方法名:getFriendsIDs
[英]Returns an array of numeric IDs for every user the authenticating user is following.
[中]返回身份验证用户跟踪的每个用户的数字ID数组。
代码示例来源:origin: loklak/loklak_server
collect: while (cursor != 0) {
try {
IDs ids = networkRelation == Networker.FOLLOWERS ? twitter.getFollowersIDs(screen_name, cursor) : twitter.getFriendsIDs(screen_name, cursor);
RateLimitStatus rateStatus = ids.getRateLimitStatus();
if (networkRelation == Networker.FOLLOWERS) {
代码示例来源:origin: net.homeip.yusuke/twitter4j
/**
* Returns an array of numeric IDs for every user the authenticating user is following.
* @return an array of numeric IDs for every user the authenticating user is following
* @throws TwitterException when Twitter service or network is unavailable
* @since Twitter4J 2.0.0
* @see <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-friends%C2%A0ids">Twitter API Wiki / Twitter REST API Method: friends ids</a>
*/
public IDs getFriendsIDs() throws TwitterException {
return getFriendsIDs(-1l);
}
代码示例来源:origin: net.homeip.yusuke/twitter4j
/**
* Returns an array of numeric IDs for every user the specified user is following.<br>
* all IDs are attempted to be returned, but large sets of IDs will likely fail with timeout errors.
* @param userId Specfies the ID of the user for whom to return the friends list.
* @return an array of numeric IDs for every user the specified user is following
* @throws TwitterException when Twitter service or network is unavailable
* @since Twitter4J 2.0.0
* @see <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-friends%C2%A0ids">Twitter API Wiki / Twitter REST API Method: friends ids</a>
*/
public IDs getFriendsIDs(int userId) throws TwitterException {
return getFriendsIDs(userId, -1l);
}
代码示例来源:origin: net.homeip.yusuke/twitter4j
/**
* Returns an array of numeric IDs for every user the specified user is following.
* @param screenName Specfies the screen name of the user for whom to return the friends list.
* @return an array of numeric IDs for every user the specified user is following
* @throws TwitterException when Twitter service or network is unavailable
* @since Twitter4J 2.0.0
* @see <a href="http://apiwiki.twitter.com/REST-API-Documentation#friends/ids">Twitter API Wiki / REST API Documentation - Social Graph Methods - friends/ids</a>
*/
public IDs getFriendsIDs(String screenName) throws TwitterException {
return getFriendsIDs(screenName, -1l);
}
代码示例来源:origin: org.twitter4j/twitter4j-async
@Override
public void invoke(List<TwitterListener> listeners) throws TwitterException {
IDs ids = twitter.getFriendsIDs(userId, cursor);
for (TwitterListener listener : listeners) {
try {
listener.gotFriendsIDs(ids);
} catch (Exception e) {
logger.warn("Exception at getFriendsIDs", e);
}
}
}
});
代码示例来源:origin: org.twitter4j/twitter4j-async
@Override
public void invoke(List<TwitterListener> listeners)
throws TwitterException {
IDs ids = twitter.getFriendsIDs(screenName, cursor);
for (TwitterListener listener : listeners) {
try {
listener.gotFriendsIDs(ids);
} catch (Exception e) {
logger.warn("Exception at getFriendsIDs", e);
}
}
}
});
代码示例来源:origin: org.twitter4j/twitter4j-async
@Override
public void invoke(List<TwitterListener> listeners)
throws TwitterException {
IDs ids = twitter.getFriendsIDs(cursor);
for (TwitterListener listener : listeners) {
try {
listener.gotFriendsIDs(ids);
} catch (Exception e) {
logger.warn("Exception at getFriendsIDs", e);
}
}
}
});
代码示例来源:origin: stackoverflow.com
IDs list = twitter.getFriendsIDs(0);
for(long ID : list.getIDs()) {
Status[] tweets = getAllTweets(twitter, ID);
System.out.println(ID + ": " + tweets.length);
}
Status[] getAllTweets(Twitter twitter, long userId)
{
int pageno = 1;
List statuses = new ArrayList();
while (true)
{
try
{
int size = statuses.size();
Paging page = new Paging(pageno++, 100);
statuses.addAll(twitter.getUserTimeline(userId, page));
if (statuses.size() == size)
break;
}
catch (TwitterException e)
{
e.printStackTrace();
}
}
return (Status[]) statuses.toArray(new Status[0]);
}
代码示例来源:origin: stackoverflow.com
int finish = 100;
ArrayList<Long> IDS = new ArrayList<Long>();
long[] friendsID = t.getFriendsIDs(userID, -1).getIDs();
boolean check = true;
while (check) {
内容来源于网络,如有侵权,请联系作者删除!