Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 21 lines (18 sloc) 0.451 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#!/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
Something went wrong with that request. Please try again.