How to get more than 100 tweets from twitter4j search api


#1

How to get more than 100 tweets from twitter4j search api. I have set .rpp = 100 and page = 20. But the search returns only 100 tweets.


#2

The page parameter doesn’t specify how many pages you want to obtain, but which page to obtain. You’ll need to request pages 1 through 19 to obtain the tweets prior to page 20.


#3

Thanks for the post Taylor! Would it be possible to post a code snippet…


#4

for(int page=1;page<=15;page++)
{
result= twitter.search(query.page(page));
…
}

I tried this code. but it doesnt work!
Can you help me?


#5

Pages are not the best way to go. If you are trying to get the 1000 most recent tweets in a search, for example, you should use query.setMaxId() to the lowest # - 1 from your previous batch. If you are trying to get new(er) tweets since your last query, you should use query.setSinceId() to start from the value returned in result.getMaxId() from the previous batch.

See https://dev.twitter.com/docs/using-search


#6

Hi Charles,

Can we get latest 100 mentions using twitter4j. please mention the method to be used for the same.
We are using Twitter.getMentions(new Paging(long SinceID)) but it gets only latest 20 tweets.

Thanks,
Sravanthi


#7

i am bit confused, i need to collect tweets against each request for one week, how can i do this?
meaning to say, i need number of tweets with time interval of (let say 30 sec). Its almost the same as one can find on the web. Web interface send twitter request every 30 seconds. how can i do this and then calculate the number of tweets


#8

i am bit confused, i need to collect tweets against each request for one week, how can i do this?
meaning to say, i need number of tweets with time interval of (let say 30 sec). Its almost the same as one can find on the web. Web interface send twitter request every 30 seconds. how can i do this and then calculate the number of tweets


#9

How to get more than 100 tweets from twitter4j search api. I have set .rpp = 100 and page = 20. But the search returns only 100 tweets.


#10

How to get more than 100 tweets from twitter4j search api. I have set .rpp = 100 and page = 20. But the search returns only 100 tweets.


#11

how to do that??? i want all search result to display, not only 100…


#12

hi sir,
can you send me the code how to read tweets on wall.


#13

i need help with my tweets if you do know how to help me please do i would a appreciate it


#14

May be this would help:
Below is the pseudo Code to get more than 100 Tweets from search query.

Query query = Query("#Live");
query.setCount(100);
QueryResult result=tweeterFactoryInstance.search(query);
do{
List tweets = result.getTweets();
for(Status tweet: tweets){
System.out.println("Tweet: "+tweet.getText());
}
query=result.nextQuery();
if(query!=null)
result=tweeterFactoryInstance.search(query);
}while(query!=null)


#15

Street is d name…hustle is d game…$money is d gain…I rep d street… #streethood ± #TEAM CHELSEA FC***Pin 224D5912*** +2348109288254


#16

1.Query query = Query
("#Live");
2.query.setCount(100);
3.QueryResult
result=tweeterFactoryInstance.sea
(query);
4.do{
5. List
tweets = result.getTweets();
6. for(Status tweet:
tweets){
7. System.out.println
("Tweet: "+tweet.getText());
8. }
9. query=result.nextQuery
();
10. if(query!=null)
11. result=tweeterFact
(query);
12.}while(query!=null)


#17

How to get more than 100 tweets from twitter4j search api. I have set .rpp = 100 and page = 20. But the search returns only 100 tweets.


#18

How to get more 100 tweets for twitter


#19

how many tweets can be retrive per hour.


#20

how many number of tweets can be get per hour