Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/genesis331/twittercard
Twittercard creates beautiful Twitter tweet images.
https://github.com/genesis331/twittercard
docker javascript nodejs twitter
Last synced: 21 days ago
JSON representation
Twittercard creates beautiful Twitter tweet images.
- Host: GitHub
- URL: https://github.com/genesis331/twittercard
- Owner: genesis331
- License: apache-2.0
- Created: 2022-06-06T03:32:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-02T04:56:18.000Z (almost 2 years ago)
- Last Synced: 2023-03-05T12:18:41.491Z (over 1 year ago)
- Topics: docker, javascript, nodejs, twitter
- Language: HTML
- Homepage:
- Size: 327 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Introduction
Twittercard creates beautiful Twitter tweet images.# Development
This section describes the process for running the application on a local environment.### Getting Started
You'll need NodeJS to run the app. To install NodeJS, [get the installer from nodejs.org](https://nodejs.org).Once you've installed Node.js (which includes the popular `npm` package manager), launch a Terminal and run the following commands:
```sh
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](http://localhost:3000) in your browser.
When you're ready to stop your local server, type Ctrl+C in your terminal window.
# Usage
- [Basic example](#basic-example)
- [Enable dark mode](#enable-dark-mode)## Basic example
Make a GET request to `/image` & provide a tweet ID to `id` parameter.
```
https://domain.com/image?id=1250966843545640960
```## Enable dark mode
Add the `darkMode=true` parameter to the URL.
```
https://domain.com/image?id=1250966843545640960&darkMode=true
```## Inspect HTML
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.# Self-Hosting
1. Pull the latest Docker image from GitHub Packages
```
docker pull ghcr.io/genesis331/twittercard:latest
```
2. 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!