add time_difference gem

first use of INITIAL_CORPUS_FILE env var
more concise bot#blacklisted?
This commit is contained in:
Joel McCoy
2015-02-12 15:46:06 -05:00
parent 8a26f1108f
commit b00dbab1a5
6 changed files with 20 additions and 5 deletions

View File

@@ -4,3 +4,4 @@ ruby '2.1.3'
gem 'twitter_ebooks', '3.0.8'
gem 'dotenv'
gem 'cloudinary'
gem 'time_difference'

View File

@@ -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)

View File

@@ -26,6 +26,10 @@
"CONSUMER_SECRET": "",
"ACCESS_TOKEN": "",
"ACCESS_TOKEN_SECRET": "",
"INITIAL_CORPUS_FILE": {
"required": false,
"value": "tweets.csv"
}
"CLOUDINARY_URL": {
"required": false,
"value": ""

View File

@@ -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

View File

@@ -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"

View File

@@ -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