Skip to content

Instantly share code, notes, and snippets.

@AquaGeek
Last active September 26, 2023 01:34
Show Gist options
  • Save AquaGeek/7ad88eb50e6c0b82c7d7 to your computer and use it in GitHub Desktop.
Save AquaGeek/7ad88eb50e6c0b82c7d7 to your computer and use it in GitHub Desktop.
Heroku Addons Breakdown
require 'uri'
require 'net/http'
require 'json'
require 'ostruct'
module Heroku
module Addons
class Addon
attr_accessor :name
def initialize(attrs)
@name = attrs['name']
end
end
class AddonPlan
attr_accessor :description, :price, :unit
def initialize(attrs)
@description = attrs['description']
@price = attrs['price']['cents'] / 100.0
@unit = attrs['price']['unit']
end
def full_price
"$#{'%.2f' % price}/#{unit}"
end
end
class Client
def initialize
uri = URI.parse("https://api.heroku.com/")
@http = Net::HTTP.new(uri.host, uri.port)
@http.use_ssl = true if uri.scheme == 'https'
@headers = {
'Accept' => 'application/vnd.heroku+json; version=3'
}
end
def request(path, headers={})
response = @http.get(path, @headers.merge(headers))
JSON.parse response.body
end
end
@client = Client.new
# Loads all the available addons from Heroku
def self.all
@client.request('/addon-services').map { |addon| Addon.new(addon) }
end
def self.plans(addon)
@client.request("/addon-services/#{addon}/plans").map { |plan| AddonPlan.new(plan) }
end
end
end
addons = Heroku::Addons.all
addons.each do |addon|
name = addon.name
plans = Heroku::Addons.plans(name)
puts name
plans.sort_by(&:price).each do |plan|
puts " #{plan.description}: #{plan.full_price}"
end
end
adept-scale
Adept Scale VIP: $0.00/month
Adept Scale Skiff: $18.00/month
Adept Scale Corvette: $36.00/month
Adept Scale Destroyer: $54.00/month
Adept Scale Cruiser: $90.00/month
Adept Scale Battleship: $144.00/month
Adept Scale Dreadnaught: $360.00/month
adminium
Adminium Pet Project: $0.00/month
Adminium Startup: $10.00/month
Adminium Enterprise: $25.00/month
airbrake
Airbrake Developer: $9.00/month
Airbrake Production: $25.00/month
Airbrake Production Pro: $130.00/month
Airbrake Enterprise Production: $650.00/month
algoliasearch
Algolia Realtime Search Free: $0.00/month
Algolia Realtime Search Starter: $49.00/month
Algolia Realtime Search Growth: $149.00/month
Algolia Realtime Search Pro: $449.00/month
appsignal
AppSignal Testing: $0.00/month
AppSignal Developer: $12.00/month
AppSignal Small: $35.00/month
AppSignal Medium: $79.00/month
AppSignal Large: $169.00/month
auth0
Auth0 Developer: $0.00/month
Auth0 Team: $19.00/month
Auth0 Pro: $99.00/month
Auth0 Big: $499.00/month
bablic
Bablic Test: $0.00/month
bernoulli
Bernoulli Test: $0.00/month
blazemeter
BlazeMeter Test: $0.00/month
blitline
Blitline Developer Package: $0.00/month
Blitline Deployer: $12.99/month
Blitline Producer: $35.99/month
Blitline Rockstar: $65.99/month
Blitline Imagga: $69.00/month
Blitline Gold: $119.00/month
Blitline Platinum: $499.00/month
blitz
Blitz 250: $0.00/month
Blitz 1000: $799.00/month
Blitz 5000: $1299.00/month
blowerio
Blower.io Test: $0.00/month
bomberman
Bomberman TNT: $0.00/month
Bomberman A-Bomb: $5.00/month
Bomberman H-Bomb: $15.00/month
Bomberman F-Bomb: $45.00/month
bonsai
Bonsai Elasticsearch Starter: $0.00/month
Bonsai Elasticsearch Staging: $10.00/month
Bonsai Elasticsearch Production: $50.00/month
Bonsai Elasticsearch Business: $150.00/month
Bonsai Elasticsearch Enterprise: $450.00/month
Bonsai Elasticsearch Ultimate: $900.00/month
boomerang
Boomerang.io Test: $0.00/month
bounscale
Bounscale Test: $0.00/month
bugsnag
Bugsnag Tauron: $0.00/month
Bugsnag Sagittaron: $9.00/month
Bugsnag Virgon: $29.00/month
Bugsnag Gemenon: $49.00/month
Bugsnag Scorpia: $99.00/month
Bugsnag Picon: $249.00/month
Bugsnag Caprica: $499.00/month
cameratag
CameraTag Free: $0.00/month
cdn_sumo
CDN Sumo Hacker: $5.00/month
CDN Sumo Boss: $25.00/month
CDN Sumo Pro: $100.00/month
CDN Sumo Mega: $500.00/month
chargify
Chargify Developer: $0.00/month
Chargify New Idea: $65.00/month
Chargify Small Business: $129.00/month
Chargify Small Business Plus: $169.00/month
Chargify Growing Business: $459.00/month
Chargify Big Business: $1299.00/month
Chargify Big Business Plus: $1699.00/month
circleci
CircleCI Test: $0.00/month
cleardb
ClearDB MySQL Database Ignite: $0.00/month
ClearDB MySQL Database Punch: $9.99/month
ClearDB MySQL Database Drift: $49.99/month
ClearDB MySQL Database Scream: $99.99/month
ClearDB MySQL Database Nitro: $199.99/month
ClearDB MySQL Database Custom 50/50: $499.00/month
cloudamqp
CloudAMQP Little Lemur: $0.00/month
CloudAMQP Tough Tiger: $19.00/month
CloudAMQP Big Bunny: $99.00/month
CloudAMQP Roaring Rabbit: $299.00/month
CloudAMQP Power Panda: $499.00/month
CloudAMQP Awesome Ape: $999.00/month
cloudant
Cloudant Data Layer as a Service Oxygen: $0.00/month
Cloudant Data Layer as a Service Argon: $15.00/month
Cloudant Data Layer as a Service Neon: $39.00/month
Cloudant Data Layer as a Service Helium: $119.00/month
Cloudant Data Layer as a Service Xenon: $249.00/month
Cloudant Data Layer as a Service Krypton: $399.00/month
Cloudant Data Layer as a Service Radon: $599.00/month
Cloudant Data Layer as a Service Carbon: $999.00/month
cloudinary
Cloudinary Starter: $0.00/month
Cloudinary Bronze: $50.00/month
Cloudinary Silver: $120.00/month
Cloudinary Gold: $280.00/month
Cloudinary Titanium: $600.00/month
Cloudinary Platinum: $1200.00/month
cloudmailin
CloudMailIn Developer: $0.00/month
CloudMailIn Micro: $9.00/month
CloudMailIn Micro Plus: $17.00/month
CloudMailIn Starter: $25.00/month
CloudMailIn Professional: $45.00/month
CloudMailIn Premium: $85.00/month
CloudMailIn Corporate 100k: $199.00/month
CloudMailIn Corporate 500k: $399.00/month
cloudmqtt
CloudMQTT Test: $0.00/month
cloudvertical
CloudVertical Test: $0.00/month
codeship
Codeship Free: $0.00/month
Codeship Basic: $49.00/month
Codeship Plus: $99.00/month
Codeship Pro: $149.00/month
Codeship Premium: $249.00/month
Codeship Ultimate: $499.00/month
cornerstore
Cornerstore Test: $0.00/month
dbinsights
DbInsights Starter: $5.00/month
DbInsights Basic: $20.00/month
DbInsights Standard: $40.00/month
deadmanssnitch
Dead Man's Snitch Test: $0.00/month
deployhooks
Deploy Hooks Basecamp Hook: $0.00/month
Deploy Hooks Campfire Hook: $0.00/month
Deploy Hooks Email Hook: $0.00/month
Deploy Hooks HipChat Hook: $0.00/month
Deploy Hooks HTTP Post Hook: $0.00/month
Deploy Hooks IRC Hook: $0.00/month
docraptor
DocRaptor Starter: $0.00/month
DocRaptor Basic: $19.00/month
DocRaptor Professional: $37.00/month
DocRaptor Premium: $95.00/month
DocRaptor Max: $189.00/month
dyn
Dyn: DynECT Managed DNS Lite 10: $30.00/month
Dyn: DynECT Managed DNS Lite 25: $60.00/month
Dyn: DynECT Managed DNS Lite 50: $95.00/month
ebookglue
Ebook Glue Test: $0.00/month
eltanin
Eltanin Eye for Facebook Test: $0.00/month
errorapp
ErrorApp Test: $0.00/month
eshq
EventSource HQ Test: $0.00/month
exceptiontrap
Exceptiontrap Developer: $10.00/month
Exceptiontrap Small: $25.00/month
Exceptiontrap Basic: $49.00/month
expeditedssl
Expedited SSL Alpha: $1.00/month
Expedited SSL Single Domain: $10.00/month
Expedited SSL Wildcard: $20.00/month
filepicker
Ink file picker Develop: $0.00/month
Ink file picker Starter: $19.00/month
Ink file picker Big: $99.00/month
Ink file picker Grow: $99.00/month
Ink file picker Accelerate: $299.00/month
Ink file picker Scale: $499.00/month
flydata
FlyData Feather: $0.00/month
FlyData Hummingbird: $9.00/month
FlyData Sparrow: $24.00/month
FlyData Parrot: $49.00/month
FlyData Owl: $99.00/month
FlyData Pelican: $249.00/month
FlyData Hawk: $499.00/month
FlyData Eagle: $999.00/month
flying_sphinx
Flying Sphinx Wooden: $12.00/month
Flying Sphinx Ceramic: $55.00/month
Flying Sphinx Granite: $150.00/month
Flying Sphinx Marble: $300.00/month
fodaddon
FoD Test: $0.00/month
fortifyondemand
Fortify on Demand Test: $0.00/month
foundelasticsearch
Found Elasticsearch Chihuahua: $40.00/month
Found Elasticsearch Terrier: $60.00/month
Found Elasticsearch Chihuahua HA: $72.00/month
Found Elasticsearch Dachs: $105.00/month
Found Elasticsearch Terrier HA: $108.00/month
Found Elasticsearch Beagle: $180.00/month
Found Elasticsearch Dachs HA: $189.00/month
Found Elasticsearch Boxer: $310.00/month
Found Elasticsearch Beagle HA: $324.00/month
Found Elasticsearch Labrador: $550.00/month
Found Elasticsearch Boxer HA: $558.00/month
Found Elasticsearch Labrador HA: $990.00/month
Found Elasticsearch Husky: $995.00/month
Found Elasticsearch Husky HA: $1791.00/month
gamerocket
GameRocket Test: $0.00/month
gemfury
Gemfury Hello World: $0.00/month
Gemfury Solo: $9.00/month
Gemfury Garage: $25.00/month
Gemfury Startup: $100.00/month
Gemfury Enterprise: $450.00/month
goinstant
GoInstant Test: $0.00/month
graphenedb
GrapheneDB Test: $0.00/month
groupdocs
GroupDocs Test: $0.00/month
heroku-postgresql
Heroku Postgres Hobby Dev: $0.00/month
Heroku Postgres Dev: $0.00/month
Heroku Postgres Basic: $9.00/month
Heroku Postgres Hobby Basic: $9.00/month
Heroku Postgres Crane: $50.00/month
Heroku Postgres Standard Yanari: $50.00/month
Heroku Postgres Kappa: $100.00/month
Heroku Postgres Standard Tengu: $200.00/month
Heroku Postgres Ronin: $200.00/month
Heroku Postgres Premium Yanari: $200.00/month
Heroku Postgres Premium Tengu: $350.00/month
Heroku Postgres Fugu: $400.00/month
Heroku Postgres Standard Ika: $750.00/month
Heroku Postgres Ika: $800.00/month
Heroku Postgres Premium Ika: $1200.00/month
Heroku Postgres Zilla: $1600.00/month
Heroku Postgres Standard Baku: $2000.00/month
Heroku Postgres Baku: $3200.00/month
Heroku Postgres Premium Baku: $3500.00/month
Heroku Postgres Standard Mecha: $3500.00/month
Heroku Postgres Premium Mecha: $6000.00/month
Heroku Postgres Mecha: $6400.00/month
Heroku Postgres Enterprise Mecha: $15000.00/month
Heroku Postgres Enterprise Ryu: $30000.00/month
honeybadger
Honeybadger Development: $12.00/month
Honeybadger Small: $35.00/month
Honeybadger Medium: $149.00/month
Honeybadger Large: $499.00/month
hostedgraphite
Hosted Graphite Free: $0.00/month
Hosted Graphite Tiny: $19.00/month
Hosted Graphite Small: $49.00/month
Hosted Graphite Medium: $99.00/month
Hosted Graphite Large: $249.00/month
Hosted Graphite Magnum: $599.00/month
hypdf
HyPDF Nano: $0.00/month
HyPDF Milli: $15.00/month
HyPDF Kilo: $30.00/month
HyPDF Mega: $60.00/month
HyPDF Giga: $120.00/month
indexden
IndexDen Test: $0.00/month
intercom
Intercom Free: $0.00/month
Intercom Starter: $49.00/month
Intercom Full: $149.00/month
Intercom Extra: $449.00/month
iron_cache
IronCache Developer: $0.00/month
IronCache Small: $49.00/month
IronCache Medium: $149.00/month
IronCache Large: $499.00/month
iron_mq
IronMQ Developer: $0.00/month
IronMQ Small: $24.00/month
IronMQ Medium: $79.00/month
IronMQ Large: $199.00/month
IronMQ Pro-Silver: $495.00/month
IronMQ Pro-Gold: $1250.00/month
IronMQ Pro-Platinum: $2450.00/month
iron_worker
IronWorker Developer: $0.00/month
IronWorker Small: $24.00/month
IronWorker Medium: $79.00/month
IronWorker Large: $295.00/month
IronWorker Pro Silver: $695.00/month
IronWorker Pro Gold: $1750.00/month
IronWorker Pro Platinum: $3250.00/month
keen
Keen IO Developer: $0.00/month
Keen IO Startup: $20.00/month
Keen IO Growth: $125.00/month
Keen IO Premium: $300.00/month
Keen IO Professional: $600.00/month
Keen IO Business: $1000.00/month
Keen IO Enterprise: $2000.00/month
librato
Librato Development: $0.00/month
Librato Nickel: $19.00/month
Librato Bronze: $29.00/month
Librato Silver: $49.00/month
Librato Gold: $79.00/month
Librato Platinum: $169.00/month
Librato Iridium: $499.00/month
loaderio
loader.io Basic: $0.00/month
loader.io Pro: $99.95/month
logentries
Logentries TryIt: $0.00/month
Logentries Developer: $5.00/month
Logentries Starter: $15.00/month
Logentries Standard: $45.00/month
Logentries Premier: $99.00/month
Logentries Pro: $199.00/month
Logentries Deluxe: $399.00/month
Logentries Business: $799.00/month
Logentries Corporate: $1499.00/month
loggly
Loggly Mole: $0.00/month
Loggly Squirrel: $49.00/month
Loggly Gopher: $99.00/month
Loggly Woodchuck: $149.00/month
Loggly Beaver: $299.00/month
Loggly Capybara: $599.00/month
mail2webhook
Mail2Webhook Test: $0.00/month
mailgun
Mailgun Starter: $0.00/month
Mailgun Basic: $19.00/month
Mailgun Pro: $79.00/month
Mailgun Pro High Volume: $199.00/month
Mailgun Mailgun Exceptional Plan: $260.00/month
Mailgun 1 million: $500.00/month
Mailgun 2 million: $800.00/month
Mailgun 5 million: $1500.00/month
Mailgun Mailgun Airbrake Plan: $1950.00/month
mailtrap
Mailtrap by Railsware Free: $0.00/month
mandrill
Mandrill by MailChimp Starter: $0.00/month
Mandrill by MailChimp 40,000 Sends: $5.95/month
Mandrill by MailChimp 100,000 Sends: $19.95/month
Mandrill by MailChimp 300,000 Sends: $59.95/month
Mandrill by MailChimp 800,000 Sends: $189.95/month
Mandrill by MailChimp 2,000,000 Sends: $379.95/month
Mandrill by MailChimp 5,000,000 Sends: $849.95/month
Mandrill by MailChimp 10,000,000 Sends: $1499.95/month
memcachedcloud
Memcached Cloud 25MB: $0.00/month
Memcached Cloud 100MB: $14.00/month
Memcached Cloud 250MB: $24.00/month
Memcached Cloud 500MB: $39.00/month
Memcached Cloud 1GB: $66.00/month
Memcached Cloud 2.5GB: $160.00/month
Memcached Cloud 5GB: $290.00/month
Memcached Cloud 10GB: $540.00/month
memcachier
MemCachier Developer: $0.00/month
MemCachier 100 MB: $15.00/month
MemCachier 250 MB: $25.00/month
MemCachier 500 MB: $40.00/month
MemCachier 1 GB: $70.00/month
MemCachier 2.5 GB: $165.00/month
MemCachier 5 GB: $300.00/month
MemCachier 10 GB: $550.00/month
MemCachier 20 GB: $800.00/month
MemCachier 20GB-adikteev: $1100.00/month
mongohq
MongoHQ MongoHQ Sandbox: $0.00/month
MongoHQ 1 GB SSD: $18.00/month
MongoHQ 2 GB SSD: $36.00/month
MongoHQ 4 GB SSD: $72.00/month
MongoHQ 8 GB SSD: $144.00/month
MongoHQ 12 GB SSD: $216.00/month
MongoHQ 18 GB SSD: $324.00/month
MongoHQ 25 GB SSD: $450.00/month
MongoHQ 38 GB SSD: $684.00/month
MongoHQ 50 GB SSD: $900.00/month
MongoHQ 63 GB SSD: $1134.00/month
MongoHQ 75 GB SSD: $1350.00/month
MongoHQ 115 GB SSD: $2070.00/month
MongoHQ 150 GB SSD: $2700.00/month
mongolab
MongoLab Sandbox: $0.00/month
MongoLab Shared Single-node SM: $15.00/month
MongoLab Shared Single-node LG: $49.00/month
MongoLab Shared Cluster LG: $149.00/month
MongoLab Dedicated Cluster: $259.00/month
mongosoup
MongoSoup Test: $0.00/month
newrelic
New Relic Wayne: $0.00/month
New Relic Stark: $0.00/month
New Relic Hawke: $49.00/month
New Relic Drake: $99.00/month
New Relic Murdock: $159.00/month
New Relic Parker: $259.00/month
New Relic West: $399.00/month
New Relic Kent: $619.00/month
New Relic Banner: $1029.00/month
New Relic Marko: $1649.00/month
nodetime
Nodetime Free: $0.00/month
Nodetime Pro 5: $99.00/month
Nodetime Pro 25: $399.00/month
Nodetime Pro 100: $1199.00/month
openredis
openredis Micro: $10.00/month
openredis Small: $35.00/month
openredis Medium: $65.00/month
openredis Large: $125.00/month
openredis Extra: $250.00/month
openredis Huge: $500.00/month
openredis Giant: $700.00/month
pandastream
PandaStream Sandbox: $0.00/month
PandaStream Solo: $99.00/month
PandaStream Duo: $198.00/month
PandaStream Quad: $396.00/month
papertrail
Papertrail Choklad: $0.00/month
Papertrail Fixa: $7.00/month
Papertrail Ludvig: $15.00/month
Papertrail Forsta: $29.00/month
Papertrail Volmar: $65.00/month
Papertrail Liatorp: $125.00/month
Papertrail Fredrik: $375.00/month
Papertrail Numerar: $425.00/month
Papertrail Galant: $725.00/month
Papertrail Sparsam: $825.00/month
Papertrail Grundtal: $950.00/month
Papertrail Ungdom: $1135.00/month
Papertrail Torva: $1420.00/month
pgbackups
PG Backups Auto - One Month Retention: $0.00/month
PG Backups Auto - One Week Retention: $0.00/month
PG Backups Plus: $0.00/month
pgstudio
PostgreSQL Studio Test: $0.00/month
phrase
PhraseApp Free: $0.00/month
PhraseApp Silver: $50.00/month
PhraseApp Gold: $99.99/month
pointdns
PointDNS Developer: $0.00/month
PointDNS Small: $8.00/month
PointDNS Medium: $18.00/month
PointDNS Large: $50.00/month
postmark
Postmark 10,000 Messages: $0.00/month
Postmark 50,000 Messages: $75.00/month
Postmark 100,000 Messages: $150.00/month
Postmark 500,000 Messages: $500.00/month
Postmark 1,000,000 Messages: $750.00/month
Postmark 2,000,000 Messages: $1000.00/month
process-scheduler
Process Scheduler Pet Project: $0.00/month
Process Scheduler Startup: $18.00/month
Process Scheduler Enterprise: $54.00/month
Process Scheduler Megacorp: $90.00/month
proximo
Proximo Development: $5.00/month
Proximo Starter: $25.00/month
Proximo Professional: $75.00/month
Proximo Dedicated: $250.00/month
Proximo Elite: $500.00/month
Proximo Enterprise: $1250.00/month
pubnub
PubNub Galaxy Sandbox: $0.00/month
PubNub Galaxy Tier 1: $19.00/month
PubNub Galaxy Tier 2: $129.00/month
PubNub Galaxy Tier 3: $349.00/month
pusher
Pusher Sandbox: $0.00/month
Pusher Bootstrap: $19.00/month
Pusher Startup: $49.00/month
Pusher Big Boy: $199.00/month
Pusher Custom_10K: $398.00/month
Pusher Custom 20k: $799.00/month
Pusher Custom 30k: $1199.00/month
Pusher Custom 40k: $1599.00/month
quotaguard
QuotaGuard Starter: $0.00/month
QuotaGuard Freedom: $10.00/month
QuotaGuard Enterprise: $20.00/month
quotaguardstatic
QuotaGuard Static Starter: $0.00/month
QuotaGuard Static Spike: $5.00/month
QuotaGuard Static Micro: $19.00/month
QuotaGuard Static Medium: $49.00/month
QuotaGuard Static Large: $89.00/month
QuotaGuard Static Enterprise: $219.00/month
QuotaGuard Static Premium: $399.00/month
rabbitmq-bigwig
RabbitMQ Bigwig Pipkin: $0.00/month
RabbitMQ Bigwig Speedwell: $20.00/month
RabbitMQ Bigwig Toadflax: $100.00/month
RabbitMQ Bigwig Thunder: $400.00/month
ranger
Ranger Recon: $5.00/month
Ranger Elite: $25.00/month
rcmmndr
Rcmmndr Test: $0.00/month
rediscloud
Redis Cloud 25MB: $0.00/month
Redis Cloud 100MB: $10.00/month
Redis Cloud 250MB: $25.00/month
Redis Cloud 500MB: $52.00/month
Redis Cloud 1GB: $102.00/month
Redis Cloud 2.5GB: $252.00/month
Redis Cloud 5GB: $499.00/month
Redis Cloud 10GB: $899.00/month
Redis Cloud 25GB: $2149.00/month
Redis Cloud 50GB: $3500.00/month
redisgreen
RedisGreen Mini Development: $14.00/month
RedisGreen Development: $39.00/month
RedisGreen Starter: $89.00/month
RedisGreen Basic: $169.00/month
RedisGreen Plus: $269.00/month
RedisGreen Large: $449.00/month
RedisGreen Extra Large: $829.00/month
RedisGreen 2X Large: $1699.00/month
redismonitor
RedisMonitor Free: $0.00/month
RedisMonitor Basic: $19.00/month
RedisMonitor Plus: $99.00/month
redistogo
Redis To Go Nano: $0.00/month
Redis To Go Mini: $9.00/month
Redis To Go Rho Mobile Small VM: $15.00/month
Redis To Go Small: $39.00/month
Redis To Go Smedium: $75.00/month
Redis To Go Rho Mobile Large VM: $75.00/month
Redis To Go Medium: $169.00/month
Redis To Go Large: $390.00/month
Redis To Go Super: $1200.00/month
Redis To Go Mega: $4000.00/month
restful_metrics
RESTful Metrics Developer: $0.00/month
RESTful Metrics Small: $29.00/month
RESTful Metrics Medium: $79.00/month
RESTful Metrics Large: $299.00/month
RESTful Metrics X-Large: $999.00/month
robowhois
RoboWhois Test: $0.00/month
rollbar
Rollbar Free: $0.00/month
Rollbar Starter: $12.00/month
Rollbar Small: $49.00/month
Rollbar Medium: $149.00/month
Rollbar Large: $499.00/month
Rollbar Extra Large: $999.00/month
runtimeerror
RuntimeError Test: $0.00/month
ruppells-sockets
Ruppell's Sockets Test: $0.00/month
saaspose
Aspose for Cloud Test: $0.00/month
scheduler
Heroku Scheduler Standard: $0.00/month
searchbox
SearchBox Elasticsearch Starter: $0.00/month
SearchBox Elasticsearch Micro: $9.00/month
SearchBox Elasticsearch Small: $19.00/month
SearchBox Elasticsearch Advanced: $59.00/month
SearchBox Elasticsearch Professional: $99.00/month
SearchBox Elasticsearch Business: $199.00/month
SearchBox Elasticsearch Enterprise: $399.00/month
searchify
Searchify Hosted Search Small: $25.00/month
Searchify Hosted Search Plus: $49.00/month
Searchify Hosted Search Pro: $239.00/month
securekey
Secure Key Fortnightly: $0.00/month
semaphore
Semaphore Nano: $0.00/month
Semaphore Starter: $14.00/month
Semaphore Pro2: $59.00/month
Semaphore Pro3: $99.00/month
Semaphore Pro4: $149.00/month
Semaphore Pro8: $299.00/month
Semaphore Pro12: $449.00/month
Semaphore Pro16: $599.00/month
Semaphore Pro24: $799.00/month
sendgrid
SendGrid Starter: $0.00/month
SendGrid Bronze: $9.95/month
SendGrid Silver: $79.95/month
SendGrid 150K: $120.00/month
SendGrid 200K: $165.00/month
SendGrid Gold: $199.95/month
SendGrid 400K: $250.00/month
SendGrid 500K: $300.00/month
SendGrid 600K: $350.00/month
SendGrid Platinum: $399.95/month
SendGrid 800K: $445.00/month
SendGrid 900K: $490.00/month
SendGrid 1.0mil: $535.00/month
SendGrid 1.1mil: $580.00/month
SendGrid 1.2mil: $625.00/month
SendGrid 1.3mil: $670.00/month
SendGrid 1.4mil: $715.00/month
SendGrid Premier 1.5MM: $759.95/month
SendGrid Premier 2.5MM: $855.95/month
SendGrid 5mil: $1255.95/month
SendGrid 7.5mil: $1555.95/month
SendGrid 10mil: $1855.95/month
SendGrid 15mil: $2355.95/month
sentry
Sentry Developer: $0.00/month
Sentry Small: $24.00/month
Sentry Medium: $79.00/month
Sentry Large: $199.00/month
sharedworkforce
Shared Workforce 100 responses: $0.00/month
Shared Workforce 500 responses: $18.00/month
Shared Workforce 1000 responses: $36.00/month
Shared Workforce 2500 responses: $90.00/month
Shared Workforce 10000 responses: $360.00/month
signature
Signature Test: $0.00/month
spreedlycore
Spreedly Developer: $0.00/month
Spreedly Starter: $60.00/month
Spreedly Pro: $175.00/month
ssl
SSL Endpoint: $20.00/month
statsmix
StatsMix Developer: $0.00/month
StatsMix Basic: $24.00/month
StatsMix Standard: $49.00/month
StatsMix Pro: $99.00/month
StatsMix Premium: $199.00/month
StatsMix Enterprise: $499.00/month
statushub
StatusHub Test: $0.00/month
statuspage
StatusPage Hobby: $19.00/month
StatusPage Startup: $79.00/month
StatusPage Business: $249.00/month
stillalive
StillAlive Developer: $9.00/month
StillAlive Starter: $20.00/month
StillAlive Plus: $35.00/month
StillAlive Extra: $50.00/month
stormpath
Stormpath User Management Developer: $0.00/month
Stormpath User Management Pro: $19.00/month
Stormpath User Management Premium: $295.00/month
Stormpath User Management Enterprise: $2995.00/month
strongloop
StrongLoop Test: $0.00/month
swiftype
Swiftype Search & Autocomplete Starter: $0.00/month
Swiftype Search & Autocomplete Development: $19.00/month
Swiftype Search & Autocomplete Business: $79.00/month
Swiftype Search & Autocomplete Growth: $299.00/month
Swiftype Search & Autocomplete Enterprise: $999.00/month
tddium
Tddium Starter: $7.00/month
Tddium Basic: $20.00/month
Tddium Standard: $50.00/month
Tddium Plus: $80.00/month
Tddium Pro: $150.00/month
Tddium Mega: $300.00/month
Tddium Mega Unlimited: $450.00/month
telapi
TelAPI Starter: $0.00/month
tempodb
TempoDB Time Series Database Development: $0.00/month
TempoDB Time Series Database Starter: $50.00/month
TempoDB Time Series Database Production: $100.00/month
temporize
Temporize Scheduler Developer: $0.00/month
Temporize Scheduler Small: $9.00/month
Temporize Scheduler Medium: $49.00/month
Temporize Scheduler Large: $299.00/month
threescale
3scale Test: $0.00/month
tinfoilsecurity
Tinfoil Security Limited: $0.00/month
Tinfoil Security Basic: $59.00/month
Tinfoil Security Standard: $199.00/month
Tinfoil Security All Access: $799.00/month
traceview
TraceView Beaker: $0.00/month
TraceView Feynman: $49.00/month
TraceView Newton: $99.00/month
TraceView Tesla: $159.00/month
TraceView Hawking: $259.00/month
TraceView Lovelace: $399.00/month
TraceView Turing: $619.00/month
TraceView Einstein: $1029.00/month
transloadit
Transloadit Test: $0.00/month
treasure-data
Treasure Data Hadoop Free: $0.00/month
Treasure Data Hadoop Developer: $500.00/month
twist
Twist Test: $0.00/month
userbin
Userbin Test: $0.00/month
usersnap
Usersnap Trial: $0.00/month
Usersnap Start: $19.00/month
Usersnap Basic: $49.00/month
Usersnap Professional: $99.00/month
websolr
Websolr Cobalt: $20.00/month
Websolr Chromium: $50.00/month
Websolr Platinum: $100.00/month
Websolr Palladium: $200.00/month
Websolr Tungsten: $400.00/month
Websolr Titanium: $800.00/month
Websolr Foap Dedicated: $950.00/month
Websolr Polonium: $1500.00/month
Websolr Searchteq Production: $4000.00/month
Websolr Thorium: $4500.00/month
wercker
wercker Test: $0.00/month
wwwhisper
wwwhisper Starter: $0.00/month
wwwhisper Basic: $10.00/month
wwwhisper Plus: $25.00/month
zencoder
Zencoder Developer: $0.00/month
Zencoder 1,000 Minutes: $40.00/month
Zencoder 2,000 Minutes: $80.00/month
Zencoder 4,000 Minutes: $120.00/month
Zencoder 10,000 Minutes: $300.00/month
Zencoder 20,000 Minutes: $600.00/month
Zencoder 40,000 Minutes: $1200.00/month
Zencoder 100,000 Minutes: $2000.00/month
zerigo_dns
Zerigo DNS Virtual DNS 1 Loyalty: $2.50/month
Zerigo DNS Zerigo Tier 1: $7.00/month
Zerigo DNS Virtual DNS 1: $7.00/month
Zerigo DNS Virtual DNS 5: $13.00/month
Zerigo DNS Virtual DNS 10: $19.00/month
Zerigo DNS Zerigo Tier 2: $20.00/month
Zerigo DNS Virtual DNS 25: $38.00/month
Zerigo DNS Virtual DNS 50: $63.00/month
Zerigo DNS Virtual DNS 100: $120.00/month
zeropush
ZeroPush Inception: $0.00/month
ZeroPush Horizon: $9.99/month
ZeroPush Continuum: $19.99/month
ZeroPush Power: $49.99/month
Copy link

ghost commented Sep 25, 2017

Hello,
I think your code not working correctly. these errors are encountered during execution.
/usr/lib/ruby/2.3.0/json/common.rb:156:in parse': 784: unexpected token at '' (JSON::ParserError) from /usr/lib/ruby/2.3.0/json/common.rb:156:in parse'
from heroku-addons.rb:42: in request' from heroku-addons.rb:50: in all'
from heroku-addons.rb:59: in `

'

So, i corrected the first part concerning the converson: I replaced your code with mine (In blod). But I have not corrected this error :

undefined method `all' for Heroku::Addons:Module (NoMethodError).

thank you for your response.

require 'uri'
require 'net/http'
require 'json'
require 'ostruct'

module Heroku
module Addons
class Addon
attr_accessor :name

  def initialize(attrs)
    @name = attrs['name']
  end
end

class AddonPlan
  attr_accessor :description, :price, :unit

  def initialize(attrs)
    @description = attrs['description']
    @price = attrs['price']['cents'] / 100.0
    @unit = attrs['price']['unit']
  end

  def full_price
    "$#{'%.2f' % price}/#{unit}"
  end
end

class Client
  def initialize
    uri = URI.parse("https://api.heroku.com/")
    @http = Net::HTTP.new(uri.host, uri.port)
    @http.use_ssl = true if uri.scheme == 'https'
    @headers = {
      'Accept' => 'application/vnd.heroku+json; version=3'
    }
  end

  def request(path, headers={})

    **_response = (@http.get(path, @headers.merge(headers))).to_json  
    JSON.parse(response, :quirks_mode => true)_**
  end
end

@client = Client.new

# Loads all the available addons from Heroku
def @client.all
  @client.request('/addon-services').map { |addon| Addon.new(addon) }
end

def self.Addon
  @client.request("/addon-services/#{addon}/plans").map { |plan| AddonPlan.new(plan) }
  puts plans(name)
end

end
end

addons = Heroku::Addons.all
addons.each do |addon|
name = addon.name
plans = Heroku::Addons.plans(name)
puts name
plans.sort_by(&:price).each do |plan|
puts " #{plan.description}: #{plan.full_price}"
end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment