instabot 0.1.81 → 0.1.90

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1e8c2dcaa0f807aa2069b0ddbdb6eec49a39d317
4
- data.tar.gz: b96331484a53d80da6b08d0f19b1fab5f3a20b70
2
+ SHA256:
3
+ metadata.gz: 59f6442e8533adcc81f77187cd1770969fdb194afcea0194eda22cd4437f2935
4
+ data.tar.gz: 19f58ebf2dba33046e64cb9c15447d5978e6628076ca428ab9384a6b10ddb546
5
5
  SHA512:
6
- metadata.gz: 98476f92669ade7a9d8571f90c67fd72f967293f1b7fa65fb1c9cc8020bc02bb698b780b908d650d70251356743947b67bf601ca0161e60fcb8b0319c06ff9d7
7
- data.tar.gz: 42020f6a4ecd7bdc4e687cbde87da5078164b4af6eecb25583b26e13d4d4eac933ba72e16d6f422f133fd4e611da6159543cdfd72f41c4b9da56ce58edee3b56
6
+ metadata.gz: 2fba00519f2ac88dc73727b888b5678197c205967a48c73d4ba9d4b6366754f558699c11cc4b372aa961f5ffb1d5af7b21381e73ba961ad233c993e7b93071db
7
+ data.tar.gz: f8ad5135eb97ed07539dc466a19af536fecb04a39c54d4ac51958de2aaccab76fdc38bac77c08d2c1e755ce4c39d5269ac617fdb3253f2cdd4728e8b6d30494e
@@ -1,11 +1,11 @@
1
- require_relative 'instabot/create_protocol'
2
- require_relative 'instabot/tor_protocol'
3
- require_relative 'instabot/version'
4
- require_relative 'instabot/actions'
5
- require_relative 'instabot/grabber'
6
- require_relative 'instabot/banner'
7
- require_relative 'instabot/logger'
8
- require_relative 'instabot/config'
9
- require_relative 'instabot/login'
10
- require_relative 'instabot/modes'
11
- require_relative 'instabot/core'
1
+ require_relative 'instabot/create_protocol'
2
+ require_relative 'instabot/tor_protocol'
3
+ require_relative 'instabot/version'
4
+ require_relative 'instabot/actions'
5
+ require_relative 'instabot/grabber'
6
+ require_relative 'instabot/banner'
7
+ require_relative 'instabot/logger'
8
+ require_relative 'instabot/config'
9
+ require_relative 'instabot/login'
10
+ require_relative 'instabot/modes'
11
+ require_relative 'instabot/core'
@@ -1,56 +1,56 @@
1
- module Actions
2
- def follow(user_id)
3
- log("trying to follow a user [#{user_id}]", 'ACTIONS')
4
- check_login_status
5
- url = "https://www.instagram.com/web/friendships/#{user_id}/follow/"
6
- set_mechanic_data
7
- response = @agent.post(url, @params, @headers)
8
- save_action_log user_id, :follow
9
- @local_stroage[:followed_users] << user_id
10
- { user_id: user_id, response_code: response.code }
11
- end
12
-
13
- def unfollow(user_id)
14
- log("trying to unfollow a user [#{user_id}]", 'ACTIONS')
15
- check_login_status
16
- url = "https://www.instagram.com/web/friendships/#{user_id}/unfollow/"
17
- set_mechanic_data
18
- response = @agent.post(url, @params, @headers)
19
- save_action_log user_id, :unfollow
20
- @local_stroage[:unfollowed_users] << user_id
21
- { user_id: user_id, response_code: response.code }
22
- end
23
-
24
- def like(media_id)
25
- log("trying to like a media[#{media_id}]", 'ACTIONS')
26
- check_login_status
27
- url = "https://www.instagram.com/web/likes/#{media_id}/like/"
28
- set_mechanic_data
29
- response = @agent.post(url, @params, @headers)
30
- save_action_log media_id, :like
31
- @local_stroage[:liked_medias] << media_id
32
- { media_id: media_id, response_code: response.code }
33
- end
34
-
35
- def unlike(media_id)
36
- log("trying to unlike a media[#{media_id}]", 'ACTIONS')
37
- check_login_status
38
- url = "https://www.instagram.com/web/likes/#{media_id}/unlike/"
39
- set_mechanic_data
40
- response = @agent.post(url, @params, @headers)
41
- save_action_log media_id, :unlike
42
- @local_stroage[:unliked_medias] << media_id
43
- { media_id: media_id, response_code: response.code }
44
- end
45
-
46
- def comment(media_id, text = '')
47
- log("trying to send a comment to media[#{media_id}]", 'ACTIONS')
48
- check_login_status
49
- url = "https://www.instagram.com/web/comments/#{media_id}/add/"
50
- set_mechanic_data(comment_text: text.to_s)
51
- response = @agent.post(url, @params, @headers)
52
- save_action_log media_id, :comment
53
- @local_stroage[:commented_medias] << media_id
54
- { media_id: media_id, response_code: response.code }
55
- end
56
- end
1
+ module Actions
2
+ def follow(user_id)
3
+ log("trying to follow a user [#{user_id}]", 'ACTIONS')
4
+ check_login_status
5
+ url = "https://www.instagram.com/web/friendships/#{user_id}/follow/"
6
+ set_mechanic_data
7
+ response = @agent.post(url, @params, @headers)
8
+ save_action_log user_id, :follow
9
+ @local_stroage[:followed_users] << user_id
10
+ { user_id: user_id, response_code: response.code }
11
+ end
12
+
13
+ def unfollow(user_id)
14
+ log("trying to unfollow a user [#{user_id}]", 'ACTIONS')
15
+ check_login_status
16
+ url = "https://www.instagram.com/web/friendships/#{user_id}/unfollow/"
17
+ set_mechanic_data
18
+ response = @agent.post(url, @params, @headers)
19
+ save_action_log user_id, :unfollow
20
+ @local_stroage[:unfollowed_users] << user_id
21
+ { user_id: user_id, response_code: response.code }
22
+ end
23
+
24
+ def like(media_id)
25
+ log("trying to like a media[#{media_id}]", 'ACTIONS')
26
+ check_login_status
27
+ url = "https://www.instagram.com/web/likes/#{media_id}/like/"
28
+ set_mechanic_data
29
+ response = @agent.post(url, @params, @headers)
30
+ save_action_log media_id, :like
31
+ @local_stroage[:liked_medias] << media_id
32
+ { media_id: media_id, response_code: response.code }
33
+ end
34
+
35
+ def unlike(media_id)
36
+ log("trying to unlike a media[#{media_id}]", 'ACTIONS')
37
+ check_login_status
38
+ url = "https://www.instagram.com/web/likes/#{media_id}/unlike/"
39
+ set_mechanic_data
40
+ response = @agent.post(url, @params, @headers)
41
+ save_action_log media_id, :unlike
42
+ @local_stroage[:unliked_medias] << media_id
43
+ { media_id: media_id, response_code: response.code }
44
+ end
45
+
46
+ def comment(media_id, text = '')
47
+ log("trying to send a comment to media[#{media_id}]", 'ACTIONS')
48
+ check_login_status
49
+ url = "https://www.instagram.com/web/comments/#{media_id}/add/"
50
+ set_mechanic_data(comment_text: text.to_s)
51
+ response = @agent.post(url, @params, @headers)
52
+ save_action_log media_id, :comment
53
+ @local_stroage[:commented_medias] << media_id
54
+ { media_id: media_id, response_code: response.code }
55
+ end
56
+ end
@@ -1,16 +1,16 @@
1
- module Banner
2
- def print_banner
3
- if options[:print_banner]
4
- puts <<-BANNER
5
- ██╗███╗ ██╗███████╗████████╗ █████╗ ██████╗ ██████╗ ████████╗
6
- ██║████╗ ██║██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██╔═══██╗╚══██╔══╝
7
- ██║██╔██╗ ██║███████╗ ██║ ███████║██████╔╝██║ ██║ ██║
8
- ██║██║╚██╗██║╚════██║ ██║ ██╔══██║██╔══██╗██║ ██║ ██║
9
- ██║██║ ╚████║███████║ ██║ ██║ ██║██████╔╝╚██████╔╝ ██║
10
- ╚═╝╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═╝
11
-
12
- BANNER
13
- puts 'An instagram bot works without instagram api '.white.bold + 'github.com/'.cyan + "eVanilla/instabot.rb\n".cyan.bold.italic
14
- end
15
- end
16
- end
1
+ module Banner
2
+ def print_banner
3
+ if options[:print_banner]
4
+ puts <<-BANNER
5
+ ██╗███╗ ██╗███████╗████████╗ █████╗ ██████╗ ██████╗ ████████╗
6
+ ██║████╗ ██║██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██╔═══██╗╚══██╔══╝
7
+ ██║██╔██╗ ██║███████╗ ██║ ███████║██████╔╝██║ ██║ ██║
8
+ ██║██║╚██╗██║╚════██║ ██║ ██╔══██║██╔══██╗██║ ██║ ██║
9
+ ██║██║ ╚████║███████║ ██║ ██║ ██║██████╔╝╚██████╔╝ ██║
10
+ ╚═╝╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═╝
11
+
12
+ BANNER
13
+ puts 'An instagram bot works without instagram api '.white.bold + 'github.com/'.cyan + "eVanilla/instabot.rb\n".cyan.bold.italic
14
+ end
15
+ end
16
+ end
@@ -1,51 +1,51 @@
1
- module Config
2
-
3
- class << self
4
- attr_accessor :options
5
- end
6
-
7
- def self.setup
8
- self.options ||= Configuration.new
9
- yield(options)
10
- end
11
-
12
- class Configuration
13
- attr_accessor :username, :password, :tags, :use_proxy, :proxy, :comments,
14
- :print_banner, :pre_load, :wait_per_action, :infinite_tags,
15
- :max_like_per_day, :max_follow_per_day, :max_unfollow_per_day,
16
- :max_comment_per_day, :unwanted_list, :white_list_users,
17
- :log_status, :use_tor, :add_tag_per_post, :unwanted_list,
18
- :white_list_users
19
-
20
- def initialize
21
- @wait_per_action = 1 * 60
22
- @max_comment_per_day = 50
23
- @max_follow_per_day = 50
24
- @max_like_per_day = 50
25
- @max_unfollow_per_day = 50
26
- @username = nil
27
- @password = nil
28
- @proxy = nil
29
- @username = nil
30
- @infinite_tags = true
31
- @pre_load = true
32
- @print_banner = true
33
- @log_status = true
34
- @use_proxy = false
35
- @use_tor = false
36
- @add_tag_per_post = 1
37
- @tags = []
38
- @unwanted_list = []
39
- @white_list_users = []
40
-
41
- @comments = [
42
- %w[this the your],
43
- %w[photo picture pic shot snapshot],
44
- %w[is looks feels is really],
45
- %w[great super good very good good wow WOW cool GREAT magnificent magical very cool stylish beautiful so beautiful so stylish so professional lovely so lovely very lovely glorious so glorious very glorious adorable excellent amazing],
46
- %w[. .. ... ! !! !!!]
47
- ]
48
- end
49
- end
50
-
51
- end
1
+ module Config
2
+
3
+ class << self
4
+ attr_accessor :options
5
+ end
6
+
7
+ def self.setup
8
+ self.options ||= Configuration.new
9
+ yield(options)
10
+ end
11
+
12
+ class Configuration
13
+ attr_accessor :username, :password, :tags, :use_proxy, :proxy, :comments,
14
+ :print_banner, :pre_load, :wait_per_action, :infinite_tags,
15
+ :max_like_per_day, :max_follow_per_day, :max_unfollow_per_day,
16
+ :max_comment_per_day, :unwanted_list, :white_list_users,
17
+ :log_status, :use_tor, :add_tag_per_post, :unwanted_list,
18
+ :white_list_users
19
+
20
+ def initialize
21
+ @wait_per_action = 1 * 60
22
+ @max_comment_per_day = 50
23
+ @max_follow_per_day = 50
24
+ @max_like_per_day = 50
25
+ @max_unfollow_per_day = 50
26
+ @username = nil
27
+ @password = nil
28
+ @proxy = nil
29
+ @username = nil
30
+ @infinite_tags = true
31
+ @pre_load = true
32
+ @print_banner = true
33
+ @log_status = true
34
+ @use_proxy = false
35
+ @use_tor = false
36
+ @add_tag_per_post = 1
37
+ @tags = []
38
+ @unwanted_list = []
39
+ @white_list_users = []
40
+
41
+ @comments = [
42
+ %w[this the your],
43
+ %w[photo picture pic shot snapshot],
44
+ %w[is looks feels is really],
45
+ %w[great super good very good good wow WOW cool GREAT magnificent magical very cool stylish beautiful so beautiful so stylish so professional lovely so lovely very lovely glorious so glorious very glorious adorable excellent amazing],
46
+ %w[. .. ... ! !! !!!]
47
+ ]
48
+ end
49
+ end
50
+
51
+ end
@@ -1,108 +1,113 @@
1
- #
2
- # @descriptions An instagram bot works without instagram api and only needs your username & password
3
- # @Authors eVanilla + https://github.com/eVanilla/instabot.rb/graphs/contributors
4
- #
5
-
6
- %w[colorize mechanize io/console hashie json logger pp active_support/core_ext/numeric/time rbconfig net/telnet socksify socksify/http].each { |gem| require gem }
7
-
8
- # main core class
9
- class Instabot
10
-
11
- # including helpers
12
- include Version
13
- include Modes
14
- include Actions
15
- include Banner
16
- include Config
17
- include Grabber
18
- include Login
19
- include Log
20
- include Protocol
21
- include TorProtocol
22
-
23
- attr_accessor :users, :medias, :media_information, :user_information
24
-
25
- def initialize(mode = :default)
26
- @login_mode = mode
27
- @users = []
28
- @medias = []
29
- @log_counter = 0
30
- @login_counter = 1
31
- @login_status = false
32
- @lib_dir = "#{Dir.pwd}/lib"
33
- @root_dir = Dir.pwd.to_s
34
- @logs_dir = "#@root_dir/logs"
35
- @started_time = Time.new.strftime('%H-%M-%S--%y-%m-%d')
36
- @errors_iteration = 0
37
-
38
- Configuration.new if @login_mode == :manual
39
-
40
- @local_stroage = {
41
- followed_users: [],
42
- unfollowed_users: [],
43
- liked_medias: [],
44
- unliked_medias: [],
45
- commented_medias: []
46
- }
47
-
48
- @maximums = {
49
- follows_in_day: 0,
50
- unfollows_in_day: 0,
51
- likes_in_day: 0,
52
- comments_in_day: 0,
53
- max_follows_per_day: options[:max_follow_per_day],
54
- max_unfollows_per_day: options[:max_unfollow_per_day],
55
- max_likes_per_day: options[:max_like_per_day],
56
- max_comments_per_day: options[:max_comment_per_day]
57
- }
58
-
59
- intro(mode)
60
- end
61
-
62
- # will return Config.options...
63
- def options
64
- if @login_mode == :default
65
- {
66
- comments: Config.options.comments,
67
- max_comment_per_day: Config.options.max_comment_per_day,
68
- max_follow_per_day: Config.options.max_follow_per_day,
69
- max_like_per_day: Config.options.max_like_per_day,
70
- max_unfollow_per_day: Config.options.max_unfollow_per_day,
71
- username: Config.options.username,
72
- password: Config.options.password,
73
- pre_load: Config.options.pre_load,
74
- print_banner: Config.options.print_banner,
75
- proxy: Config.options.proxy,
76
- tags: Config.options.tags,
77
- use_proxy: Config.options.use_proxy,
78
- use_tor: Config.options.use_tor,
79
- wait_per_action: Config.options.wait_per_action,
80
- log_status: Config.options.log_status,
81
- add_tag_per_post: Config.options.add_tag_per_post,
82
- unwanted_list: Config.options.unwanted_list,
83
- white_list_users: Config.options.white_list_users,
84
- }
85
- else
86
- {
87
- max_comment_per_day: :infinite,
88
- max_follow_per_day: :infinite,
89
- max_like_per_day: :infinite,
90
- max_unfollow_per_day: :infinite
91
- }
92
- end
93
- end
94
-
95
- def intro(mode)
96
- trap('INT') { exit! }
97
- print_banner
98
- check_log_files
99
- log('log files are checked', 'CORE')
100
- log('Machine started', 'CORE')
101
- create_protocol
102
- puts '[+] '.cyan + 'Processing successfully completed'
103
- log('Processing successfully completed', 'CORE')
104
- unless mode != :default
105
- login
106
- end
107
- end
108
- end
1
+ #
2
+ # @descriptions An instagram bot works without instagram api and only needs your username & password
3
+ # @Authors eVanilla + https://github.com/eVanilla/instabot.rb/graphs/contributors
4
+ #
5
+
6
+ %w[colorize mechanize io/console hashie json logger pp active_support/core_ext/numeric/time rbconfig net/telnet socksify socksify/http].each { |gem| require gem }
7
+
8
+ # main core class
9
+ class Instabot
10
+
11
+ # including helpers
12
+ include Version
13
+ include Modes
14
+ include Actions
15
+ include Banner
16
+ include Config
17
+ include Grabber
18
+ include Login
19
+ include Log
20
+ include Protocol
21
+ include TorProtocol
22
+
23
+ attr_accessor :users, :medias, :media_information, :user_information
24
+
25
+ def initialize(mode = :default)
26
+ @login_mode = mode
27
+ @users = []
28
+ @medias = []
29
+ @log_counter = 0
30
+ @login_counter = 1
31
+ @login_status = false
32
+ @lib_dir = "#{Dir.pwd}/lib"
33
+ @root_dir = Dir.pwd.to_s
34
+ @logs_dir = "#@root_dir/logs"
35
+ @started_time = Time.new.strftime('%H-%M-%S--%y-%m-%d')
36
+ @errors_iteration = 0
37
+ # auto increments
38
+ @follows_auto_increment = 0
39
+ @unfollows_auto_increment = 0
40
+ @likes_auto_increment = 0
41
+ @comments_auto_increment = 0
42
+
43
+ Configuration.new if @login_mode == :manual
44
+
45
+ @local_stroage = {
46
+ followed_users: [],
47
+ unfollowed_users: [],
48
+ liked_medias: [],
49
+ unliked_medias: [],
50
+ commented_medias: []
51
+ }
52
+
53
+ @maximums = {
54
+ follows_in_day: 0,
55
+ unfollows_in_day: 0,
56
+ likes_in_day: 0,
57
+ comments_in_day: 0,
58
+ max_follows_per_day: options[:max_follow_per_day],
59
+ max_unfollows_per_day: options[:max_unfollow_per_day],
60
+ max_likes_per_day: options[:max_like_per_day],
61
+ max_comments_per_day: options[:max_comment_per_day]
62
+ }
63
+
64
+ intro(mode)
65
+ end
66
+
67
+ # will return Config.options...
68
+ def options
69
+ if @login_mode == :default
70
+ {
71
+ comments: Config.options.comments,
72
+ max_comment_per_day: Config.options.max_comment_per_day,
73
+ max_follow_per_day: Config.options.max_follow_per_day,
74
+ max_like_per_day: Config.options.max_like_per_day,
75
+ max_unfollow_per_day: Config.options.max_unfollow_per_day,
76
+ username: Config.options.username,
77
+ password: Config.options.password,
78
+ pre_load: Config.options.pre_load,
79
+ print_banner: Config.options.print_banner,
80
+ proxy: Config.options.proxy,
81
+ tags: Config.options.tags,
82
+ use_proxy: Config.options.use_proxy,
83
+ use_tor: Config.options.use_tor,
84
+ wait_per_action: Config.options.wait_per_action,
85
+ log_status: Config.options.log_status,
86
+ add_tag_per_post: Config.options.add_tag_per_post,
87
+ unwanted_list: Config.options.unwanted_list,
88
+ white_list_users: Config.options.white_list_users,
89
+ }
90
+ else
91
+ {
92
+ max_comment_per_day: :infinite,
93
+ max_follow_per_day: :infinite,
94
+ max_like_per_day: :infinite,
95
+ max_unfollow_per_day: :infinite
96
+ }
97
+ end
98
+ end
99
+
100
+ def intro(mode)
101
+ trap('INT') { exit! }
102
+ print_banner
103
+ check_log_files
104
+ log('log files are checked', 'CORE')
105
+ log('Machine started', 'CORE')
106
+ create_protocol
107
+ puts '[+] '.cyan + 'Processing successfully completed'
108
+ log('Processing successfully completed', 'CORE')
109
+ unless mode != :default
110
+ login
111
+ end
112
+ end
113
+ end