Sha256: a199a92243068f76d1336eca666bb493f6a6f17a28f7a12affbbac709daa3d3d
Contents?: true
Size: 803 Bytes
Versions: 2
Compression:
Stored size: 803 Bytes
Contents
require 'rubygems' require 'sinatra' require 'barometer' Barometer.google_geocode_key ||= "ABQIAAAAq8TH4offRcGrok8JVY_MyxRi_j0U6kJrkFvY4-OX2XYmEAa76BSFwMlSow1YgX8BOPUeve_shMG7xw" class Webometer < Sinatra::Default get '/' do erb :index end post '/' do # apply options Barometer.force_geocode = (params[:query][:geocode].to_s == "1" ? true : false) Barometer.selection = { 1 => [ params[:query][:source].to_sym ] } metric = (params[:query][:metric].to_s == "1" ? true : false) if params[:query] && !params[:query][:q].empty? @barometer = Barometer.new(params[:query][:q]) @weather = @barometer.measure(metric) end erb :index end get '/contributing.html' do erb :contributing end get '/readme.html' do erb :readme end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
barometer-0.2.1 | lib/webometer/webometer.rb |
barometer-0.2.2 | lib/webometer/webometer.rb |