Archive tweets on startup
This commit is contained in:
parent
405da13178
commit
a6996c3815
1 changed files with 2 additions and 1 deletions
3
bots.rb
3
bots.rb
|
@ -32,6 +32,7 @@ class ERWEbooksBot < Ebooks::Bot
|
||||||
def top20; @top20 ||= model.keywords.take(20); end
|
def top20; @top20 ||= model.keywords.take(20); end
|
||||||
|
|
||||||
def on_startup
|
def on_startup
|
||||||
|
archive!
|
||||||
load_model!
|
load_model!
|
||||||
|
|
||||||
scheduler.cron '23 6-23 * * *' do
|
scheduler.cron '23 6-23 * * *' do
|
||||||
|
@ -137,7 +138,7 @@ class ERWEbooksBot < Ebooks::Bot
|
||||||
archive_path = "model/#{original}.json"
|
archive_path = "model/#{original}.json"
|
||||||
log "Archiving tweets #{archive_path}"
|
log "Archiving tweets #{archive_path}"
|
||||||
Ebooks::Archive.new(@original, archive_path).sync
|
Ebooks::Archive.new(@original, archive_path).sync
|
||||||
Ebooks::Model.consume(archive_path).save(model_path)
|
Ebooks::Model.consume(archive_path).save(@model_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue