mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-03-17 12:21:31 +00:00
fix db/seeds.rb
This commit is contained in:
parent
2928602e87
commit
23d6589c15
1 changed files with 9 additions and 2 deletions
11
db/seeds.rb
11
db/seeds.rb
|
@ -9,11 +9,16 @@ user.invitation_code = User::INVITATION_CODES.first
|
|||
user.admin = true
|
||||
user.save!
|
||||
|
||||
puts
|
||||
puts
|
||||
|
||||
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' => "put-your-key-here" }).save!
|
||||
|
||||
puts "NOTE: The example 'SF Weather Agent' will not work until you edit it and put in a free API key from http://www.wunderground.com/weather/api/"
|
||||
end
|
||||
|
||||
unless user.agents.where(:name => "XKCD Source").exists?
|
||||
|
@ -25,7 +30,7 @@ unless user.agents.where(:name => "XKCD Source").exists?
|
|||
'url' => "http://xkcd.com",
|
||||
'mode' => "on_change",
|
||||
'expected_update_period_in_days' => 5,
|
||||
'extrac' => {
|
||||
'extract' => {
|
||||
'url' => { 'css' => "#comic img", 'attr' => "src" },
|
||||
'title' => { 'css' => "#comic img", 'attr' => "title" }
|
||||
}
|
||||
|
@ -77,3 +82,5 @@ unless user.agents.where(:name => "Afternoon Digest").exists?
|
|||
: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
|
||||
|
||||
puts "See the Huginn Wiki for more Agent examples! https://github.com/cantino/huginn/wiki"
|
||||
|
|
Loading…
Add table
Reference in a new issue