Skip to content

Instantly share code, notes, and snippets.

@h5y1m141
Created November 18, 2012 06:18
Show Gist options
  • Save h5y1m141/4103853 to your computer and use it in GitHub Desktop.
Save h5y1m141/4103853 to your computer and use it in GitHub Desktop.
20121121-sample
require 'twitter'
require 'sinatra'
require 'haml'
class MyApp < Sinatra::Base
before do
Twitter.configure do |config|
config.consumer_key = ""
config.consumer_secret =""
config.oauth_token = ""
config.oauth_token_secret = ""
end
end
get '/' do
@home_timeline = Twitter.home_timeline
haml :top
end
end
MyApp.run! :host => 'localhost', :port => 4567
source "http://rubygems.org"
gem 'sinatra'
gem 'twitter'
gem 'haml'
%h1= "My Twitter Timeline"
%table
-@home_timeline.each do |tl|
%tr
%td= tl.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment