Skip to content

Instantly share code, notes, and snippets.

@brandur brandur/releases.rb
Created Dec 27, 2013

What would you like to do?
Heroku app releases this year
require "json"
require "time"
# usage: releases.rb <app>
def get_releases(app)
# use curl for -n
JSON.parse(`curl --silent -n -H "Accept: application/vnd.heroku+json; version=3" -H "Range: seq ..; order=desc, max=1000"{app}/releases`)
app = ARGV[0] || abort("usage: releases.rb <app>")
data = get_releases(app)
num_releases = data.count { |r|
Time.parse(r["created_at"]).year ==
puts "#{num_releases} releases in #{}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.