autoluv 0.3.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/bin/autoluv +4 -0
- data/lib/autoluv/southwestclient.rb +2 -15
- data/lib/autoluv/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: 69b08611a4bc4d79ee318013d6324ec4503fd8f8678af40989d46b4c6ba72564
|
4
|
+
data.tar.gz: 077d0fd2979117501c1742672db5e8e76babe416bbe1fcb4126efcaf43ee228e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c848c8d32f79a6c3ffb2227c6c8c030633585407cf3f0317c0b6960a2b41b9ceeaac4efdcf22ae34b2ee457309b0be6ac13ee9ca9cae3172bb714928319ee336
|
7
|
+
data.tar.gz: e623afb9a414e5384ac3f0136cf8ab572281cd2cd90da5bb0f0400957aec6a752b170dd081e8792251a76deeb0ce33d44491a75ec52fd5e66b5454bfce5fc623
|
data/README.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
Automatically check in to Southwest flights using this easy-to-use gem. It'll also email you the results so you know ASAP whether a check in was successful. Seconds count when you're fighting for that window or aisle seat!
|
4
4
|
|
5
|
+
## ⚠️ February 2023 Update ⚠️
|
6
|
+
|
7
|
+
It appears [southwest-headers](https://github.com/byalextran/southwest-headers) using the latest versions of Chrome (110) and undetected-chromedriver (3.4.6) produces an invalid header file. [Read this thread for a workaround](https://github.com/byalextran/southwest-headers/issues/6).
|
8
|
+
|
5
9
|
## Requirements
|
6
10
|
|
7
11
|
* A *nix-based server that will be on when you need to check in
|
@@ -117,6 +121,11 @@ The last line in the output will show you the confirmation number and name.
|
|
117
121
|
|
118
122
|
at -c 11
|
119
123
|
|
124
|
+
### View All Scheduled Check-In Details
|
125
|
+
Display the list of all scheduled confirmation numbers and names.
|
126
|
+
|
127
|
+
atq | awk '{ print "at -c " $1 }' | bash | grep autoluv
|
128
|
+
|
120
129
|
## Update Gem
|
121
130
|
|
122
131
|
gem update autoluv --conservative
|
data/bin/autoluv
CHANGED
@@ -10,6 +10,10 @@ to = ARGV[4]
|
|
10
10
|
bcc = ARGV[5]
|
11
11
|
|
12
12
|
begin
|
13
|
+
unless File.exist?(ENV["LUV_HEADERS_FILE"].to_s)
|
14
|
+
abort "Please create a valid Southwest header file before continuing. Learn more: https://github.com/byalextran/southwest-headers"
|
15
|
+
end
|
16
|
+
|
13
17
|
case command.downcase
|
14
18
|
when "schedule"
|
15
19
|
Autoluv::SouthwestClient.schedule(confirmation_number, first_name, last_name, to, bcc)
|
@@ -3,9 +3,6 @@ require "securerandom"
|
|
3
3
|
require "json"
|
4
4
|
require "tzinfo"
|
5
5
|
require "shellwords"
|
6
|
-
require "dotenv"
|
7
|
-
|
8
|
-
Dotenv.load("#{Dir.home}/.autoluv.env")
|
9
6
|
|
10
7
|
module Autoluv
|
11
8
|
class SouthwestClient
|
@@ -22,8 +19,6 @@ module Autoluv
|
|
22
19
|
TIME_ZONES_PATH = File.expand_path("../../data/airport_time_zones.json", __dir__)
|
23
20
|
|
24
21
|
def self.schedule(confirmation_number, first_name, last_name, to = nil, bcc = nil)
|
25
|
-
self.check_for_header_file
|
26
|
-
|
27
22
|
flights = self.departing_flights(confirmation_number, first_name, last_name)
|
28
23
|
|
29
24
|
flights.each_with_index do |flight, x|
|
@@ -39,8 +34,6 @@ module Autoluv
|
|
39
34
|
end
|
40
35
|
|
41
36
|
def self.check_in(confirmation_number, first_name, last_name, to = nil, bcc = nil)
|
42
|
-
self.check_for_header_file
|
43
|
-
|
44
37
|
check_in = attempt = nil
|
45
38
|
|
46
39
|
# try checking in multiple times in case the our server time is out of sync with Southwest's.
|
@@ -55,7 +48,7 @@ module Autoluv
|
|
55
48
|
check_in = RestClient.post("#{CHECK_IN_URL}", post_data.to_json, JSON.parse(File.read(ENV["LUV_HEADERS_FILE"])))
|
56
49
|
break
|
57
50
|
rescue RestClient::ExceptionWithResponse => ewr
|
58
|
-
sleep(
|
51
|
+
sleep(0.5)
|
59
52
|
next unless x == num_attempts - 1
|
60
53
|
|
61
54
|
raise
|
@@ -80,7 +73,7 @@ module Autoluv
|
|
80
73
|
end
|
81
74
|
|
82
75
|
metadata = {
|
83
|
-
end_time: end_time.strftime("%I:%M
|
76
|
+
end_time: end_time.strftime("%I:%M:%S"),
|
84
77
|
elapsed_time: (end_time - start_time).round(2),
|
85
78
|
attempts: attempt,
|
86
79
|
}
|
@@ -94,12 +87,6 @@ module Autoluv
|
|
94
87
|
DEFAULT_HEADERS.merge({ "X-User-Experience-ID": SecureRandom.uuid })
|
95
88
|
end
|
96
89
|
|
97
|
-
def self.check_for_header_file
|
98
|
-
unless File.exist?(ENV["LUV_HEADERS_FILE"])
|
99
|
-
abort "Please create a valid Southwest header file before continuing. Learn more: https://github.com/byalextran/southwest-headers"
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
90
|
def self.departing_flights(confirmation_number, first_name, last_name)
|
104
91
|
reservation = RestClient.get("#{RESERVATION_URL}/#{confirmation_number}?first-name=#{first_name}&last-name=#{last_name}", self.headers)
|
105
92
|
reservation_json = JSON.parse(reservation)
|
data/lib/autoluv/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autoluv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Tran
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
|
-
rubygems_version: 3.
|
151
|
+
rubygems_version: 3.4.1
|
152
152
|
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: Easy-to-use gem to check in to Southwest flights automatically. Also supports
|