Closed proofconstruction closed 2 years ago
@AlphaPL resolved the underlying issue in tweet.py
are part PR #11. Now @shotor is going to try to hook this up into the daily build pipeline.
@jboarman @AlphaPL I implemented the Github action. I get a 200 on the auth request, but the upload is failing:
Failed: [Errno Expecting value] : 0
https://github.com/sparkfish/shabby-pages/runs/6406624856?check_suite_focus=true#step:6:135 https://github.com/sparkfish/shabby-pages/blob/dev/tweet.py#L60
What I did:
Is there a step I'm missing?
In case I'm not around I also added a manual trigger for the daily build. Github Actions -> Tag Action -> Daily Tag -> Run workflow ->
Thanks @shotor!
Is there a simple way to let that script error bubble up to cause the overall build to fail (so we don't silently ignore this once the issue gets fixed but then recurs again in the future)?
After making a few changes to the tweet.py
script, this is now running successfully (and flags the build as a failure when it does not).
The
tweet.py
script currently doesn't work, failing with a431 Request Header Fields Too Large
response status code when trying to upload media.This might be a problem with the image size being too big (some Augraphy outputs are quite large and could overrun Twitter's 5MB limit on image size), which should be checked.
The desired response to that request should be a media ID that uniquely refers to the piece of media uploaded. This is added to the payload later when posting a tweet, attaching the media with that ID to that tweet:
Note: Twitter has two API versions, but currently we're just using the v1.1 API (or trying to). Another option which the Tweepy library uses is posting the image to the v1.1 API (images currently cannot always be posted to the v2 API) and then posting the tweet to the v2 API. I explored this previously but ran into other issues.