zorki 0.1.9 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/Gemfile.lock +53 -98
- data/lib/zorki/scrapers/scraper.rb +11 -4
- data/lib/zorki/version.rb +1 -1
- data/zorki.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1e635e294bb6e73e0e57481ba79d23c603bab3ebbd73bbb4939d12f615644098
|
|
4
|
+
data.tar.gz: 876ce40814980d04a962c8002662bf7462a269fa7b6885d89c419b1a2a64c8e0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 552de3b78d4bce7c18d6e0df96d3fdb4eb2b1b43e35961a64617e738510be4979453fe496a55e642329f47d2e4fc8ced52ff390263f39c010693eee4e71a9074
|
|
7
|
+
data.tar.gz: 07be9124885ef2eedf0b7433385e1a29a1c1fd33c58686530d99b7c9767784df6b1b7343c57c97157fed756c196d33125b35e621da9a7bf4737da1855a05c911
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,33 +1,18 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
zorki (0.1.
|
|
4
|
+
zorki (0.1.9)
|
|
5
5
|
apparition
|
|
6
6
|
capybara
|
|
7
7
|
oj
|
|
8
8
|
selenium-devtools
|
|
9
|
-
selenium-webdriver
|
|
9
|
+
selenium-webdriver (~> 4.19)
|
|
10
10
|
typhoeus
|
|
11
11
|
|
|
12
12
|
GEM
|
|
13
13
|
remote: https://rubygems.org/
|
|
14
14
|
specs:
|
|
15
|
-
|
|
16
|
-
actionview (= 7.1.0.beta1)
|
|
17
|
-
activesupport (= 7.1.0.beta1)
|
|
18
|
-
nokogiri (>= 1.8.5)
|
|
19
|
-
rack (>= 2.2.4)
|
|
20
|
-
rack-session (>= 1.0.1)
|
|
21
|
-
rack-test (>= 0.6.3)
|
|
22
|
-
rails-dom-testing (~> 2.2)
|
|
23
|
-
rails-html-sanitizer (~> 1.6)
|
|
24
|
-
actionview (7.1.0.beta1)
|
|
25
|
-
activesupport (= 7.1.0.beta1)
|
|
26
|
-
builder (~> 3.1)
|
|
27
|
-
erubi (~> 1.11)
|
|
28
|
-
rails-dom-testing (~> 2.2)
|
|
29
|
-
rails-html-sanitizer (~> 1.6)
|
|
30
|
-
activesupport (7.1.0.beta1)
|
|
15
|
+
activesupport (7.1.3.2)
|
|
31
16
|
base64
|
|
32
17
|
bigdecimal
|
|
33
18
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
@@ -37,125 +22,98 @@ GEM
|
|
|
37
22
|
minitest (>= 5.1)
|
|
38
23
|
mutex_m
|
|
39
24
|
tzinfo (~> 2.0)
|
|
40
|
-
addressable (2.8.
|
|
25
|
+
addressable (2.8.6)
|
|
41
26
|
public_suffix (>= 2.0.2, < 6.0)
|
|
42
27
|
apparition (0.6.0)
|
|
43
28
|
capybara (~> 3.13, < 4)
|
|
44
29
|
websocket-driver (>= 0.6.5)
|
|
45
30
|
ast (2.4.2)
|
|
46
|
-
base64 (0.
|
|
47
|
-
bigdecimal (3.1.
|
|
48
|
-
|
|
49
|
-
capybara (3.39.2)
|
|
31
|
+
base64 (0.2.0)
|
|
32
|
+
bigdecimal (3.1.7)
|
|
33
|
+
capybara (3.40.0)
|
|
50
34
|
addressable
|
|
51
35
|
matrix
|
|
52
36
|
mini_mime (>= 0.1.3)
|
|
53
|
-
nokogiri (~> 1.
|
|
37
|
+
nokogiri (~> 1.11)
|
|
54
38
|
rack (>= 1.6.0)
|
|
55
39
|
rack-test (>= 0.6.3)
|
|
56
40
|
regexp_parser (>= 1.5, < 3.0)
|
|
57
41
|
xpath (~> 3.2)
|
|
58
|
-
concurrent-ruby (1.2.
|
|
42
|
+
concurrent-ruby (1.2.3)
|
|
59
43
|
connection_pool (2.4.1)
|
|
60
|
-
crass (1.0.6)
|
|
61
44
|
curb (1.0.5)
|
|
62
|
-
debug (1.
|
|
63
|
-
irb (
|
|
64
|
-
reline (>= 0.3.
|
|
45
|
+
debug (1.9.1)
|
|
46
|
+
irb (~> 1.10)
|
|
47
|
+
reline (>= 0.3.8)
|
|
65
48
|
dotenv (2.7.6)
|
|
66
|
-
drb (2.
|
|
67
|
-
ruby2_keywords
|
|
68
|
-
erubi (1.12.0)
|
|
49
|
+
drb (2.2.1)
|
|
69
50
|
ethon (0.16.0)
|
|
70
51
|
ffi (>= 1.15.0)
|
|
71
|
-
ffi (1.
|
|
72
|
-
i18n (1.14.
|
|
52
|
+
ffi (1.16.3)
|
|
53
|
+
i18n (1.14.4)
|
|
73
54
|
concurrent-ruby (~> 1.0)
|
|
74
|
-
io-console (0.
|
|
75
|
-
irb (1.
|
|
55
|
+
io-console (0.7.2)
|
|
56
|
+
irb (1.12.0)
|
|
76
57
|
rdoc
|
|
77
|
-
reline (>= 0.
|
|
78
|
-
json (2.
|
|
58
|
+
reline (>= 0.4.2)
|
|
59
|
+
json (2.7.1)
|
|
79
60
|
language_server-protocol (3.17.0.3)
|
|
80
|
-
loofah (2.21.3)
|
|
81
|
-
crass (~> 1.0.2)
|
|
82
|
-
nokogiri (>= 1.12.0)
|
|
83
61
|
matrix (0.4.2)
|
|
84
62
|
mini_mime (1.1.5)
|
|
85
|
-
minitest (5.
|
|
86
|
-
mutex_m (0.
|
|
87
|
-
nokogiri (1.
|
|
63
|
+
minitest (5.22.3)
|
|
64
|
+
mutex_m (0.2.0)
|
|
65
|
+
nokogiri (1.16.3-arm64-darwin)
|
|
88
66
|
racc (~> 1.4)
|
|
89
|
-
oj (3.16.
|
|
90
|
-
|
|
91
|
-
|
|
67
|
+
oj (3.16.3)
|
|
68
|
+
bigdecimal (>= 3.0)
|
|
69
|
+
parallel (1.24.0)
|
|
70
|
+
parser (3.3.0.5)
|
|
92
71
|
ast (~> 2.4.1)
|
|
93
72
|
racc
|
|
94
|
-
psych (5.1.
|
|
73
|
+
psych (5.1.2)
|
|
95
74
|
stringio
|
|
96
|
-
public_suffix (5.0.
|
|
97
|
-
racc (1.7.
|
|
75
|
+
public_suffix (5.0.4)
|
|
76
|
+
racc (1.7.3)
|
|
98
77
|
rack (3.0.8)
|
|
99
|
-
rack-session (2.0.0)
|
|
100
|
-
rack (>= 3.0.0)
|
|
101
78
|
rack-test (2.1.0)
|
|
102
79
|
rack (>= 1.3)
|
|
103
|
-
rackup (2.1.0)
|
|
104
|
-
rack (>= 3)
|
|
105
|
-
webrick (~> 1.8)
|
|
106
|
-
rails-dom-testing (2.2.0)
|
|
107
|
-
activesupport (>= 5.0.0)
|
|
108
|
-
minitest
|
|
109
|
-
nokogiri (>= 1.6)
|
|
110
|
-
rails-html-sanitizer (1.6.0)
|
|
111
|
-
loofah (~> 2.21)
|
|
112
|
-
nokogiri (~> 1.14)
|
|
113
|
-
railties (7.1.0.beta1)
|
|
114
|
-
actionpack (= 7.1.0.beta1)
|
|
115
|
-
activesupport (= 7.1.0.beta1)
|
|
116
|
-
irb
|
|
117
|
-
rackup (>= 1.0.0)
|
|
118
|
-
rake (>= 12.2)
|
|
119
|
-
thor (~> 1.0, >= 1.2.2)
|
|
120
|
-
zeitwerk (~> 2.6)
|
|
121
80
|
rainbow (3.1.1)
|
|
122
|
-
rake (13.0
|
|
123
|
-
rdoc (6.
|
|
81
|
+
rake (13.1.0)
|
|
82
|
+
rdoc (6.6.3.1)
|
|
124
83
|
psych (>= 4.0.0)
|
|
125
|
-
regexp_parser (2.
|
|
126
|
-
reline (0.
|
|
84
|
+
regexp_parser (2.9.0)
|
|
85
|
+
reline (0.5.0)
|
|
127
86
|
io-console (~> 0.5)
|
|
128
87
|
rexml (3.2.6)
|
|
129
|
-
rubocop (1.
|
|
130
|
-
base64 (~> 0.1.1)
|
|
88
|
+
rubocop (1.62.1)
|
|
131
89
|
json (~> 2.3)
|
|
132
90
|
language_server-protocol (>= 3.17.0)
|
|
133
91
|
parallel (~> 1.10)
|
|
134
|
-
parser (>= 3.
|
|
92
|
+
parser (>= 3.3.0.2)
|
|
135
93
|
rainbow (>= 2.2.2, < 4.0)
|
|
136
94
|
regexp_parser (>= 1.8, < 3.0)
|
|
137
95
|
rexml (>= 3.2.5, < 4.0)
|
|
138
|
-
rubocop-ast (>= 1.
|
|
96
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
|
139
97
|
ruby-progressbar (~> 1.7)
|
|
140
98
|
unicode-display_width (>= 2.4.0, < 3.0)
|
|
141
|
-
rubocop-ast (1.
|
|
142
|
-
parser (>= 3.
|
|
143
|
-
rubocop-md (1.2.
|
|
99
|
+
rubocop-ast (1.31.2)
|
|
100
|
+
parser (>= 3.3.0.4)
|
|
101
|
+
rubocop-md (1.2.2)
|
|
144
102
|
rubocop (>= 1.0)
|
|
145
|
-
rubocop-minitest (0.
|
|
146
|
-
rubocop (>= 1.
|
|
103
|
+
rubocop-minitest (0.35.0)
|
|
104
|
+
rubocop (>= 1.61, < 2.0)
|
|
105
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
|
147
106
|
rubocop-packaging (0.5.2)
|
|
148
107
|
rubocop (>= 1.33, < 2.0)
|
|
149
|
-
rubocop-performance (1.
|
|
150
|
-
rubocop (>= 1.
|
|
151
|
-
rubocop-ast (>=
|
|
108
|
+
rubocop-performance (1.20.2)
|
|
109
|
+
rubocop (>= 1.48.1, < 2.0)
|
|
110
|
+
rubocop-ast (>= 1.30.0, < 2.0)
|
|
152
111
|
rubocop-rails (2.19.1)
|
|
153
112
|
activesupport (>= 4.2.0)
|
|
154
113
|
rack (>= 1.1)
|
|
155
114
|
rubocop (>= 1.33.0, < 2.0)
|
|
156
|
-
rubocop-rails_config (1.
|
|
157
|
-
|
|
158
|
-
rubocop (>= 1.48.0)
|
|
115
|
+
rubocop-rails_config (1.16.0)
|
|
116
|
+
rubocop (>= 1.57.0)
|
|
159
117
|
rubocop-ast (>= 1.26.0)
|
|
160
118
|
rubocop-md
|
|
161
119
|
rubocop-minitest (~> 0.22)
|
|
@@ -163,29 +121,26 @@ GEM
|
|
|
163
121
|
rubocop-performance (~> 1.11)
|
|
164
122
|
rubocop-rails (~> 2.0)
|
|
165
123
|
ruby-progressbar (1.13.0)
|
|
166
|
-
ruby2_keywords (0.0.5)
|
|
167
124
|
rubyzip (2.3.2)
|
|
168
|
-
selenium-devtools (0.
|
|
125
|
+
selenium-devtools (0.123.0)
|
|
169
126
|
selenium-webdriver (~> 4.2)
|
|
170
|
-
selenium-webdriver (4.
|
|
127
|
+
selenium-webdriver (4.19.0)
|
|
128
|
+
base64 (~> 0.2)
|
|
171
129
|
rexml (~> 3.2, >= 3.2.5)
|
|
172
130
|
rubyzip (>= 1.2.2, < 3.0)
|
|
173
131
|
websocket (~> 1.0)
|
|
174
|
-
stringio (3.0
|
|
175
|
-
|
|
176
|
-
typhoeus (1.4.0)
|
|
132
|
+
stringio (3.1.0)
|
|
133
|
+
typhoeus (1.4.1)
|
|
177
134
|
ethon (>= 0.9.0)
|
|
178
135
|
tzinfo (2.0.6)
|
|
179
136
|
concurrent-ruby (~> 1.0)
|
|
180
|
-
unicode-display_width (2.
|
|
181
|
-
webrick (1.8.1)
|
|
137
|
+
unicode-display_width (2.5.0)
|
|
182
138
|
websocket (1.2.10)
|
|
183
139
|
websocket-driver (0.7.6)
|
|
184
140
|
websocket-extensions (>= 0.1.0)
|
|
185
141
|
websocket-extensions (0.1.5)
|
|
186
142
|
xpath (3.2.0)
|
|
187
143
|
nokogiri (~> 1.8)
|
|
188
|
-
zeitwerk (2.6.11)
|
|
189
144
|
|
|
190
145
|
PLATFORMS
|
|
191
146
|
arm64-darwin-22
|
|
@@ -171,6 +171,7 @@ module Zorki
|
|
|
171
171
|
end
|
|
172
172
|
|
|
173
173
|
def login
|
|
174
|
+
puts "Attempting to login..."
|
|
174
175
|
# Reset the sessions so that there's nothing laying around
|
|
175
176
|
# page.driver.browser.close
|
|
176
177
|
|
|
@@ -193,16 +194,20 @@ module Zorki
|
|
|
193
194
|
# Try to log in
|
|
194
195
|
loop_count = 0
|
|
195
196
|
while loop_count < 5 do
|
|
197
|
+
puts "Attempting to fill login field ##{loop_count}"
|
|
198
|
+
|
|
196
199
|
fill_in("username", with: ENV["INSTAGRAM_USER_NAME"])
|
|
197
200
|
fill_in("password", with: ENV["INSTAGRAM_PASSWORD"])
|
|
198
201
|
|
|
199
202
|
begin
|
|
200
|
-
|
|
203
|
+
find_button("Log in").click() # Note: "Log in" (lowercase `in`) should be exact instead, it redirects to Facebook's login page
|
|
201
204
|
rescue Capybara::ElementNotFound; end # If we can't find it don't break horribly, just keep waiting
|
|
202
205
|
|
|
203
|
-
break unless has_css?('p[data-testid="login-error-message"', wait:
|
|
206
|
+
break unless has_css?('p[data-testid="login-error-message"', wait: 3)
|
|
204
207
|
loop_count += 1
|
|
205
|
-
|
|
208
|
+
random_length = rand(1...2)
|
|
209
|
+
puts "Sleeping for #{random_length} seconds"
|
|
210
|
+
sleep(random_length)
|
|
206
211
|
end
|
|
207
212
|
|
|
208
213
|
# Sometimes Instagram just... doesn't let you log in
|
|
@@ -210,7 +215,9 @@ module Zorki
|
|
|
210
215
|
|
|
211
216
|
# No we don't want to save our login credentials
|
|
212
217
|
begin
|
|
213
|
-
|
|
218
|
+
puts "Checking and clearing Save Info button..."
|
|
219
|
+
|
|
220
|
+
find_button("Save Info").click()
|
|
214
221
|
rescue Capybara::ElementNotFound; end
|
|
215
222
|
end
|
|
216
223
|
|
data/lib/zorki/version.rb
CHANGED
data/zorki.gemspec
CHANGED
|
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
|
33
33
|
spec.add_dependency "apparition" # A Chrome driver for Capybara
|
|
34
34
|
spec.add_dependency "typhoeus" # For making API requests
|
|
35
35
|
spec.add_dependency "oj" # A faster JSON parser/loader than stdlib
|
|
36
|
-
spec.add_dependency "selenium-webdriver" # Webdriver selenium
|
|
36
|
+
spec.add_dependency "selenium-webdriver", "~> 4.19" # Webdriver selenium
|
|
37
37
|
spec.add_dependency "selenium-devtools" # Allow us to intercept requests
|
|
38
38
|
|
|
39
39
|
spec.add_development_dependency "debug"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zorki
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.20
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Christopher Guess
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-03-
|
|
11
|
+
date: 2024-03-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: capybara
|
|
@@ -70,16 +70,16 @@ dependencies:
|
|
|
70
70
|
name: selenium-webdriver
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
|
-
- - "
|
|
73
|
+
- - "~>"
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '
|
|
75
|
+
version: '4.19'
|
|
76
76
|
type: :runtime
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
|
-
- - "
|
|
80
|
+
- - "~>"
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: '
|
|
82
|
+
version: '4.19'
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
84
|
name: selenium-devtools
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|