mirror of
https://github.com/thewesker/ebooks_example.git
synced 2025-12-21 21:01:07 -05:00
Simple wrappers for Archive/Model creation; this whole thing needs to be re-written
This commit is contained in:
13
bots.rb
13
bots.rb
@@ -6,7 +6,7 @@ require 'time_difference'
|
||||
include Ebooks::Boodoo
|
||||
|
||||
# Read defaults and lay env vars on top:
|
||||
SETTINGS = Dotenv.load('secrets.env').merge(ENV)
|
||||
SETTINGS = Dotenv.load('defaults.env').merge(ENV)
|
||||
|
||||
# Information about a particular Twitter user we know
|
||||
class UserInfo
|
||||
@@ -73,14 +73,13 @@ class BoodooBot
|
||||
log "This can run!"
|
||||
if initial_corpus_file.blank? || in_cloud?(File.basename(@archive_path))
|
||||
log "Skipping initial corpus consumption"
|
||||
@archive = CloudArchive.new(original, archive_path, twitter)
|
||||
@model = CloudModel.new(@original, @model_path).from_json(@archive_path, true)
|
||||
@archive = Boodoo.make_Archive(original, archive_path, twitter)
|
||||
@model = Boodoo.make_Model(username: original, path: model_path).from_json(archive_path, is_path: true)
|
||||
else
|
||||
log "Consuming initial corpus..."
|
||||
archive_json = jsonify(initial_corpus_file, :from_cloud=>has_cloud?, :new_name=>original, :to_cloud=>false)
|
||||
log "archive_json length: #{archive_json.size}"
|
||||
@archive = CloudArchive.new(original, archive_path, twitter, :local=>true, :content=>archive_json)
|
||||
# @model = CloudModel.new(original, model_path).from_json(archive_json, false)
|
||||
archive_json = jsonify(initial_corpus_file, from_cloud: has_cloud?, new_name: original, to_cloud: false)
|
||||
@archive = Boodoo.make_Archive(original, path: archive_path, client: twitter, local: true, content: archive_json.lines)
|
||||
@model = Boodoo.make_Model(username: original, path: model_path).from_json(archive_json, is_path: false)
|
||||
end
|
||||
else
|
||||
missing_fields.each {|missing|
|
||||
|
||||
Reference in New Issue
Block a user