Class: Instabot
- Inherits:
-
Object
- Object
- Instabot
- Defined in:
- lib/instabot/core.rb
Overview
main core class
Constant Summary
Constants included from Version
Version::DESCRIPTION, Version::SUMMARY, Version::VERSION
Instance Attribute Summary collapse
-
#informations ⇒ Object
Returns the value of attribute informations.
-
#medias ⇒ Object
Returns the value of attribute medias.
-
#users ⇒ Object
Returns the value of attribute users.
Instance Method Summary collapse
-
#initialize(mode = :default) ⇒ Instabot
constructor
A new instance of Instabot.
-
#intro(mode) ⇒ Object
bot starter.
-
#options ⇒ Object
will return Config.options…
Methods included from Protocol
#create_mechanic, #get_page, #set_mechanic_data
Methods included from Log
#check_log_files, #log, #save_action_log, #write_file
Methods included from Login
#check_login_status, #login, #logout
Methods included from Grabber
#get_media_informations, #get_user_informations, #search
Methods included from Config
Methods included from Banner
Methods included from Actions
#comment, #follow, #like, #unfollow, #unlike
Methods included from Modes
#auto_comment, #auto_follow, #auto_like, #auto_unfollow, #check_date, #comments_in_day_are_full?, #fall_in_asleep, #follows_in_day_are_full?, #generate_a_comment, #likes_in_day_are_full?, #maximums_are_full?, #mode, #unfollows_in_day_are_full?
Constructor Details
#initialize(mode = :default) ⇒ Instabot
Returns a new instance of Instabot.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/instabot/core.rb', line 24 def initialize(mode = :default) @login_mode = mode @users = [] @medias = [] @log_counter = 0 @login_counter = 1 @login_status = false @lib_dir = "#{Dir.pwd}/lib" @root_dir = Dir.pwd.to_s @logs_dir = "#@root_dir/logs" @global_time = Time.new.strftime('%H-%M-%S--%y-%m-%d') Configuration.new if @login_mode == :manual @local_stroage = { followed_users: [], unfollowed_users: [], liked_medias: [], unliked_medias: [], commented_medias: [] } @maximums = { follows_in_day: 0, unfollows_in_day: 0, likes_in_day: 0, comments_in_day: 0, max_follows_per_day: [:max_follow_per_day], max_unfollows_per_day: [:max_unfollow_per_day], max_likes_per_day: [:max_like_per_day], max_comments_per_day: [:max_comment_per_day] } intro(mode) end |
Instance Attribute Details
#informations ⇒ Object
Returns the value of attribute informations.
22 23 24 |
# File 'lib/instabot/core.rb', line 22 def informations @informations end |
#medias ⇒ Object
Returns the value of attribute medias.
22 23 24 |
# File 'lib/instabot/core.rb', line 22 def medias @medias end |
#users ⇒ Object
Returns the value of attribute users.
22 23 24 |
# File 'lib/instabot/core.rb', line 22 def users @users end |
Instance Method Details
#intro(mode) ⇒ Object
bot starter
90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/instabot/core.rb', line 90 def intro(mode) trap('INT') { exit! } check_log_files log('log files are checked', 'CORE') log('Machine started', 'CORE') create_mechanic puts '[+] '.cyan + 'Processing successfully completed' log('Processing successfully completed', 'CORE') unless mode != :default login end end |
#options ⇒ Object
will return Config.options…
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/instabot/core.rb', line 60 def if @login_mode == :default { comments: Config..comments, max_comment_per_day: Config..max_comment_per_day, max_follow_per_day: Config..max_follow_per_day, max_like_per_day: Config..max_like_per_day, max_unfollow_per_day: Config..max_unfollow_per_day, username: Config..username, password: Config..password, pre_load: Config..pre_load, print_banner: Config.., proxy: Config..proxy, tags: Config.., unwanted_list: Config..unwanted_list, use_proxy: Config..use_proxy, wait_per_action: Config..wait_per_action, white_list_users: Config..white_list_users } else { max_comment_per_day: :infinite, max_follow_per_day: :infinite, max_like_per_day: :infinite, max_unfollow_per_day: :infinite } end end |