forki 0.1.1 → 0.1.2
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/Gemfile +2 -0
- data/Gemfile.lock +3 -1
- data/lib/forki/scrapers/post_scraper.rb +3 -2
- data/lib/forki/scrapers/scraper.rb +9 -6
- data/lib/forki/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0736d43f45a908cbae8d8685a9e91b0863fc635a0544065fa3afb23d4664b64e
|
|
4
|
+
data.tar.gz: 1954cd17cb5997446cdc8040f36f0cd531c32184581f5cde20ae5783c495664d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0ee46a3fe486e66f8d91a9cc025443f8c2fd98644cc2eb97effee03358ba7ca27976e2ec3d18af14d4678091c7d46a7005ed1ffe1e7744be4b783efaa0cbac58
|
|
7
|
+
data.tar.gz: f94fdbec137832b79ff52c6a63c2a2bb1d777a629df5ec474b11d18ee85335c5fd31f83d2d02dbbe31996f23e3cbb5570bd2582c98c6779744acdd39d45e98ee
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
forki (0.1.
|
|
4
|
+
forki (0.1.1)
|
|
5
5
|
apparition
|
|
6
6
|
capybara
|
|
7
7
|
oj
|
|
@@ -48,6 +48,7 @@ GEM
|
|
|
48
48
|
xpath (~> 3.2)
|
|
49
49
|
concurrent-ruby (1.2.2)
|
|
50
50
|
crass (1.0.6)
|
|
51
|
+
curb (1.0.5)
|
|
51
52
|
dotenv (2.7.6)
|
|
52
53
|
erubi (1.12.0)
|
|
53
54
|
ethon (0.16.0)
|
|
@@ -150,6 +151,7 @@ PLATFORMS
|
|
|
150
151
|
|
|
151
152
|
DEPENDENCIES
|
|
152
153
|
byebug
|
|
154
|
+
curb (~> 1.0, >= 1.0.5)
|
|
153
155
|
dotenv (~> 2.7.6)
|
|
154
156
|
forki!
|
|
155
157
|
minitest (~> 5.0)
|
|
@@ -6,6 +6,7 @@ require "dotenv/load"
|
|
|
6
6
|
require "oj"
|
|
7
7
|
require "selenium-webdriver"
|
|
8
8
|
require "open-uri"
|
|
9
|
+
require 'selenium/webdriver/remote/http/curb'
|
|
9
10
|
|
|
10
11
|
options = Selenium::WebDriver::Options.chrome(exclude_switches: ["enable-automation"])
|
|
11
12
|
options.add_argument("--start-maximized")
|
|
@@ -20,8 +21,8 @@ options.add_argument("--remote-debugging-port=9222")
|
|
|
20
21
|
options.add_argument("--user-data-dir=/tmp/tarun_forki_#{SecureRandom.uuid}")
|
|
21
22
|
|
|
22
23
|
Capybara.register_driver :selenium_forki do |app|
|
|
23
|
-
client = Selenium::WebDriver::Remote::Http::
|
|
24
|
-
client.read_timeout = 60 # Don't wait 60 seconds to return Net::ReadTimeoutError. We'll retry through Hypatia after 10 seconds
|
|
24
|
+
client = Selenium::WebDriver::Remote::Http::Curb.new
|
|
25
|
+
# client.read_timeout = 60 # Don't wait 60 seconds to return Net::ReadTimeoutError. We'll retry through Hypatia after 10 seconds
|
|
25
26
|
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options, http_client: client)
|
|
26
27
|
end
|
|
27
28
|
|
|
@@ -97,8 +98,8 @@ module Forki
|
|
|
97
98
|
options.add_argument("--user-data-dir=/tmp/tarun_forki_#{SecureRandom.uuid}")
|
|
98
99
|
|
|
99
100
|
Capybara.register_driver :selenium_forki do |app|
|
|
100
|
-
client = Selenium::WebDriver::Remote::Http::
|
|
101
|
-
client.read_timeout = 60 # Don't wait 60 seconds to return Net::ReadTimeoutError. We'll retry through Hypatia after 10 seconds
|
|
101
|
+
client = Selenium::WebDriver::Remote::Http::Curb.new
|
|
102
|
+
# client.read_timeout = 60 # Don't wait 60 seconds to return Net::ReadTimeoutError. We'll retry through Hypatia after 10 seconds
|
|
102
103
|
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options, http_client: client)
|
|
103
104
|
end
|
|
104
105
|
|
|
@@ -110,7 +111,9 @@ module Forki
|
|
|
110
111
|
raise MissingCredentialsError if ENV["FACEBOOK_EMAIL"].nil? || ENV["FACEBOOK_PASSWORD"].nil?
|
|
111
112
|
|
|
112
113
|
url ||= "https://www.facebook.com"
|
|
113
|
-
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
page.driver.browser.navigate.to(url) # Visit the url passed in or the facebook homepage if nothing is
|
|
114
117
|
|
|
115
118
|
# Look for "login_form" box, which throws an error if not found. So we catch it and run the rest of the tests
|
|
116
119
|
begin
|
|
@@ -120,7 +123,7 @@ module Forki
|
|
|
120
123
|
end
|
|
121
124
|
|
|
122
125
|
# Since we're not logged in, let's do that quick
|
|
123
|
-
|
|
126
|
+
page.driver.browser.navigate.to("https://www.facebook.com") if login_form.nil?
|
|
124
127
|
|
|
125
128
|
login_form.fill_in("email", with: ENV["FACEBOOK_EMAIL"])
|
|
126
129
|
login_form.fill_in("pass", with: ENV["FACEBOOK_PASSWORD"])
|
data/lib/forki/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: forki
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ''
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-05-
|
|
11
|
+
date: 2023-05-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: capybara
|