0

Well I am new to Twython and through this library I am retrieving tweets, but only 10-15 tweets are getting fetched.

The code snippet which I am using to retrieve the tweets is given below:

user_timeline=twitter.getUserTimeline(screen_name="dksbhj")
for tweet in user_timeline:
    print tweet['text']

What can be used to increase tweet count from 10-15 tweets?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Uselesssss
  • 2,127
  • 6
  • 28
  • 37

1 Answers1

4

You should add the count parameter to your request:

user_timeline=twitter.getUserTimeline(screen_name="dksbhj", count=50)
for tweet in user_timeline:
    print tweet['text'] + "\n"

N.B. count can't be greater than 200 per request.
If you want to retrieve the retweets too, add the parameter include_rts=1 to your request:

user_timeline=twitter.getUserTimeline(screen_name="dksbhj", count=50, include_rts=1)
doru
  • 9,022
  • 2
  • 33
  • 43