#!/usr/bin/env ruby

require 'browshot'

browshot = Browshot.new('my_api_key')


account = browshot.account_info()

# Check my balance
puts "Free screenshots left for this month: #{account['free_screenshots_left']}\n"
puts "Credits left: #{account['balance']}\n"

if (account['balance'].to_i < 100)
  # Send an alarm when the balance is low
  puts "balance is low\n"
end