Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix demo script command refs, logging output

  • Loading branch information...
commit 412f929781902baab8c3c7ba037028eaf24c408e 1 parent d437214
@rwdaigle authored
Showing with 10 additions and 2 deletions.
  1. +3 −1 DEMO
  2. +6 −0 Rakefile
  3. +1 −1  models/tweet.rb
View
4 DEMO
@@ -8,6 +8,7 @@ bundle install
heroku create --stack cedar
heroku config:add TWITTER_USERNAME=herokutesting TWITTER_PASSWORD=heroku TWITTER_KEYWORD=ruby
heroku addons:add heroku-postgresql:ronin
+heroku addons:add pgbackups:auto-week
heroku addons:add indextank:starter
heroku addons:add pusher:test
heroku addons:add redistogo:small
@@ -26,5 +27,6 @@ heroku logs --tail -s app
# Manage
heroku config:add TWITTER_KEYWORD=node
-heroku run bundle exec rake tweetstream:queue:clear
+heroku run bundle exec rake queue:clear
heroku run bash
+heroku rollback
View
6 Rakefile
@@ -10,6 +10,9 @@ require File.dirname(__FILE__) + "/jobs/persist_tweet"
STDOUT.sync = true
+
+#-- Stream search results from twitter --#
+
task "tweetstream:stream" => "queue:environment" do
TweetStream::Client.new(ENV["TWITTER_USERNAME"], ENV["TWITTER_PASSWORD"]).track(ENV["TWITTER_KEYWORD"]) do |status|
puts "Received tweet: #{status[:text]}"
@@ -18,6 +21,9 @@ task "tweetstream:stream" => "queue:environment" do
end
end
+
+#-- Management/config --#
+
namespace :queue do
task :environment do
View
2  models/tweet.rb
@@ -3,7 +3,7 @@
class Tweet < ActiveRecord::Base
after_create { |tweet|
- puts "Indexing #{tweet["text"]}"
+ puts "Indexing tweet: #{tweet["text"]}"
$index.document(tweet.to_param).add(:text => tweet.text, :user => tweet.user)
}
end
Please sign in to comment.
Something went wrong with that request. Please try again.