bear / python-twitter

A Python wrapper around the Twitter API.
Apache License 2.0
3.41k stars 957 forks source link

Updates Direct Message endpoints and classes #665

Open Kyu opened 4 years ago

Kyu commented 4 years ago

Attempts to fix #592 and #587

This is a WIP, I'm just posting this to get feedback, since I'm not totally familiar with the coding style of this repo. So far this version allows users to read DM's with GetDirectMessages(return_json=True).

The actual DirectMessage class is still broken in this commit.

Which brings be to the things something wanted feedback on:

Would it be okay to create a EventModel(TwitterModel) class, which overrides .NewFromJsonDict for twitter events in general? I'm assuming Twitter inc plans to add more events to their api in the future.

TODO


This change is Reviewable

cajuncooks commented 4 years ago

Does this branch still work for you? I just get an empty events array as of earlier this week on multiple accounts, which tracks with my experience using twurl or other Twitter API interfaces. Even dmarchiver seems to be broken, which doesn't interface with the API at all.

Using your branch, an active account will have a next_cursor, while an inactive account will not, so it's not totally dead, just entirely useless. My hypothesis is that Twitter broke something with their 1.1 DM endpoints when working up to the 2.0 release, but DM functionality is buried in the "nesting" phase for the 2.0 API roadmap, which has me concerned that we've just lost this for a significant amount of time. If anybody has a different experience, let me know...

Kyu commented 1 year ago

Just seeing this, but yes, it worked for me and I used it to run https://github.com/Kyu/Bookmarks-Plus for a while. Hopefully if saner minds regain control over twitter projects like this can be revived, I had a few ideas of my own

cajuncook commented 1 year ago

IMO JustAnotherArchivist/snscrape is a good place for future development in this vein.

Kyu commented 1 year ago

Never heard of it, that looks pretty sweet