TwitterBrite

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.

4 Comments

  1. Posted February 22, 2008 at 11:51 pm | Permalink

    Code that appends to its own file? Very why-esque!

  2. Posted February 23, 2008 at 11:51 pm | Permalink

    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 ??

  3. jackie
    Posted February 24, 2008 at 6:18 am | Permalink

    nerd.

  4. charles
    Posted July 15, 2008 at 4:41 pm | Permalink

    whould like to use something like this for a twitter that i am fallowing

One Trackback

  1. By Tender Lovemaking » Blog Archive » Watch Your Twits on February 26, 2008 at 12:12 am

    [...] my Twitterbrite post? Well I registered twitterbrite.com, and now if my client catches a twit from you, it records [...]

Post a Comment

Your email is never shared. Required fields are marked *

*
*
Check Spelling
Activate Spell Check while Typing