seems that with tweepy I can get only 200 tweets using user_timeline method.
class Twitter_User():
def __init__(self,id,count=200):
self.id = id
self.count = count
self.data = None
def get_tweets(self):
store_tweets = api.user_timeline(self.id, count=self.count)
simple_list = []
for status in store_tweets:
array = [status._json["text"].strip(), status._json["favorite_count"], status._json["created_at"],status._json["retweet_count"],[h["text"] for h in status._json["entities"]["hashtags"]]]
simple_list.append(array)
self.data = pd.DataFrame(simple_list, columns=["Text", "Like", "Created at","Retweet","Hashtags"])
self.data = self.data[~self.data["Text"].str.startswith('RT')]
return self.data
def __repr__(self):
id = api.get_user(self.id)
return id.screen_name
If I put as self.count a number bigger than 200, I always will get a dataframe with 200 rows, instead if I put a smaller number, I get the correct amount of rows. I don't know, there is a limit or I have to use some other method?