Skip to content

Instantly share code, notes, and snippets.

@mytrile
Created December 6, 2008 12:19
Show Gist options
  • Select an option

  • Save mytrile/32866 to your computer and use it in GitHub Desktop.

Select an option

Save mytrile/32866 to your computer and use it in GitHub Desktop.
Shoes.setup do
gem 'twitter'
end
require 'twitter'
class TwitShoes < Shoes
url '/', :index
def index
background "#202020"
user = login
t = timeline
t[0].zip(t[1]).each { |img, status|
flow {
background gradient('#000', '#FFF')
stack :width => "18%" do
image "#{img}"
end
stack :width => "82%" do
para "#{status}", :size => 9, :font => "Arial", :stroke => '#FF0066'
end
}
}
end
def login
@username = ask "Please, enter your username:"
@password = ask "Please, enter your password:", :secret => true
user = Twitter::Base.new(@username, @password).user(@username)
@name = user.name
end
def timeline
@img, @status = [], []
Twitter::Base.new(@username, @password).timeline.each do |s|
@img << s.user.profile_image_url
@status << s.text
end
[@img, @status]
end
end
Shoes.app :width => 260, :height => 400, :resizable => false, :title => "TwitShoes"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment