Store twitter DM's in a .txt file - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Store twitter DM's in a .txt file (/thread-6316.html) |
Store twitter DM's in a .txt file - buflek - Nov-16-2017 I made a bot on twitter for a social experiment and got around 30 accounts. Since its hard for me to check them all daily for messages, I'd like to get them of each account on a text file. Can anyone help me please? from __future__ import print_function from twitter import Twitter, OAuth, TwitterHTTPError I use these libs i'm pretty new to coding so some good explanation would be very helpful thanks RE: Store twitter DM's in a .txt file - buran - Nov-16-2017 if you are new, then don't start learning python2 (based on the fact that you import from __future__ ). start learning python3. As to your project - we are glad to help, but we are not going to do it for you. Please, post your code in code tags and ask specific questions. If you get error, post the full traceback in error tags. RE: Store twitter DM's in a .txt file - buflek - Nov-16-2017 (Nov-16-2017, 07:52 AM)buran Wrote: if you are new, then don't start learning python2 (based on the fact that you import from __future__ ). start learning python3. hey, i'm using python 3, i guess its just from an old source or something... i need help from this information: https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/api-reference/list-events i dont find twurl in my libaries and don't really know what "-X" is from this line: twurl -X GET /1.1/direct_messages/events/list.json regards RE: Store twitter DM's in a .txt file - buran - Nov-16-2017 twurl - https://github.com/twitter/twurl but it is ruby, not python you may want to explore tweepy, python wrapper around Twitter API here are direct message methods - http://tweepy.readthedocs.io/en/v3.5.0/api.html#direct-message-methods RE: Store twitter DM's in a .txt file - buflek - Nov-16-2017 (Nov-16-2017, 12:33 PM)buran Wrote: twurl - https://github.com/twitter/twurl but it is ruby, not python Hey, i have tried this: import tweepy API.direct_messages([since_id][, max_id][, count=10][, page][, full_text=True]) but i keep getting wrong syntax RE: Store twitter DM's in a .txt file - buran - Nov-16-2017 (Nov-16-2017, 04:09 PM)buflek Wrote: Hey, i have tried this: import tweepy API.direct_messages([since_id][, max_id][, count=10][, page][, full_text=True]) but i keep getting wrong syntax As I said, you need to read the docs, it will not work like this. http://tweepy.readthedocs.io/en/v3.5.0/getting_started.html |