我正在开发和应用程序中,我想从推特获得一些饲料,如图片,名称,推文,时间和每条推文的回复数量。我做了所有的事情,但没有得到每条推文的回复数。帮我一把,提前谢谢..我也在发布我的代码。
Twitter unauthenticatedTwitter = new TwitterFactory().getInstance();
Paging paging = new Paging(1, 100);
List<twitter4j.Status> statuses = unauthenticatedTwitter.getUserTimeline("BeingSalmanKhan",paging);
for (Status status3 : statuses)
{
TwitterFeeds tFeeds = new TwitterFeeds();
System.out.println(status3.getText());
tFeeds.strTweet = status3.getText();
tFeeds.strDate = status3.getCreatedAt().toString();
System.out.println("---------------------------------- " + status3.getSource());
al_tweets.add(tFeeds);
}
str_tw_name = unauthenticatedTwitter.showUser("BeingSalmanKhan").getName();
str_tw_imgurl = unauthenticatedTwitter.showUser("BeingSalmanKhan").getProfileImageURL().toString();
bitmap_twpic = NewsActivity.DownloadImage(str_tw_imgurl);发布于 2012-06-18 16:01:37
试试下面这段代码……它对我很有效..我也希望你
try {
Twitter unauthenticatedTwitter = new TwitterFactory().getInstance();
//URLEntity[] uent=
//First param of Paging() is the page number, second is the number per page (this is capped around 200 I think.
Paging paging = new Paging(1, 100);
List<twitter4j.Status> statuses = unauthenticatedTwitter.getUserTimeline("ashabhosle",paging);
System.out.println("status no 2 ="+statuses.get(2).toString());
long retweetcnt=statuses.get(2).getRetweetCount();
System.out.println("retweet count on 2nd tweet "+retweetcnt);
for (Status status3 : statuses)
{
System.out.println(status3.getText());
}
}
catch (Exception e) {
e.printStackTrace();
System.out.println("Failed to get timeline: " + e.getMessage());
}发布于 2012-06-18 12:24:02
试试getRelatedResults(),给出回复+提及的列表,它是最接近得到回复的。
https://stackoverflow.com/questions/11076821
复制相似问题