Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
163 views
in Technique[技术] by (71.8m points)

java - Is it possible to get more than 100 tweets?

Is it possible to get more than 100 tweets using the Twitter4j API?
If so can anyone point out the way to do so??

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Would need to see your code to provide a code example specific to your case, but you can do this through since_id or max_id.

This information is for the Twitter API.

To get the previous 100 tweets:

  1. find the the lowest id in the set that you just retrieved with your query
  2. perform the same query with the max_id option set to the id you just found.

To get the next 100 tweets:

  1. find the the highest id in the set that you just retrieved with your query
  2. perform the same query with the since_id option set to the id you just found.

In Twitter4j, your Query object has two fields that represent the above API options: sinceId and maxId.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...