Skip to content

Instantly share code, notes, and snippets.

@oliyoung
Created April 20, 2009 01:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save oliyoung/98312 to your computer and use it in GitHub Desktop.
Save oliyoung/98312 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'sinatra'
require 'httparty'
class Representative
include HTTParty
end
get '/' do
erb :form
end
get '/:username' do
require 'cgi'
@oprah_joined = Date.parse("Fri Jan 23 15:18:34 +0000 2009")
data = Representative.get("http://twitter.com/users/show/#{params[:username]}.json", :format => :json)
@user_joined = data.has_key?(:status) ? Date.parse(data['status']['created_at']) : Date.parse(data['created_at'])
@text = @oprah_joined > @user_joined ? "was" : "wasn't"
erb :index
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment