Reputation: 79
I am trying to fetch the twitter dms since a specific message id. But it returns all the dms. can anyone help to get this done. I was trying with the following code snippet
since_id = '134902xxxxxxxxx'
while True:
#last_dms = tweepy.Cursor(api.list_direct_messages, max_id=since_id).items()
last_dms = api.list_direct_messages(10, max_id = since_id)
for messages in last_dms:
print(messages._json)
#since_id = last_dms[0]["id"]
print('since_id %d:', since_id)
time.sleep(30)
with the above code i am able to get all dms from the userid. need hel to get the dms since a specific message id.
Upvotes: 0
Views: 207
Reputation: 13973
The list_direct_messages
does not support the max_id
, see Twitter API reference which is the REST endpoint invoked by Tweepy.
You have 2 options:
Upvotes: 1