What is this? From this page you can use the Social Web links to save Using Twitter4R on Mac OS X to a social bookmarking site, or the E-mail form to send a link via e-mail.

Social Web

E-mail

E-mail It
May 31, 2008

Using Twitter4R on Mac OS X

Posted in: Programming, Tips

Was playing around a bit with the Twitter4R library the other day and realized that in order to make it to work on Mac OS X (Leopard) you need to also require ‘time’. Or you will get an error similar to lib/twitter/model.rb:268:in `init’: undefined method `parse’ for Time:Class (NoMethodError).

A small snippet to display my public tweets:

require 'rubygems'
gem('twitter4r', '0.3.0')
require 'twitter'

# Required on Mac OS X Leopard
require 'time'

twitter = Twitter::Client.new

hallski_timeline = twitter.timeline_for(:user, :id => 'hallski')

hallski_timeline.each do |status|
  puts status.text
end

Return to: Using Twitter4R on Mac OS X