title: write to database with tweetstream daemon
body: <p>I am trying to write all tweets that matches a keyword to my database. I have set up the following in <code>tracker.rb</code>:</p>
  
  <pre><code>require 'rubygems'
  require 'tweetstream'
  
  TweetStream::Daemon.new('Bill Gates','money','Twitter Tracker').track('ladygaga') do |status|
    Tweet.new(:content =&gt; status.text)
  end
  </code></pre>
  
  <p>But nothing happens. What am I doing wrong here?</p>
  
  <p>Thanks in advance</p>
  
  <p><strong>Update:</strong>
  I put everything in a <code>.rake</code> file called <code>twitter.rake</code> and start the demon with <code>$ rake scrap</code>:</p>
  
  <pre><code>task :scrap =&gt; :environment do
    desc "Run Twitter Scraper"
    TweetStream::Client.new('TWITTER_USER','TWITTER_PASS').track('ladygaga') do |status|
      Tweet.create(:user_id  =&gt; status.user.id, :user_screen_name =&gt; status.user.screen_name, :user_profile_image_url =&gt; status.user.profile_image_url, :status_text =&gt; status.text, :status_id =&gt; status.id)
      puts "[#{status.user.screen_name}] #{status.text}"
    end
  end
  </code></pre>