mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-03-17 12:21:31 +00:00
switch to strings in db seed
This commit is contained in:
parent
626c13ef52
commit
50f6837464
1 changed files with 22 additions and 22 deletions
44
db/seeds.rb
44
db/seeds.rb
|
@ -13,7 +13,7 @@ unless user.agents.where(:name => "SF Weather Agent").exists?
|
|||
Agent.build_for_type("Agents::WeatherAgent", user,
|
||||
:name => "SF Weather Agent",
|
||||
:schedule => "10pm",
|
||||
:options => { :location => "94103", :api_key => "your-key" }).save!
|
||||
:options => { 'location' => "94103", 'api_key' => "your-key" }).save!
|
||||
end
|
||||
|
||||
unless user.agents.where(:name => "XKCD Source").exists?
|
||||
|
@ -22,12 +22,12 @@ unless user.agents.where(:name => "XKCD Source").exists?
|
|||
:schedule => "every_1d",
|
||||
:type => "html",
|
||||
:options => {
|
||||
:url => "http://xkcd.com",
|
||||
:mode => "on_change",
|
||||
:expected_update_period_in_days => 5,
|
||||
:extract => {
|
||||
:url => {:css => "#comic img", :attr => "src"},
|
||||
:title => {:css => "#comic img", :attr => "title"}
|
||||
'url' => "http://xkcd.com",
|
||||
'mode' => "on_change",
|
||||
'expected_update_period_in_days' => 5,
|
||||
'extrac' => {
|
||||
'url' => { 'css' => "#comic img", 'attr' => "src" },
|
||||
'title' => { 'css' => "#comic img", 'attr' => "title" }
|
||||
}
|
||||
}).save!
|
||||
end
|
||||
|
@ -36,13 +36,13 @@ unless user.agents.where(:name => "iTunes Trailer Source").exists?
|
|||
Agent.build_for_type("Agents::WebsiteAgent", user, :name => "iTunes Trailer Source",
|
||||
:schedule => "every_1d",
|
||||
:options => {
|
||||
:url => "http://trailers.apple.com/trailers/home/rss/newtrailers.rss",
|
||||
:mode => "on_change",
|
||||
:type => "xml",
|
||||
:expected_update_period_in_days => 5,
|
||||
:extract => {
|
||||
:title => {:css => "item title", :text => true},
|
||||
:url => {:css => "item link", :text => true}
|
||||
'url' => "http://trailers.apple.com/trailers/home/rss/newtrailers.rss",
|
||||
'mode' => "on_change",
|
||||
'type' => "xml",
|
||||
'expected_update_period_in_days' => 5,
|
||||
'extract' => {
|
||||
'title' => { 'css' => "item title", 'text' => true},
|
||||
'url' => { 'css' => "item link", 'text' => true}
|
||||
}
|
||||
}).save!
|
||||
end
|
||||
|
@ -52,13 +52,13 @@ unless user.agents.where(:name => "Rain Notifier").exists?
|
|||
:name => "Rain Notifier",
|
||||
:source_ids => user.agents.where(:name => "SF Weather Agent").pluck(:id),
|
||||
:options => {
|
||||
:expected_receive_period_in_days => "2",
|
||||
:rules => [{
|
||||
:type => "regex",
|
||||
:value => "rain|storm",
|
||||
:path => "conditions"
|
||||
'expected_receive_period_in_days' => "2",
|
||||
'rules' => [{
|
||||
'type' => "regex",
|
||||
'value' => "rain|storm",
|
||||
'path' => "conditions"
|
||||
}],
|
||||
:message => "Just so you know, it looks like '<conditions>' tomorrow in <location>"
|
||||
'message' => "Just so you know, it looks like '<conditions>' tomorrow in <location>"
|
||||
}).save!
|
||||
end
|
||||
|
||||
|
@ -66,7 +66,7 @@ unless user.agents.where(:name => "Morning Digest").exists?
|
|||
Agent.build_for_type("Agents::DigestEmailAgent", user,
|
||||
:name => "Morning Digest",
|
||||
:schedule => "6am",
|
||||
:options => { :subject => "Your Morning Digest", :expected_receive_period_in_days => "30" },
|
||||
:options => { 'subject' => "Your Morning Digest", 'expected_receive_period_in_days' => "30" },
|
||||
:source_ids => user.agents.where(:name => "Rain Notifier").pluck(:id)).save!
|
||||
end
|
||||
|
||||
|
@ -74,6 +74,6 @@ unless user.agents.where(:name => "Afternoon Digest").exists?
|
|||
Agent.build_for_type("Agents::DigestEmailAgent", user,
|
||||
:name => "Afternoon Digest",
|
||||
:schedule => "5pm",
|
||||
:options => { :subject => "Your Afternoon Digest", :expected_receive_period_in_days => "7" },
|
||||
:options => { 'subject' => "Your Afternoon Digest", 'expected_receive_period_in_days' => "7" },
|
||||
:source_ids => user.agents.where(:name => ["iTunes Trailer Source", "XKCD Source"]).pluck(:id)).save!
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue