Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (19 sloc) 0.455 kB
require 'sinatra'
require 'twitter'
require 'haml'
class TwitterInfo < Sinatra::Application
set :views, settings.root + '/../views'
get '/' do
haml :index
end
get '/user/:username' do
@user = params[:username]
user_id = Twitter.user(@user).id
followers = Twitter.follower_ids(user_id).ids
@num_followers = followers.length
haml :followers
end
post // do
halt 500, 'Whoa. Sorry. No POSTs allowed.'
end
end
Jump to Line
Something went wrong with that request. Please try again.