Bypass paywalled APIs to crosspost from Twitter to Mastodon
This repository has been archived on 2025-03-19. You can view files and clone it, but cannot push or open issues or pull requests.
Find a file
Penelope Gomez / Pogmommy 9431eaf3e7
Add files via upload
2023-02-07 11:33:59 -07:00
config.txt Add files via upload 2023-02-07 06:44:43 -07:00
null Add files via upload 2023-02-07 06:44:43 -07:00
package-lock.json Add files via upload 2023-02-07 06:44:43 -07:00
package.json Add files via upload 2023-02-07 06:44:43 -07:00
README.md Update README.md 2023-02-07 06:46:24 -07:00
TwitToMast.js Add files via upload 2023-02-07 11:33:59 -07:00
URLList.csv Add files via upload 2023-02-07 06:44:43 -07:00

TwitToMast

Bypass paywalled APIs to crosspost from Twitter to Mastodon

Installation:

  1. Clone the repo and set up the script's dependencies
git clone https://github.com/pogmom/TwitToMast.git
cd TwitToMast
npm install
  1. Install Chrome Webdriver and set up your PATH as outlined in Step 3 here

  2. Retrieve your Mastodon API Key

    • From your Mastodon Account, go to Preferences > Development > New Application
    • Enter any name you'd like, press "submit"
    • You should see the application with the name you just gave it in your applications list
    • Click on its name, and copy the string of text to the right of where it says "Your Access Token"
  3. Update config.txt with your Mastodon account settings

    • Replace "API_KEY" on line 1 with the Access Token you retrieved in the previous step
    • Replace "API_URL" on line 2 with your Mastodon instance's API URL
    • Line 3 determines whether or not quote tweets will be sent to Mastodon
      • true: Quote tweets will be sent to Mastodon
      • false: Quote tweets will not be sent to Mastodon
    • Line 4 determines whether or not tweets that are part of threads will be sent to Mastodon
      • true: Thread tweets will be sent to Mastodon
      • false: Thread tweets will not be sent to Mastodon
    • While they can be independently configured, it's recommended that Lines 3 and 4 are set to the same value

Usage

node ./TwitToMast.js [username] [tweet count] [debug level]
  • username: the twitter handle of the user whose account will be scraped
  • tweet count: the number of enabled tweets that will be scraped from the targeted account
  • debug level: Level of output that will be printed on screen.
    • 1: The program will print what tasks it is working on and errors, but nothing more.
    • 2: The program will print what tasks it is working on and errors, as well as various other information necessary for troubleshooting.
    • Omit this argument for the program to run silently (no output on screen)

Other important details

  • This program does not run on a loop on its own. If you need it to run automatically, you'll need to find a way to schedule the script to be executed periodically.