-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(channels): Add support for Threads #618
Conversation
for more information, see https://pre-commit.ci
TWITTER_ACCESS_TOKEN="" | ||
TWITTER_ACCESS_TOKEN_SECRET="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were removed because they weren't used anymore, as discussed with @ERosendo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. We should definitely clean up the settings module as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave it a quick skim. Looks about right, generally!
One thing to consider is the png->jpeg code we discussed today. My instinct on the call was that Doctor should be producing jpeg thumbnails for you instead of pngs, but jpeg is an inferior format for this and I wouldn't want to post jpegs on BlueSky or Twitter, where PNG makes more sense. So I think that means you could:
- Call doctor to get png thumbnails for those, then...
- Call doctor to get jpegs for threads
Or:
- Call doctor for the pngs, then...
- Convert them here.
Honestly, the latter seems easier and you've got the code. !
I'm also a bit curious about your use of envs, but I'll let Eduardo chime in on that if we need changes there.
Finally, can you please open an issue to update our website to put the threads info on it in all the right places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elisa-a-v The code looks great! Just wanted to point out a couple of things we might have missed when creating this to-do list:
-
Threads logo: We need to add an
SVG
file for the Threads logo (the one we use in buttons). These files usually go in theinline
folder inside theincludes
directory of theassets
folder. -
Follow button template: The
follow-button.html
template needs to be updated to use theSVG
file mentioned above. This fragment is used in the detail page for the little cases bot. For reference, I've included the red rendered by this template below:We need the logo to make the button look complete:
-
AWS Credentials: I encountered some issues while setting up the AWS credentials. This might be a good opportunity to revisit our approach and potentially align it with the method used for courtlistener. Here's the relevant issue in courtlistener for reference: Error 403 in development environment when uploading files to S3 courtlistener#4018
-
Token Refresh Mechanism: This PR introduces a script to generate our initial long-lived tokens. However, it currently lacks a mechanism for automatic token refresh before expiration.
We can merge this PR as-is and create a separate issue to address the token refresh functionality. However, We should prioritize and implement this mechanism before our tokens expire.
Co-authored-by: Eduardo Rosendo <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Exciting. Shall I merge and what's the best strategy for launching? |
Sure! If you both approved, go for it.
Well, I'm not sure what you mean, I guess the first step would be to create a big cases Thread account if there isn't one, then run the script and create the new channel. Oh and btw, you asked me to open an issue to add the Threads bot info to the website and everywhere else it should be displayed, should I open that issue in this same repo or a different one? |
Merged! Here we go, thank you! For launching, I do mean how we create the accounts, set them up, etc, all that fun stuff. I'm happy to help if needed, but ideally we'd have this documented on the wiki, and it'd be something I wouldn't need to be too involved in? Maybe Gianfranco can help instead since he has server access? Yep, the issue for adding threads info the website should go here. :) |
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
@mlissner Elisa created a new wiki page that outlines the steps needed to create a Threads app and get values for new environment variables. https://github.com/freelawproject/bigcases2/wiki/One%E2%80%90Time-Setup-to-enable-Threads |
Addresses this issue
This PR introduces full integration with the Threads API, allowing the bots to post directly to Threads.
Considerations
<BUCKET_NAME>
,<AWS_ACCOUNT_ID>
, and<USER>
with the username for the IAM user whose credentials are specified in the AWS.env
variables (AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
).THREADS_BUCKET_NAME
andTHREADS_BUCKET_ZONE
.threads_basic
andthreads_content_publish
in your app.Threads Tester
Role with the Threads user for the bot.THREADS_APP_ID
andTHREADS_APP_SECRET
to the.env
filescripts/get-threads-keys.py
and follow the instructions which will provide the credentials to create a Channel via Django admin.TO DO: