I signed up my BetaBrite for a twitter account. Now I’m getting twitter messages in my living room. Yay! Leave a comment, or follow me on twitter so I can get your messages on my sign. I think next I will try to wire up a webcam to automagically take pictures.
Anyway, here is the code:
twitter = Twitter::Base.new('betabrite', '%%%%%%%%')
seen = {}
DATA.each_line { |l| seen[l.chomp] = true }
twit = nil
twitter.timeline(:friends).each do |tweet|
next if seen[tweet.id]
twit = tweet
end
if twit
File.open(__FILE__, 'a') { |db| db.puts(twit.id) }
puts "#{twit.text} (#{twit.user.name})"
bb = BetaBrite::USB.new { |sign|
sign.stringfile('0') do
print string("#{twit.text}")
end
sign.stringfile('1') do
print string("(#{twit.user.name})").red
end
}.write!
end
__END__
My favorite part is that I use the script for its own database. It keeps appending twitter ids it has seen to the end of the file.
Code that appends to its own file? Very why-esque!
Howdy;
Sounds great. Pard for my badly english, my german is better, anyway i will start a small question
How can i use it, if im not a big coding nose ??
nerd.
[...] my Twitterbrite post? Well I registered twitterbrite.com, and now if my client catches a twit from you, it records [...]
whould like to use something like this for a twitter that i am fallowing