mirror of
https://github.com/thewesker/ebooks_example.git
synced 2025-12-22 21:31:10 -05:00
More Cloudinary work
Move Cloudinary require/calls to boodoo.rb Add upload_archive, upload_model, fetch_archive, fetch_model rename get_archive! to update_archive! TODO: - Learn how to load model from content instead of File.open - Come up with sensible check/update logic
This commit is contained in:
6
bots.rb
6
bots.rb
@@ -1,14 +1,12 @@
|
||||
require 'twitter_ebooks'
|
||||
require_relative 'boodoo'
|
||||
require 'dotenv'
|
||||
require 'cloudinary'
|
||||
|
||||
include Ebooks::Boodoo
|
||||
|
||||
# Read defaults and lay env vars on top:
|
||||
SETTINGS = Dotenv.load('secrets.env').merge(ENV)
|
||||
|
||||
|
||||
# Information about a particular Twitter user we know
|
||||
class UserInfo
|
||||
attr_reader :username
|
||||
@@ -68,7 +66,7 @@ class BoodooBot
|
||||
@model_path = "model/#{@original}.model"
|
||||
|
||||
if can_run?
|
||||
get_archive!
|
||||
update_archive!
|
||||
make_model!
|
||||
else
|
||||
missing_fields.each {|missing|
|
||||
@@ -105,7 +103,7 @@ class BoodooBot
|
||||
|
||||
scheduler.interval @refresh_model_interval do
|
||||
log "Refreshing archive/model..."
|
||||
get_archive!
|
||||
update_archive!
|
||||
make_model!
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user