Archive for Category 'betabrite'

Watch Your Twits

If this doesn't win me the super nerd of the year award, I don't know what will. In fact, this is so nerdy that I'm kind of ashamed to write about it!

Remeber my Twitterbrite post? Well I registered twitterbrite.com, and now if my client catches a twit from you, it records the message on the LED sign and uploads it to my youtube account. Go ahead, check out twitterbrite.com now!

Update: My scripts are too chatty, so now it will only post videos if the text of the twit contains 'betabrite'.

Posted by Aaron PattersonPermalinkComments (3)Leave your Comment »

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.

Posted by Aaron PattersonPermalinkComments (5)Leave your Comment »

Autotest and BetaBrite

I've finally added USB betabrite support to my Betabrite library, and released version 1.0.0.

Version 1.0.0 also includes an autotest module so that you can see your autotest output on the sign. Here is what mine looks like:

Betabrite Autotest

The sign shows errors too, but it scrolls, so I couldn't get it in one picture. Anyway, if you've got the USB sign, all you have to do to get it working with autotest is add this to your .autotest file:

require 'betabrite/autotest'
require 'usb'

Autotest::BetaBrite.hook(BetaBrite::USB)

The hook method takes a block, and you can modify your messages before they are sent to the sign. For example, I wanted my failures to be blue, so my .autotest file looks like this:

require 'betabrite/autotest'
require 'usb'

Autotest::BetaBrite.hook(BetaBrite::USB) do |failures, erorrs|
  failures.rgb('0000FF') if failures.green?
end

Posted by Aaron PattersonPermalinkComments (3)Leave your Comment »

New Ruby BetaBrite - 0.0.2

I just released a new version of the ruby BetaBrite sign library. It lets you control BetaBrite signs. You can write text, change the color, fonts, display images, and do a bunch of other stuff.

In celebration of this new release, I created a DRb server that lets you write to my BetaBrite sign and take a photo of it! Here is the code that will write "Seattle.rb" to my server and take a photo:

require 'drb'
require 'rubygems'
require 'betabrite'

DRb.start_service()
obj = DRbObject.new(nil, 'druby://eviladmins.org:9000')

File.open("out.jpg", 'wb') { |a|
  a.write obj.write_simple("Seattle.rb")
}

Which took this photo:


More...

Posted by Aaron PattersonPermalinkComments (30)Leave your Comment »