vaccine-finder 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/vaccine-finder +4 -1
- metadata +15 -114
- data/lib/vaccine-spotter.rb +0 -102
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28ea66e1730dd2e4da6102f270b3f2fbda7b141d1569cf8f662f3589f4c8b883
|
4
|
+
data.tar.gz: 0f79d01cf6359e40ef46983e2b5d16e49d3400ef5a5c06ea26531af3ae1dcd94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 763255171300f4d508c8c617ff198db6f642685a0b7c5a95b1ff7eef094d460a73b90269a867edb75f2fbb532e994dff4dd142881513dcc97872819ed046eeb6
|
7
|
+
data.tar.gz: f490c38a631c1d4fac08eae3958fb7a0a0a4d085159293df108b0ae9823823c9b8e3664094ae7548cce7785f3d71efa90563a2955da1fe1f294d3bb9944b0e1e
|
data/bin/vaccine-finder
CHANGED
@@ -1,3 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
3
|
+
puts "Error: This gem/project/thing has been renamed 'vaccine-spotter', and I'm no longer maintaining this version ('vaccine-finder'). Please run `gem install vaccine-spotter`, update your Gemfile, or install using Homebrew. Sorry about this!"
|
4
|
+
puts "See the project repo/homepage for more: https://github.com/jltml/vaccine-spotter-cli"
|
5
|
+
puts "-Jack"
|
6
|
+
abort
|
metadata
CHANGED
@@ -1,131 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vaccine-finder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack MapelLentz
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
12
|
-
dependencies:
|
13
|
-
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
version: 0.6.0
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 0.6.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: tty-prompt
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 0.23.0
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 0.23.0
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: tty-config
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 0.4.0
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 0.4.0
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: toml
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 0.2.0
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 0.2.0
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: pastel
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 0.8.0
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 0.8.0
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: terminal-notifier
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '2.0'
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '2.0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: launchy
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '2.5'
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '2.5'
|
111
|
-
description: This gem will notify you when COVID-19 vaccine appointments are available
|
112
|
-
matching certain criteria (a list of zip codes, type of vaccine, etc). It currently
|
113
|
-
pretty much just wraps the very beta API from the absolutely wonderful vaccinespotter.org,
|
114
|
-
though I hope to add my own website scraping soon too so as to improve response
|
115
|
-
times.
|
116
|
-
email:
|
11
|
+
date: 2021-04-15 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: "(***moved to the gem 'vaccine-spotter'***) This gem will notify you
|
14
|
+
when COVID-19 vaccine appointments are available matching certain criteria (a list
|
15
|
+
of zip codes, type of vaccine, etc). It currently pretty much just wraps the very
|
16
|
+
beta API from the absolutely wonderful vaccinespotter.org, though I hope to add
|
17
|
+
my own website scraping soon too so as to improve response times."
|
18
|
+
email:
|
117
19
|
executables:
|
118
20
|
- vaccine-finder
|
119
21
|
extensions: []
|
120
22
|
extra_rdoc_files: []
|
121
23
|
files:
|
122
24
|
- bin/vaccine-finder
|
123
|
-
|
124
|
-
homepage: https://github.com/jltml/vaccine-finder
|
25
|
+
homepage: https://github.com/jltml/vaccine-spotter-cli
|
125
26
|
licenses:
|
126
27
|
- MIT
|
127
28
|
metadata: {}
|
128
|
-
post_install_message:
|
29
|
+
post_install_message:
|
129
30
|
rdoc_options: []
|
130
31
|
require_paths:
|
131
32
|
- lib
|
@@ -140,8 +41,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
41
|
- !ruby/object:Gem::Version
|
141
42
|
version: '0'
|
142
43
|
requirements: []
|
143
|
-
rubygems_version: 3.
|
144
|
-
signing_key:
|
44
|
+
rubygems_version: 3.2.16
|
45
|
+
signing_key:
|
145
46
|
specification_version: 4
|
146
|
-
summary:
|
47
|
+
summary: Moved to the gem 'vaccine-spotter'
|
147
48
|
test_files: []
|
data/lib/vaccine-spotter.rb
DELETED
@@ -1,102 +0,0 @@
|
|
1
|
-
#################################################################
|
2
|
-
# This is basically a wrapper around https://vaccinespotter.org #
|
3
|
-
#################################################################
|
4
|
-
|
5
|
-
require "open-uri"
|
6
|
-
require "json"
|
7
|
-
require "net/http"
|
8
|
-
require "terminal-notifier"
|
9
|
-
require "pastel"
|
10
|
-
require "toml"
|
11
|
-
require "tty-config"
|
12
|
-
require "tty-prompt"
|
13
|
-
require "launchy"
|
14
|
-
|
15
|
-
pastel = Pastel.new
|
16
|
-
config = TTY::Config.new
|
17
|
-
prompt = TTY::Prompt.new
|
18
|
-
|
19
|
-
config.filename = "vaccine-finder"
|
20
|
-
config.extname = ".toml"
|
21
|
-
config.append_path "#{Dir.home}/.config"
|
22
|
-
|
23
|
-
if !config.exist?
|
24
|
-
puts
|
25
|
-
puts pastel.bold "Hi, welcome to the unofficial vaccinespotter.org CLI notifier thing!"
|
26
|
-
puts "It looks like you don't have a configuration file yet. Would you like to create one?"
|
27
|
-
create_config = prompt.yes? "Create `~/.config/vaccine-finder.toml`?"
|
28
|
-
if create_config
|
29
|
-
set_state = prompt.ask("What state would you like to monitor? (Two-letter postal code, please)", required: true) do |q|
|
30
|
-
q.modify :up, :remove
|
31
|
-
end
|
32
|
-
config.set(:state, value: set_state)
|
33
|
-
puts "Ok, time to set zip codes…"
|
34
|
-
if prompt.yes? "freemaptools.com has a really helpful tool for getting the zip codes around a radius. Would you like to open it?"
|
35
|
-
Launchy.open "https://www.freemaptools.com/find-zip-codes-inside-radius.htm"
|
36
|
-
end
|
37
|
-
set_zips = prompt.ask("What zip codes would you like to track? You can paste here from freemaptools.com, if you used it (comma-separated list of integers, please)", convert: :int_list, required: true)
|
38
|
-
config.set(:zips, value: set_zips)
|
39
|
-
set_vaccine_types = prompt.multi_select("Which types of vaccines would you like to include?", %w(pfizer moderna jj unknown), min: 1, show_help: :always)
|
40
|
-
config.set(:vaccine_types, value: set_vaccine_types)
|
41
|
-
set_refresh_rate = prompt.ask("How often should the script check for updates? (seconds)", convert: :int, required: true)
|
42
|
-
config.set(:refresh_rate, value: set_refresh_rate)
|
43
|
-
puts "Perfect; writing to `~/.config/vaccine-finder.toml`…"
|
44
|
-
config.write
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
zips = config.read["zips"]
|
49
|
-
state = config.read["state"]
|
50
|
-
refresh_rate = config.read["refresh_rate"].to_i
|
51
|
-
vaccine_types = config.read["vaccine_types"]
|
52
|
-
|
53
|
-
puts
|
54
|
-
print pastel.bold "vaccinespotter.org CLI notifier thing"
|
55
|
-
begin
|
56
|
-
print " v#{Gem.loaded_specs["vaccine-finder"].version}"
|
57
|
-
rescue
|
58
|
-
print " [error loading version]"
|
59
|
-
end
|
60
|
-
puts pastel.dim ", by Jack MapelLentz (jltml.me)"
|
61
|
-
puts pastel.dim "This script uses the wonderful vaccinespotter.org, by Nick Muerdter (github.com/GUI)"
|
62
|
-
puts "Checking #{pastel.underline zips.length} zip codes in #{pastel.underline state} every #{pastel.underline refresh_rate} seconds"
|
63
|
-
puts "Filtering appointments for #{pastel.underline vaccine_types.to_s.tr("[]\"", "")}"
|
64
|
-
puts pastel.dim "Press control-C to quit"
|
65
|
-
|
66
|
-
excluded = Array.new
|
67
|
-
|
68
|
-
loop do
|
69
|
-
|
70
|
-
number_excluded = excluded.length
|
71
|
-
|
72
|
-
json = Net::HTTP.get(URI("https://www.vaccinespotter.org/api/v0/states/#{state}.json"))
|
73
|
-
parsed_json = JSON.parse(json)
|
74
|
-
|
75
|
-
puts
|
76
|
-
|
77
|
-
if (Time.now.strftime("%M").to_i%5 == 0) && (Time.now.strftime("%S").to_i < refresh_rate)
|
78
|
-
excluded.clear
|
79
|
-
puts "List of excluded/checked stores cleared"
|
80
|
-
end
|
81
|
-
|
82
|
-
parsed_json["features"].each_index do |i|
|
83
|
-
current = parsed_json["features"][i]["properties"]
|
84
|
-
if (current["appointments_available"] == true) and (zips.include?(current["postal_code"].to_i) and (!excluded.include? current["id"].to_i) and !(vaccine_types & current["appointment_vaccine_types"].keys).empty?)
|
85
|
-
puts "- #{pastel.green.bold current["city"]} #{pastel.green.bold current["provider_brand_name"]}: #{current["url"]}"
|
86
|
-
puts " - #{current["appointment_vaccine_types"]} as of #{Time.parse(current["appointments_last_fetched"]).localtime.strftime("%H:%M:%S")}"
|
87
|
-
TerminalNotifier.notify("#{current["provider_brand_name"]} - #{current["city"]}", :title => "vaccine-finder", :open => "#{current["url"]}")
|
88
|
-
excluded.append current["id"].to_i
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
print pastel.dim "Checked at #{Time.now.strftime("%H:%M:%S")} on #{Time.now.strftime("%Y-%m-%d")}"
|
93
|
-
if number_excluded == 1
|
94
|
-
print pastel.dim " (#{number_excluded} checked location excluded)"
|
95
|
-
elsif number_excluded != 0
|
96
|
-
print pastel.dim " (#{number_excluded} checked locations excluded)"
|
97
|
-
end
|
98
|
-
puts
|
99
|
-
|
100
|
-
sleep refresh_rate
|
101
|
-
|
102
|
-
end
|