mirror of
https://github.com/thewesker/ebooks_example.git
synced 2025-12-22 05:11:08 -05:00
add time_difference gem
first use of INITIAL_CORPUS_FILE env var more concise bot#blacklisted?
This commit is contained in:
1
Gemfile
1
Gemfile
@@ -4,3 +4,4 @@ ruby '2.1.3'
|
||||
gem 'twitter_ebooks', '3.0.8'
|
||||
gem 'dotenv'
|
||||
gem 'cloudinary'
|
||||
gem 'time_difference'
|
||||
|
||||
11
Gemfile.lock
11
Gemfile.lock
@@ -1,6 +1,12 @@
|
||||
GEM
|
||||
remote: http://rubygems.org/
|
||||
specs:
|
||||
activesupport (4.2.0)
|
||||
i18n (~> 0.7)
|
||||
json (~> 1.7, >= 1.7.7)
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.3, >= 0.3.4)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.3.7)
|
||||
awesome_print (1.6.1)
|
||||
aws_cf_signer (0.1.3)
|
||||
@@ -27,11 +33,13 @@ GEM
|
||||
http (0.6.3)
|
||||
http_parser.rb (~> 0.6.0)
|
||||
http_parser.rb (0.6.0)
|
||||
i18n (0.7.0)
|
||||
json (1.8.2)
|
||||
memoizable (0.4.2)
|
||||
thread_safe (~> 0.3, >= 0.3.1)
|
||||
method_source (0.8.2)
|
||||
mime-types (2.4.3)
|
||||
minitest (5.5.1)
|
||||
multipart-post (2.0.0)
|
||||
naught (1.0.0)
|
||||
netrc (0.10.2)
|
||||
@@ -49,6 +57,8 @@ GEM
|
||||
simple_oauth (0.3.1)
|
||||
slop (3.6.0)
|
||||
thread_safe (0.3.4)
|
||||
time_difference (0.3.2)
|
||||
activesupport
|
||||
twitter (5.13.0)
|
||||
addressable (~> 2.3)
|
||||
buftok (~> 0.2.0)
|
||||
@@ -80,4 +90,5 @@ PLATFORMS
|
||||
DEPENDENCIES
|
||||
cloudinary
|
||||
dotenv
|
||||
time_difference
|
||||
twitter_ebooks (= 3.0.8)
|
||||
|
||||
4
app.json
4
app.json
@@ -26,6 +26,10 @@
|
||||
"CONSUMER_SECRET": "",
|
||||
"ACCESS_TOKEN": "",
|
||||
"ACCESS_TOKEN_SECRET": "",
|
||||
"INITIAL_CORPUS_FILE": {
|
||||
"required": false,
|
||||
"value": "tweets.csv"
|
||||
}
|
||||
"CLOUDINARY_URL": {
|
||||
"required": false,
|
||||
"value": ""
|
||||
|
||||
@@ -348,11 +348,7 @@ class Ebooks::Boodoo::BoodooBot < Ebooks::Bot
|
||||
|
||||
# Override Ebooks::Bot#blacklisted? to ensure lower<=>lower check
|
||||
def blacklisted?(username)
|
||||
if @blacklist.map(&:downcase).include?(username.downcase)
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
@blacklist.map(&:downcase).include?(username.downcase)
|
||||
end
|
||||
|
||||
# Follow new followers, unfollow lost followers
|
||||
|
||||
2
bots.rb
2
bots.rb
@@ -1,6 +1,7 @@
|
||||
require 'twitter_ebooks'
|
||||
require_relative 'boodoo'
|
||||
require 'dotenv'
|
||||
require 'time_difference'
|
||||
|
||||
include Ebooks::Boodoo
|
||||
|
||||
@@ -62,6 +63,7 @@ class BoodooBot
|
||||
@attempts = 0
|
||||
@followers = []
|
||||
@following = []
|
||||
@initial_corpus_file = SETTINGS['INITIAL_CORPUS_FILE']
|
||||
@archive_path = "corpus/#{@original}.json"
|
||||
@model_path = "model/#{@original}.model"
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ CONSUMER_KEY=
|
||||
CONSUMER_SECRET=
|
||||
ACCESS_TOKEN=
|
||||
ACCESS_TOKEN_SECRET=
|
||||
INITIAL_CORPUS_FILE=tweets.csv
|
||||
CLOUDINARY_URL=
|
||||
TWEET_INTERVAL=2h
|
||||
TWEET_CHANCE=0.8
|
||||
|
||||
Reference in New Issue
Block a user