A twitter bot that mashes lyrics and tweets them.
The goal here was to make something more lightweight than twitter-ebooks, and I think we got it!
- Clone this repo. (
git clone https://github.com/moriczgergo/lyrmash
) - Install packages. (
npm i
) - Set up your Genius app.
- Set up your Twitter app.
- Set up your envfile.
- Build your image.
- (Create a Genius account if you haven't.)
- Create a new API Client. (leave Redirect URI blank)
- Click on
Genereate Access Token
, and take note of it. (You won't need the Client ID & Secret.)
- (Create a Twitter account for your bot if you haven't.)
- Create a new Twitter App. (leave Callback URL blank)
- Click on
Keys and Access Tokens
. - Take note of the Consumer Key and Secret.
- On the bottom of the page, click
Create my access token
. - Take note of the Access Token and Secret.
Lyrmash uses a .env
file to import environment variables into the app. You should create a .env file, and fill it like this:
LYRMASH_KEY=<TWITTER CONSUMER KEY>
LYRMASH_SECRET=<TWITTER CONSUMER SECRET>
LYRMASH_TOKEN=<TWITTER ACCESS TOKEN KEY>
LYRMASH_TOKEN_SECRET=<TWITTER ACCESS TOKEN SECRET>
Note: your .env file won't be included in your Docker image.
To build your image, you'll have to run the following command:
docker build --build-arg "LYRMASH_GENIUS=<YOUR GENIUS ACCESS TOKEN>" --build-arg "LYRMASH_AID=<GENIUS ARTIST ID TO GET SONGS FROM>" -t <YOUR NAME>/<YOUR IMAGE NAME> .
WARNING: This will possibly leak your Genius access token via docker history
. We don't have a solution for this yet.
After the build runs, the container will fail and won't start automatically, but we'll solve that.
docker run --env-file .env -d <YOUR NAME>/<YOUR IMAGE NAME>
When we specify the environment file, it works!
- Clone this repo. (
git clone https://github.com/moriczgergo/lyrmash
) - Install packages. (
npm i
) - Set up your Genius app.
- Set up your Twitter app.
- Set up your envfile.
- Scrape the lyrics.
- Run with
npm start
!
You need to scrape lyrics via Genius, to create mashed up versions.
npm run scrape -- "<YOUR GENIUS ACCESS TOKEN>" "<GENIUS ARTIST ID>"
This will look up all the songs from the specified artist, and dump the lyricis into dump.txt
for the bot to use.
You want to mash up custom lyrics, or not even lyrics? You're crazy. Anyways, you'll need to modify dump.txt
in the app directory. Every sentence needs to end with a dot, question mark, or exclamation mark. Seperate sentences with spaces, not newlines.
Have fun!