lib/botinsta.rb in botinsta-0.1.2 vs lib/botinsta.rb in botinsta-0.1.3
- old
+ new
@@ -3,38 +3,46 @@
require 'json'
require 'mechanize'
require 'sequel'
require 'sqlite3'
require 'nokogiri'
+require 'rb-readline'
+require 'pry'
require_relative 'botinsta/class_methods'
# This is our main class from which we will be
# instantiating our bot.
class Botinsta
include ClassMethods
- DEFAULT_PARAMETERS = { tags: %w[photography fotografia vsco],
- tag_blacklist: %w[nsfw hot sexy],
- user_blacklist: [],
- likes_per_tag: 10,
- unfollows_per_run: 200,
- follows_per_tag: 50
+ DEFAULT_PARAMETERS = { tags: %w[photography fotografia vsco],
+ tag_blacklist: %w[nsfw hot sexy],
+ user_blacklist: [],
+ likes_per_tag: 10,
+ follows_per_tag: 50,
+ unfollows_per_run: 200,
+ unfollow_threshold: { seconds: 0,
+ minutes: 0,
+ hours: 1,
+ days: 0
+ }
}.freeze
def initialize(**params)
params = DEFAULT_PARAMETERS.merge(params)
- @username = params[:username]
- @password = params[:password]
- @tags = params[:tags]
- @tag_blacklist = params[:tag_blacklist]
- @user_blacklist = params[:user_blacklist]
- @likes_per_tag = params[:likes_per_tag]
- @follows_per_tag = params[:follows_per_tag]
- @unfollows_per_run = params[:unfollows_per_run]
+ @username = params[:username]
+ @password = params[:password]
+ @tags = params[:tags]
+ @tag_blacklist = params[:tag_blacklist]
+ @user_blacklist = params[:user_blacklist]
+ @likes_per_tag = params[:likes_per_tag]
+ @follows_per_tag = params[:follows_per_tag]
+ @unfollows_per_run = params[:unfollows_per_run]
+ @unfollow_threshold = params[:unfollow_threshold]
@total_likes = 0
@total_follows = 0
@total_unfollows = 0