autoluv 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +30 -30
- data/lib/autoluv.rb +0 -8
- data/lib/autoluv/southwestclient.rb +2 -1
- data/lib/autoluv/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: 1fa9c3673d12aa12e12b72694adf279ad740f61766722994a4b2841089db4dee
|
4
|
+
data.tar.gz: 95c3e70497b34a07facbbda0ae72f2107cf8e43849158022fddc1a4252b09438
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3eb77985fedabc42a7180c42e703e6685c15de245fbdf01d761f2d5ba72e4115c447b2eba6955c5c0a4305c9703e77056facf58daf94d0728c09cb1bb4af8e76
|
7
|
+
data.tar.gz: df23cb0ac4b2eaeb5a1747f53eed6118556572e667e143be0b2334c8832741a7c22a36fa34ca74b679958503176d1c3c1d3248d8b45192153519858d0989aa69
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -10,22 +10,21 @@ Automatically check in to Southwest flights using this easy-to-use gem. It'll al
|
|
10
10
|
|
11
11
|
### Schedule a Check In
|
12
12
|
|
13
|
-
# both departing and returning flights (if applicable) are scheduled.
|
14
13
|
autoluv schedule ABCDEF John Doe
|
15
14
|
|
16
|
-
|
17
|
-
|
15
|
+
Both departing and returning flights (if applicable) will be scheduled. After scheduling, there's no need to keep the terminal window open or active. The check in will happen behind the scenes at the appropriate time.
|
16
|
+
|
17
|
+
**Note:** If a name includes a space, wrap it in double quotes (e.g. "John Doe")
|
18
18
|
|
19
19
|
### Schedule a Check In With Email Notification
|
20
20
|
|
21
|
-
|
21
|
+
Follow the instructions below for configuring email notifications.
|
22
|
+
|
23
|
+
autoluv schedule ABCDEF John Doe john.doe@email.com
|
22
24
|
|
23
|
-
|
25
|
+
A second email address can be passed in as well and get the results BCCed to it.
|
24
26
|
|
25
|
-
|
26
|
-
# schedule flights for friends but also want to be notified of the results.
|
27
|
-
# NOTE: put your email address in the first field and your friend's in the second.
|
28
|
-
autoluv schedule ABCDEF John Doe your.email@helloworld.com john.doe@helloworld.com
|
27
|
+
autoluv schedule ABCDEF John Doe john.doe@email.com second.email@bcc.com
|
29
28
|
|
30
29
|
### Check In Immediately
|
31
30
|
|
@@ -37,51 +36,49 @@ This is optional, however, highly recommended. Especially if a scheduled check i
|
|
37
36
|
|
38
37
|
On a successful check in, the email will share boarding positions for each passenger.
|
39
38
|
|
40
|
-
|
41
|
-
|
42
|
-
Create the file `.autoluv.env` in your user's home directory.
|
39
|
+
**Step 1:** Create the file `.autoluv.env` in your user's home directory.
|
43
40
|
|
44
|
-
|
45
|
-
nano .autoluv.env
|
41
|
+
nano ~/.autoluv.env
|
46
42
|
|
47
|
-
|
48
|
-
|
49
|
-
Copy/paste the following in the text editor.
|
43
|
+
**Step 2:** Copy/paste the following into the text editor.
|
50
44
|
|
51
45
|
```
|
52
|
-
LUV_FROM_EMAIL =
|
53
|
-
LUV_USER_NAME =
|
46
|
+
LUV_FROM_EMAIL = from@email.com
|
47
|
+
LUV_USER_NAME = from@email.com
|
54
48
|
LUV_PASSWORD = supersecurepassword
|
55
|
-
LUV_SMTP_SERVER = smtp.
|
49
|
+
LUV_SMTP_SERVER = smtp.email.com
|
56
50
|
LUV_PORT = 587
|
57
51
|
```
|
58
52
|
|
59
|
-
|
60
|
-
|
61
|
-
Replace the values with the appropriate SMTP settings for your email provider and save the file (`Ctrl+O` to save, `Ctrl+X` to exit the editor).
|
53
|
+
**Step 3:** Replace the values with the appropriate SMTP settings for your email provider. `LUV_FROM_EMAIL` should be the email address associated with `LUV_USER_NAME`.
|
62
54
|
|
63
|
-
|
55
|
+
If your email account has two-factor authentication enabled, be sure to use an app-specific password above (and *not* your account password).
|
64
56
|
|
65
|
-
**
|
57
|
+
**Step 4:** Hit `Ctrl+O` to save the file and then `Ctrl+X` to exit the text editor.
|
66
58
|
|
67
59
|
### Get Text Instead of Email Notifications
|
68
60
|
|
69
61
|
[Use this Zap](https://zapier.com/apps/email/integrations/sms/9241/get-sms-alerts-for-new-email-messages) to get a custom Zapier email address that forwards emails as text messages. It's handy for people like me who don't have email notifications enabled on their phone or computer and want check-in results ASAP.
|
70
62
|
|
71
|
-
|
63
|
+
## Manage Check-Ins
|
72
64
|
|
73
|
-
`autoluv` uses the `at` command behind the scenes to check in at a specific time. Use the related `atq` and `atrm` commands to
|
65
|
+
`autoluv` uses the `at` command behind the scenes to check in at a specific time. Use the related `atq` and `atrm` commands to manage them.
|
66
|
+
|
67
|
+
### View Scheduled Check-Ins
|
68
|
+
Make note of the first column's number.
|
74
69
|
|
75
|
-
# view scheduled check ins (make note of the first column's number)
|
76
70
|
atq
|
77
71
|
11 Tue Sep 22 08:05:00 2020 a user
|
78
72
|
12 Mon Sep 28 15:45:00 2020 a user
|
79
73
|
7 Wed Sep 23 11:40:00 2020 a user
|
80
74
|
|
81
|
-
|
75
|
+
### Cancel a Check-In
|
76
|
+
|
82
77
|
atrm 11
|
83
78
|
|
84
|
-
|
79
|
+
### View Check-In Details
|
80
|
+
The last line in the output will show you the confirmation number and name.
|
81
|
+
|
85
82
|
at -c 11
|
86
83
|
|
87
84
|
## Update Gem
|
@@ -95,3 +92,6 @@ Bug reports and pull requests are welcome.
|
|
95
92
|
## License
|
96
93
|
|
97
94
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
95
|
+
|
96
|
+
# TODO: try getting it working on macos.
|
97
|
+
# TODO: does scheduling pass two-word names to checkin properly?
|
data/lib/autoluv.rb
CHANGED
@@ -55,14 +55,6 @@ module Autoluv
|
|
55
55
|
# only send an email if we have all the environmental variables set
|
56
56
|
return if PONY_OPTIONS.values.any? &:empty?
|
57
57
|
|
58
|
-
# if we're BCCing someone, swap the fields so they don't see your TO address.
|
59
|
-
# this is really for my personal use-case.
|
60
|
-
unless bcc.nil?
|
61
|
-
temp = bcc
|
62
|
-
to = bcc
|
63
|
-
bcc = temp
|
64
|
-
end
|
65
|
-
|
66
58
|
Pony.mail(PONY_OPTIONS.merge({
|
67
59
|
to: to,
|
68
60
|
bcc: bcc,
|
@@ -2,6 +2,7 @@ require "rest-client"
|
|
2
2
|
require "securerandom"
|
3
3
|
require "json"
|
4
4
|
require "tzinfo"
|
5
|
+
require "shellwords"
|
5
6
|
|
6
7
|
module Autoluv
|
7
8
|
class SouthwestClient
|
@@ -27,7 +28,7 @@ module Autoluv
|
|
27
28
|
|
28
29
|
puts "Scheduling flight departing #{flight[:airport_code]} at #{flight[:departure_time]} on #{flight[:departure_date]}."
|
29
30
|
|
30
|
-
command = "echo 'autoluv checkin #{confirmation_number} #{first_name} #{last_name} #{to} #{bcc}' | at #{check_in_time.strftime('%I:%M %p %m/%d/%y')}"
|
31
|
+
command = "echo 'autoluv checkin #{confirmation_number} #{Shellwords.shellescape(first_name)} #{Shellwords.shellescape(last_name)} #{to} #{bcc}' | at #{check_in_time.strftime('%I:%M %p %m/%d/%y')}"
|
31
32
|
`#{command}`
|
32
33
|
|
33
34
|
puts unless x == flights.size - 1
|
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.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Tran
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|