- Add Heroku to your Gemfile and
bundle install
. - Create your Heroku app. This will only work with their (currently-beta)
'cedar' stack, so you have to
heroku create --stack=cedar
. - Create a Procfile for your bot. This tells Heroku how to run your worker. In
our case, the bot is bot.rb, so the only line in the Procfile is
cinch: bundle exec ./bot.rb
- Commit and push to Heroku.
- You do not want a Web worker running, so
heroku scale web=0 cinch=1
. This also sets up your deployments to restart the bot.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'net/http' | |
require 'uri' | |
require 'rbconfig' | |
require 'io/console' | |
puts "Enter Username:" | |
@username = gets.chomp | |
puts "Enter Password (input will be hidden):" | |
@password = STDIN.noecho(&:gets).chomp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net/http" | |
"database/sql" | |
"fmt" | |
"log" | |
"os" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net/http" | |
"database/sql" | |
"fmt" | |
"log" | |
"os" | |
) |