UrgentcareCLI 0.2.3 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/UrgentCare/CLI.rb +0 -1
- data/lib/UrgentCare/Scraper.rb +9 -13
- data/lib/UrgentCare/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bab08152ad85f276f094c6202e03379e6e90581a61746717c92b66518c1cda9
|
4
|
+
data.tar.gz: 90cdbaf39daf7f4004443e720b9eb9749900122c320a61b0892dea983f11efbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9115429d70b1d4b6e666634af00bb9e84511990c782973731de291c5982b0d26a2d4b2768b657c75b2c6bc5fb3870565ebd0028866911a8231def7d494207f46
|
7
|
+
data.tar.gz: e4df29cc01aad3a4131bf2c8bfa60f5b55764efb01ec014638275a55fd0155722ab756bbfd255ad3134c06a15bd2eef794a5ec0f386b667a209f2ad66faeae98
|
data/lib/UrgentCare/CLI.rb
CHANGED
data/lib/UrgentCare/Scraper.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'webdrivers'
|
2
|
+
|
1
3
|
class Urgentcare::Scraper
|
2
4
|
|
3
5
|
def initialize(office = Urgentcare::Office, scraper: Urgentcare::Scraper)
|
@@ -30,40 +32,34 @@ class Urgentcare::Scraper
|
|
30
32
|
end
|
31
33
|
|
32
34
|
def get_office_list #called first in CLI
|
33
|
-
@new_page = get_page.css('
|
35
|
+
@new_page = get_page.css('p')[2..]
|
34
36
|
office_url
|
35
37
|
end
|
36
38
|
|
37
39
|
def office_url
|
38
40
|
@new_page.each do |office_details| #does not create additional objects. returns original object
|
39
|
-
@@url << office_details
|
41
|
+
@@url << office_details
|
40
42
|
@office_details = office_details
|
41
43
|
make_office
|
42
44
|
end
|
43
45
|
end
|
44
46
|
|
45
|
-
def get_clinic_site
|
46
|
-
@@browser.goto(@@url[$index])
|
47
|
-
@js_doc = @@browser.iframe.wait_until(&:present?)
|
48
|
-
get_appttime_date
|
49
|
-
end
|
50
|
-
|
51
47
|
def make_office
|
52
48
|
@off = @office.new
|
53
|
-
@off.name = @office_details.css('
|
54
|
-
@off.url = @office_details.css('a')[
|
55
|
-
@off.phone_number = @office_details.css('a[href]').text
|
49
|
+
@off.name = @office_details.css('a')[0].text
|
50
|
+
@off.url = @office_details.css('a')[0][name="href"]
|
51
|
+
@off.phone_number = @office_details.css('a[href]')[1].text
|
56
52
|
end
|
57
53
|
|
58
54
|
def get_appttime_date #retrieve waittime and add to new office model
|
59
55
|
sleep(1);
|
60
56
|
iframe_info = Nokogiri::HTML(@js_doc.html)
|
61
|
-
if iframe_info.css('div.time-slots')
|
57
|
+
if !iframe_info.css('div.time-slots').empty?
|
62
58
|
@wait_day = iframe_info.css('div.d-flex.d-md-none.header').text
|
63
59
|
@wait_time = iframe_info.css('div.time-slot.selected').text
|
64
60
|
@office.all[$index].next_available = "#{@wait_day} #{@wait_time}"
|
65
61
|
else
|
66
|
-
@wait_time = "
|
62
|
+
@wait_time = "Walk-in only due to staffing shortages"
|
67
63
|
@office.all[$index].next_available = "#{@wait_time}"
|
68
64
|
end
|
69
65
|
end
|
data/lib/UrgentCare/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: UrgentcareCLI
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PamelaTorres-Rocca
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
requirements: []
|
133
|
-
rubygems_version: 3.3.
|
133
|
+
rubygems_version: 3.3.7
|
134
134
|
signing_key:
|
135
135
|
specification_version: 4
|
136
136
|
summary: UrgentCareCLI Gem
|