heroku_ebooks icon indicating copy to clipboard operation
heroku_ebooks copied to clipboard

Twitter API v2 endpoints?

Open shinylotad opened this issue 3 years ago • 2 comments
trafficstars

Any chance this can be updated to work with v2 endpoints? As of right now, the endpoints in this code don't work unless the user's app is approved for "Elevated" developer access.

Traceback (most recent call last):
  File "/app/ebooks.py", line 161, in <module>
    handle_stats = api.GetUser(screen_name=user)
  File "/app/.heroku/python/lib/python3.9/site-packages/twitter/api.py", line 2869, in GetUser
    data = self._ParseAndCheckTwitter(resp.content.decode('utf-8'))
  File "/app/.heroku/python/lib/python3.9/site-packages/twitter/api.py", line 4908, in _ParseAndCheckTwitter
    self._CheckForTwitterError(data)
  File "/app/.heroku/python/lib/python3.9/site-packages/twitter/api.py", line 4928, in _CheckForTwitterError
    raise TwitterError(data['errors'])
twitter.error.TwitterError: [{'message': 'You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you’ll need to apply for Elevated access via the Developer Portal. You can learn more here: https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#v2-access-leve', 'code': 453}] 

shinylotad avatar Feb 21 '22 12:02 shinylotad

Actually, if you don't mind. I believe I almost have this working. I'd like to be assigned this if you think it's something worth adding.

shinylotad avatar Feb 21 '22 14:02 shinylotad

Hi @shinylotad, this isn't an error I've seen, but i also honestly haven't looked at this code in quite a long time. If you want to take a crack at pull request dealing with this issue, I'd be happy to take a look at it.

tommeagher avatar Feb 23 '22 12:02 tommeagher

I believe this addressed by @supermodelscientist in #74

tommeagher avatar Sep 10 '23 12:09 tommeagher