Twittercard creates beautiful Twitter tweet images.
This section describes the process for running the application on a local environment.
You'll need NodeJS to run the app. To install NodeJS, get the installer from nodejs.org.
Once you've installed Node.js (which includes the popular npm
package manager), launch a Terminal and run the following commands:
git clone https://github.com/genesis331/twittercard.git
npm install
npm start
Create an .env
file and include your Twitter API Authorization Bearer Token, following the format provided below.
TWITTER_AUTH_TOKEN={YOUR_TOKEN_HERE}
Do not include the curly braces!
Visit localhost:3000 in your browser.
When you're ready to stop your local server, type Ctrl+C in your terminal window.
Make a GET request to /image
& provide a tweet ID to id
parameter.
https://domain.com/image?id=1250966843545640960
Add the darkMode=true
parameter to the URL.
https://domain.com/image?id=1250966843545640960&darkMode=true
Perform a GET request to /html
to return a HTML.
https://domain.com/html?id=1250966843545640960
You may also add the
darkMode=true
parameter to enable dark mode.
- Pull the latest Docker image from GitHub Packages
docker pull ghcr.io/genesis331/twittercard:latest
- Run the Docker image
docker run -d --restart unless-stopped -p {PREFERRED_PORT}:3000 --name twittercard -v /{VOLUME_NAME}:/twittercardtemp -e TWITTER_AUTH_TOKEN={YOUR_TOKEN_HERE} ghcr.io/genesis331/twittercard:latest
Again, do not include the curly braces!