Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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"
Add Comment
Please, Sign In to add comment