Permalink
Browse files

migrations

  • Loading branch information...
1 parent ea960e1 commit 73b94b3d5198dde1b52eb14c373f7d2963700caa Ryan McKillen committed Apr 19, 2010
Showing with 72 additions and 88 deletions.
  1. +4 −2 app/models/feed.rb
  2. +68 −86 db/seeds.rb
View
@@ -8,8 +8,10 @@ class Feed < ActiveRecord::Base
def get_name
feed = Feedzirra::Feed.fetch_and_parse(self.url)
- self.name = feed.title[16, feed.title.length - 16]
- false if self.name.nil?
+ if feed.respond_to?(:title)
+ self.name = feed.title[16, feed.title.length - 16]
+ false if self.name.nil?
+ end
end
def parse_feed_job
View
@@ -3,94 +3,76 @@
#
# Examples:
#
-# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
-# Major.create(:name => 'Daley', :city => cities.first)
+# cities = City.create([{ :name => "Chicago" }, { :name => "Copenhagen" }])
+# Major.create(:name => "Daley", :city => cities.first)
# http://asciicasts.com/episodes/179-seed-data
user = User.create!(
- :username => 'workingpoint',
- :email => 'rmckillen@workingpoint.com',
- :password => 'workingpoint1',
- :password_confirmation => 'workingpoint1'
+ :username => "workingpoint",
+ :email => "rmckillen@workingpoint.com",
+ :password => "workingpoint1",
+ :password_confirmation => "workingpoint1",
+ :min_metric => 3,
+ :blacklist => %w(craigslist.com twitter.com topsy.com xmarks.com tweetmeme.com)
)
-Domain.create!(
- :user_id => user.id,
- :name => 'blinksale.com'
-)
-Feed.create!(
- :user_id => user.id,
- :url => 'http://www.google.com/alerts/feeds/15340011665024776864/13479364529815066233'
-)
-Domain.create(
- :user_id => user.id,
- :name => 'clarityaccounting.com'
-)
-Feed.create(
- :user_id => user.id,
- :url => 'http://www.google.com/alerts/feeds/15340011665024776864/14483086467735945816'
-)
-Domain.create(
- :user_id => user.id,
- :name => 'freeagentcentral.com'
-)
-Feed.create(
- :user_id => user.id,
- :url => 'http://www.google.com/alerts/feeds/15340011665024776864/9052846273680508133'
-)
-Domain.create(
- :user_id => user.id,
- :name => 'freshbooks.com'
-)
-Feed.create(
- :user_id => user.id,
- :url => 'http://www.google.com/alerts/feeds/15340011665024776864/821401960719390402'
-)
-Domain.create(
- :user_id => user.id,
- :name => 'getballpark.com'
-)
-Feed.create(
- :user_id => user.id,
- :url => 'http://www.google.com/alerts/feeds/15340011665024776864/17500597487404998314'
-)
-Domain.create(
- :user_id => user.id,
- :name => 'getharvest.com'
-)
-Feed.create(
- :user_id => user.id,
- :url => 'http://www.google.com/alerts/feeds/15340011665024776864/13289910584060414974'
-)
-Domain.create(
- :user_id => user.id,
- :name => 'intuit.com'
-)
-Feed.create(
- :user_id => user.id,
- :url => 'http://www.google.com/alerts/feeds/15340011665024776864/2337650881512061'
-)
-Domain.create(
- :user_id => user.id,
- :name => 'outright.com'
-)
-Feed.create(
- :user_id => user.id,
- :url => 'http://www.google.com/alerts/feeds/15340011665024776864/13544752635861414129'
-)
-Domain.create(
- :user_id => user.id,
- :name => 'xero.com'
-)
-Feed.create(
- :user_id => user.id,
- :url => 'http://www.google.com/alerts/feeds/15340011665024776864/811024738914585518'
-)
-Domain.create(
- :user_id => user.id,
- :name => 'zoho.com'
-)
-Feed.create(
- :user_id => user.id,
- :url => 'http://www.google.com/alerts/feeds/15340011665024776864/10614922649383398045'
-)
+
+Domain.create!(:user_id => user.id, :name => "billingmanager.intuit.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/9717253108151886370")
+
+Domain.create!(:user_id => user.id, :name => "billingorchard.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/13867647443360317376")
+
+Domain.create!(:user_id => user.id, :name => "blinksale.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/9294805335817503065")
+
+Domain.create!(:user_id => user.id, :name => "clarityaccounting.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/7625339246156930865")
+
+Domain.create!(:user_id => user.id, :name => "curdbee.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/12654935965205422895")
+
+Domain.create!(:user_id => user.id, :name => "freeagentcentral.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/18100011966491749718")
+
+Domain.create!(:user_id => user.id, :name => "freshbooks.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/6240208128399490711")
+
+Domain.create!(:user_id => user.id, :name => "getballpark.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/280346136937478714")
+
+Domain.create!(:user_id => user.id, :name => "getcashboard.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/3825729718742795707")
+
+Domain.create!(:user_id => user.id, :name => "getharvest.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/12189778556482473779")
+
+Domain.create!(:user_id => user.id, :name => "iacez.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/9097519455392453694")
+
+Domain.create!(:user_id => user.id, :name => "invoice.zoho.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/8115054993073402131")
+
+Domain.create!(:user_id => user.id, :name => "invotrak.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/12489256938917803372")
+
+Domain.create!(:user_id => user.id, :name => "lessaccounting.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/4712314101666605130")
+
+Domain.create!(:user_id => user.id, :name => "outright.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/1536866210761408646")
+
+Domain.create!(:user_id => user.id, :name => "pulseapp.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/9334385038291964442")
+
+Domain.create!(:user_id => user.id, :name => "quickbooks.intuit.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/3452502418267842910")
+
+Domain.create!(:user_id => user.id, :name => "saasu.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/886509635584835205")
+
+Domain.create!(:user_id => user.id, :name => "simplybill.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/15962192165401507370")
+
+Domain.create!(:user_id => user.id, :name => "xero.com")
+Feed.create!(:user_id => user.id, :url => "http://www.google.com/alerts/feeds/15340011665024776864/1451173714449700329")

0 comments on commit 73b94b3

Please sign in to comment.