twitter-cookie
v1.0.3
Published
A simple utility to get twitter cookies (as JSON array). Can be used for initialize twitter client (agent-twitter-client or @the-convocation/twitter-scraper)
Maintainers
Readme
Twitter Cookie Extractor
A simple utility to help you extract your Twitter (X) cookies in JSON format, making it easy to use with libraries like agent-twitter-client or @the-convocation/twitter-scraper.
Why Use This?
Many Twitter API alternatives require your browser cookies to authenticate requests. This tool simplifies the process of extracting those cookies in the correct format.
Installation
npm install -g twitter-cookieUsage
twitter-cookie <username> <password>Or simply without installation:
npx twitter-cookie <username> <password>Your cookies will be printed to the console as JSON array. You can then use it to initialize the Scraper class from agent-twitter-client or @the-convocation/twitter-scraper.
Example
import { Scraper } from "agent-twitter-client";
const scraper = new Scraper();
await scraper.setCookies(cookies);
// use scraper to do something...Security Note
Keep your cookie file secure and never share it. These cookies provide full access to your Twitter account.
License
MIT License
