0

I'm using the tweetstream gem and the tweets I'm tracking show up on the console but not on the page when I load it. Here's the action in my controller:

def stream
TweetStream::Client.new.track('javascript') do |status|
  puts "#{status.text}"
end

end

And here's the view:

<% TweetStream::Client.new.track('javascript') do |status| %>
  <%= puts "[#{status.user.screen_name}] #[{status.text}]" %>
<% end %>

This is my first Rails app so I'm pretty new at this. Anyone know why it's printing to the console but not showing up in the view?

Sara
  • 2,729
  • 7
  • 22
  • 30

1 Answers1

0

From what I understand you have to pull the Tweetstream from a database. So set up a Daemon using:

TweetStream::Daemon.new('tracker', :log_output => true).track("twitter junk") do |tweet|
      ######put tweet.text into db############
end

Start daemon from console with:

ruby daemonname.rb start

from application pull tweets from db.

venerik
  • 5,766
  • 2
  • 33
  • 43
FierceScarf
  • 461
  • 1
  • 5
  • 17