chore: remove TWITTER_COOKIES env var #1288
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Relates to:
No issue ticket, just a improvement, ease of setup change I noticed.
Risks
LOW - Twitter may not login? But tested with clearing cache and cached, working great.
Background
What does this PR do?
This PR removes the .env variable TWITTER_COOKIES and simply uses twitterScraper to manage cookies on login better from cache.
It also removes the docs / readme step where user has to provide the JSON array of TWITTER_COOKIES.
Side win: the looping try-catch while loop is cleaner to read, deleted many lines of code in simpler implementation for twitter auth.
What kind of change is this?
Improvements
Why are we doing this? Any context or related work?
TWITTER_COOKIES env var is an added complexity not required, users have to go searching in dev-tools console
document.cookie
and rearrange their JSON and add to ENV. But, twitter-scraper client has support for login + fetch current cookies on it's own. It is a redundant ENV setup that can be removed to simplify the twitter agent setup process for all users.I recently implemented twitter-scapper-client in my own custom agent and never had todo this ENV setup, I saw it as a EZ win for Eliza community to port over.
Documentation changes needed?
If a docs change is needed: I have updated the documentation accordingly.
I have removed the TWITTER_COOKIES docs sections, full deletion, no longer needed.
Please show how you tested the PR. This will really help if the PR needs to be retested, and probably help the PR get merged quicker.
I also ran:
To delete the cookies from cache manually to verify my code was working.
Testing
Where should a reviewer start?
Remove TWITTER_COOKIES from .env and see if Twitter agent boots correctly and works from fresh cache and already cached.
Detailed testing steps
None, automated tests are fine.
Deploy Notes
Remove TWITTER_COOKIES from any CI / CD and .env test runners.
Discord username
cjft