Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 22 lines (18 sloc) 451 Bytes
#!/usr/bin/env ruby
require 'rubygems'
require 'sinatra'
require 'haml'
require 'json'
require 'date'
get '/' do
file = File.expand_path(File.dirname(__FILE__)) + '/var/trends.json'
json = JSON.parse(File.read(file))
@trends = json['trends']
@updated_full = json['as_of']
@updated = DateTime.parse(@updated_full).strftime('%H:%M')
haml :index
end
get '/css/trends.css' do
content_type 'text/css', :charset => 'utf-8'
sass :trends
end