Skip to content

Latest commit

 

History

History
122 lines (84 loc) · 2.46 KB

INSTALLATION.md

File metadata and controls

122 lines (84 loc) · 2.46 KB

Installation

Node.js (>=14)

FFMPEG

twspace-crawler

  • Install twspace-crawler

    npm i -g twspace-crawler
    
  • Clone/Create .env file

    TWITTER_AUTHORIZATION=
    TWITTER_AUTH_TOKEN=
    
    • You need to set 1 of them for better Spaces look up

Official API

Using TWITTER_AUTHORIZATION

  1. Getting access to the Twitter API

  2. Navigate to Projects & Apps to create new app (or use existing app)

  3. Get app Bearer Token in Keys and tokens tab

  4. Set TWITTER_AUTHORIZATION value

    TWITTER_AUTHORIZATION=Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs...
    

Unofficial API

Using TWITTER_AUTH_TOKEN & TWITTER_CSRF_TOKEN (REQUIRED)

  1. Sign in Twitter

  2. Press F12 to open dev tools

  3. Select Application tab

  4. Select Storage > Cookies > https://twitter.com

  5. Clone .env.example and rename to .env

  6. Copy auth_token and set to TWITTER_AUTH_TOKEN

  7. Copy ct0 and set to TWITTER_CSRF_TOKEN

    TWITTER_AUTH_TOKEN=456472d2...
    TWITTER_CSRF_TOKEN=05f85936...
    
  8. Clone/Create config.yaml or config.json file

  9. Start app

    twspace-crawler --env ./.env --config ./config.json --force-open
    

twspace-crawler with pm2

  • Install pm2

    npm i -g pm2
    
  • Clone/Create ecosystem.config.js file

    module.exports = {
      apps: [
        {
          name: 'twspace-crawler',
          script: 'twspace-crawler',
          args: '--env ./.env --config ./config.json --force-open',
          env: {
            NODE_ENV: 'production',
          },
        },
      ],
    }
    
  • Start app

    pm2 start ecosystem.config.js
    

https://pm2.keymetrics.io/docs/usage/startup/