vshjxyz / better-zoo-server

Downloads mp3s, compresses them and upload the compressed result to S3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

better-zoo-server

Build Status

This little experimental project aims to hit a URL with one or more public MP3 files, downloads it, compresses it using Sox and uploads it to an S3 bucket

Setup

Install Sox with lame bindings (on mac brew install sox --with-lame) to deal with MP3s.

cd better-zoo-server
nvm install && nvm use # You can skip this if you're already using node v7.7.+
npm i -g yarn
yarn

Run

yarn start          # This will rip the MP3 based on the current day
yarn start 20170512 # This will rip the MP3 for a specific day

You should see: better-zoo download

Deploy

The project uses terraform to create an s3 bucket and link it to a free heroku node

I've written a couple of scripts to deal with terraform state plan & apply (it requires heroku toolbelt to be installed with the current user logged in).

You can try to use them on your own but you will need aws credentials available as env variables or you can create a ~/.aws/credentials file with something similar to:

aws_access_key_id = <your access key>
aws_secret_access_key = <your secret>
aws_default_region = eu-west-1

Then from the terraform folder you can launch ./scripts/terraform_plan.sh to create a precise updating plan and ./scripts/terraform_apply.sh to apply it (that will create an aws IAM user, an access key, an s3 bucket and an heroku node).

About

Downloads mp3s, compresses them and upload the compressed result to S3


Languages

Language:JavaScript 71.1%Language:Dockerfile 14.1%Language:HCL 13.5%Language:Shell 1.4%