This tool scrapes the message history from a specific Twitter group message and exports it as json.
- Install Node 12 via NVM: https://github.com/nvm-sh/nvm
- Run
npm install
- Set the following Env vars for configuration:
export TWITTER_USER=benmarten
export TWITTER_USER=<YOUR_PASSWORD>
export TWITTER_MESSAGE_ID=1315655381037838337
The message id, is the id in the url: https://twitter.com/messages/1315655381037838337
Run the script via: node index.js
You can simply convert the exported json to csv via json2csv: npm i -g json2csv
json2csv -i messages.json messages.csv -f timestamp,author,text,url -o messages.csv
Now you can simply import the csv to Google Sheets, etc.
You can debug and connect node to an existing browser via: Start Chrome:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --no-first-run --no-default-browser-check --user-data-dir=(mktemp -d -t 'chrome-remote_data_dir')
Copy the ws url.
- Set the following Env vars for configuration:
export NODE_ENV=DEBUG
export WS=<WS_URL>
Feel free to report issues or send PR's ;)