Skip to content

Instantly share code, notes, and snippets.

@cntanos
Forked from jarib/anon-heroku.sh
Last active April 21, 2016 12:58
Show Gist options
  • Save cntanos/12deefe61c65b4859b29d6d0d90946da to your computer and use it in GitHub Desktop.
Save cntanos/12deefe61c65b4859b29d6d0d90946da to your computer and use it in GitHub Desktop.

anon Windows and Linux scripts for Heroku Deployment

Deployment of anon, a little coffee script that will watch Wikipedia for edits from a set of named IP ranges and will tweet when it notices one, in Heroku. The fork comes from jarib and I've added the windows batch file.

##Requirements

You have to have created a Twitter App and have the credentials ready (consumer_key, consumer_secret, access_token and access_token_secret), in order to add them to the config.json when asked. Read anon documentation to see how to add IP address ranges there.

You need to have a Heroku account and to have installed Toolbelt.

@echo off
call heroku login
SET /P repositoryname=Enter the name of the repository:
git clone https://github.com/edsu/anon %repositoryname%
cd %repositoryname%
copy config.json.template config.json
echo config.json>.gitignore
echo Please add your config to %CD%\config.json before continuing
pause
call heroku create
echo worker: coffee anon.coffee> Procfile
git add -f Procfile config.json .gitignore
git commit -m "Added Procfile and config"
git push heroku master
heroku ps:scale web=0 worker=1
#!/bin/bash
set -e
git clone https://github.com/edsu/anon my-anon
cd my-anon
cp config.json.template config.json
read -p "Please add your config to $(pwd)/config.json, then press enter to continue"
heroku create
echo 'worker: coffee anon.coffee' > Procfile
git add Procfile config.json
git commit -m "Added Procfile and config"
git push heroku master
heroku ps:scale worker=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment