├── Procfile ├── web.rb ├── Gemfile ├── Rakefile ├── README.md └── Gemfile.lock /Procfile: -------------------------------------------------------------------------------- 1 | web: bundle exec ruby web.rb -p $PORT -------------------------------------------------------------------------------- /web.rb: -------------------------------------------------------------------------------- 1 | require 'sinatra' 2 | 3 | get '/' do 4 | "Hello, world" 5 | end -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source :rubygems 2 | 3 | gem 'sinatra' 4 | gem 'thin' 5 | gem 'httparty' -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'httparty' 3 | 4 | task :cron do 5 | url = ENV['WEBHOOK'] 6 | method = ENV['METHOD'] || "GET" 7 | 8 | HTTParty.send(method.downcase, url) if url 9 | end -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | HeroCron 2 | ======== 3 | 4 | Herocron is an easy way to use a free Heroku project with the daily cron, to call a webhook every day. 5 | 6 | Usage 7 | ===== 8 | 9 | $ git clone git@github.com:dv/herocron.git 10 | $ heroku create --stack cedar 11 | $ heroku addons:add cron 12 | $ heroku config:add "WEBHOOK=http://hookscope.herokuapp.com/hook/herocron" 13 | $ git push heroku master 14 | 15 | 16 | Config 17 | ====== 18 | 19 | You can select a different method to use instead of the default GET: 20 | 21 | $ heroku config:add METHOD=POST 22 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: http://rubygems.org/ 3 | specs: 4 | daemons (1.1.8) 5 | eventmachine (0.12.10) 6 | httparty (0.8.3) 7 | multi_json (~> 1.0) 8 | multi_xml 9 | multi_json (1.3.4) 10 | multi_xml (0.4.4) 11 | rack (1.4.1) 12 | rack-protection (1.2.0) 13 | rack 14 | sinatra (1.3.2) 15 | rack (~> 1.3, >= 1.3.6) 16 | rack-protection (~> 1.2) 17 | tilt (~> 1.3, >= 1.3.3) 18 | thin (1.3.1) 19 | daemons (>= 1.0.9) 20 | eventmachine (>= 0.12.6) 21 | rack (>= 1.0.0) 22 | tilt (1.3.3) 23 | 24 | PLATFORMS 25 | ruby 26 | 27 | DEPENDENCIES 28 | httparty 29 | sinatra 30 | thin 31 | --------------------------------------------------------------------------------