Skip to content

403 Error because tweets are too long #21

@fakebenjay

Description

@fakebenjay

Hey,
I've been running the trackthenews script and when it encounters an article title that's too long, it returns a 403 error:

Traceback (most recent call last):
  File "/home/ubuntu/.pyenv/versions/3.6.5/bin/trackthenews", line 11, in <module>
    sys.exit(main())
  File "/home/ubuntu/.pyenv/versions/3.6.5/lib/python3.6/site-packages/trackthenews/core.py", line 441, in main
    article.tweet()
  File "/home/ubuntu/.pyenv/versions/3.6.5/lib/python3.6/site-packages/trackthenews/core.py", line 115, in tweet
    twitter.update_status(status=status, media_ids=media_ids)
  File "/home/ubuntu/.pyenv/versions/3.6.5/lib/python3.6/site-packages/twython/endpoints.py", line 114, in update_status
    return self.post('statuses/update', params=params)
  File "/home/ubuntu/.pyenv/versions/3.6.5/lib/python3.6/site-packages/twython/api.py", line 268, in post
    return self.request(endpoint, 'POST', params=params, version=version)
  File "/home/ubuntu/.pyenv/versions/3.6.5/lib/python3.6/site-packages/twython/api.py", line 258, in request
    api_call=url)
  File "/home/ubuntu/.pyenv/versions/3.6.5/lib/python3.6/site-packages/twython/api.py", line 194, in _request
    retry_after=response.headers.get('X-Rate-Limit-Reset'))
twython.exceptions.TwythonError: Twitter API returned a 403 (Forbidden), Tweet needs to be a bit shorter.

Is there a workaround for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions