school_declare 0.2.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 00dc71097561b595290bba5b9f9b558e132b21382f9f65bb9e475578a986fc55
4
- data.tar.gz: dd2896f66ebddd6a4da9bd370fa0d46ccf8e3ebfcbb2bf9ae06f49b99cc54751
3
+ metadata.gz: 3ee1baf056ca3ff5e057a12046400aac3dc376e8ba3933fad12ec33c3fd65404
4
+ data.tar.gz: aad4dcac7863d4688ef4702509bff17412b18390ddfc1c5f2ebeb69eadf86b6f
5
5
  SHA512:
6
- metadata.gz: 3d6c8143cd577f9c39f41a73cab1116c0fbd7b8df52e8e32d36208488540077ae1f926682f173a478e2c680938f234838ccce2b9309888dd8e2cc8bc521114ed
7
- data.tar.gz: dd6755caf7cbb2ea4835cd7a170295d7042790b0be2ed1efc54fd6c777e2d73184d2618d8540001d18845221a046c28c7c808db32086e730526d8112de17dd30
6
+ metadata.gz: 7e90f98367b248a1dd4397a26067fc21bd9747c82695eb22a67c806ee72a575f6e41b40b89d8bf497cca24fcdd714bcfec88a5acb433372f8aff5adb23811377
7
+ data.tar.gz: 79d0dec0a4283f03b8dc35fa1da33c7605a3ce98d43a38c3788957c9ffe54086120eb80cd1cdc1701ed2b8f174c9cdaaf8d6995ae06420945f9856927bd80c93
data/README.md CHANGED
@@ -1,11 +1,39 @@
1
1
  # School Health Declaration Automation Script
2
2
 
3
+ - [School Health Declaration Automation Script](#school-health-declaration-automation-script)
4
+ * [How To Use](#how-to-use)
5
+ + [Use as a GitHub Action](#use-as-a-github-action)
6
+ + [Using The Gem](#using-the-gem)
7
+ + [Using The Code](#using-the-code)
8
+ - [Daily health declaration automation](#daily-health-declaration-automation)
9
+ - [Twice weekly antigen test declaration](#twice-weekly-antigen-test-declaration)
10
+ + [Environment Variables](#environment-variables)
11
+ + [Headless Browsing](#headless-browsing)
12
+ * [Troubleshooting](#troubleshooting)
13
+ + ["element click intercepted..."](#-element-click-intercepted-)
14
+ * [Contributing](#contributing)
15
+ * [License](#license)
16
+
3
17
  This is an automation script that will fill out the school's daily health declaration requirement for each child in the parent portal dashboard.
4
18
 
5
19
  It can be run manually or can be connected to a scheduler to run once a day.
6
20
 
7
21
  ## How To Use
8
22
 
23
+ ### Use as a GitHub Action
24
+
25
+ To use this without needing to run any code, you can use it as a GitHub Action in your own GitHub account. To do so follow these steps:
26
+
27
+ 1. Fork this repository to your account
28
+
29
+ ![](readme_images/point_to_fork.png)
30
+
31
+ 2. Create the secrets in your new repository by going to Settings > Secrets > Actions and clicking the "New Repository Secret" for each new secret. Add the correct name for the secret in the "Name" field" and your value in the "Value" field. For the list of secrets you need refer to the [Environment Variables](#environment-variables) section of this README.
32
+
33
+ ![](readme_images/new_repo_secret.png)
34
+
35
+ 3. You can check the status of your automation by clicking on the "Actions" tab in your repository top navigation bar and then clicking on the "Antigen Test Declaration..." Workflow on the left-hand side navigation. A green check means it worked, and a red x mark means something went wrong. You can click on each individual item in the table to see the details.
36
+
9
37
  ### Using The Gem
10
38
 
11
39
  You can use this software as a Ruby gem by downloading it to your machine from Rubygems:
@@ -18,30 +46,71 @@ In your `Gemfile`:
18
46
 
19
47
  ### Using The Code
20
48
 
49
+ You can use this script to either send:
50
+
51
+ * Daily health declaration (*No longer required*)
52
+ * Twice weekly antigen test declaration
53
+
54
+ #### Daily health declaration automation
55
+
21
56
  To use the automation script locally on your machine:
22
57
 
23
58
  * Clone the repository
24
59
  * Run `bundle install`
25
- * Update the values in `.env.sample` and rename it to `.env`. (See (Environment Variables)[#environment-variables] for a description of the values)
60
+ * Update the following values in `.env.sample` and rename it to `.env`. (See (Environment Variables)[#environment-variables] for a description of the values)
61
+ * USERNAME
62
+ * PASSWORD
63
+ * URL
26
64
  * Run `bundle exec ruby bin/declare`
27
65
  * The script will output `Sent from successfully` or report what went wrong at the conclusion of its execution
28
66
 
67
+ #### Twice weekly antigen test declaration
68
+
69
+ To use the antigen test declaration automation script locally on your machine:
70
+
71
+ * Clone the repository
72
+ * Run `bundle install`
73
+ * Update the following values in `.env.sample` and rename it to `.env`. (See (Environment Variables)[#environment-variables] for a description of the values)
74
+ * URL
75
+ * PARENT_TZ
76
+ * PARENT_NAME
77
+ * CHILDRENS_TZ
78
+ * CHILDRENS_NAMES
79
+ * Run `bundle exec ruby bin/declare_antigen`
80
+ * The script will output `Sent from successfully` or report what went wrong at the conclusion of its execution
81
+
29
82
  ### Environment Variables
30
83
 
31
- You need to provide three environment variables for the automation script:
84
+ You need to provide three environment variables for the daily automation script:
32
85
 
33
86
  * `USERNAME`: Your username you obtained from the Ministry of Education
34
87
  * `PASSWORD`: Your password you obtained from the Ministry of Education
35
88
  * `URL`: The unique school website entry point provided by tik-tak, i.e. (`https://my_school.tik-tak.net/enter_tofes_briut`)
36
89
 
90
+ You need to provide the following environment variables for the twice weekly antigen test declaration form script:
91
+
92
+ * `URL`: The URL for the antigen test declaration, i.e. (`https://apps.education.gov.il/NmmNetAnt/Antigen`)
93
+ * `PARENT_TZ`: A parent's teudat zehut number
94
+ * `PARENT_NAME`: A parent's name **in Hebrew**
95
+ * `CHILDRENS_TZ`: The teudat zehut number or numbers of the child/children. **If more than one child, separate with a single "," and NO SPACE.**
96
+ * `CHILDRENS_NAMES`: The name of names of the child/children. **If more than one child, separate with a cingle "," and NO SPACE.**
97
+
37
98
  ### Headless Browsing
38
99
 
39
- The script is set to run in `headless` mode as it navigates to the school website and fills out the form, which means you won't see it complete the process. If you wish, you can set `headless` to `false` and watch it from your computer as it happens instead. To do so open up `declare.rb` and on line 14 change the code to:
100
+ The script is set to run in `headless` mode as it navigates to the school website and fills out the form, which means you won't see it complete the process. If you wish, you can set `headless` to `false` and watch it from your computer as it happens instead. To do so open up `declare.rb` and on line 14 or `declare_antigen.rb` on line 45 and change the code to:
40
101
 
41
102
  ```ruby
42
103
  browser = Watir::Browser.new :chrome, headless: false
43
104
  ```
44
105
 
106
+ ## Troubleshooting
107
+
108
+ ### "element click intercepted..."
109
+
110
+ If you are running the school antigen test declaration form and it fails with an error about the "element click intercepted" it is most likely because the reCAPTCHA on the website prompted for further verification.
111
+
112
+ There is no way to make the script work at this point. You need to manually go to the website and fill it out. The reCAPTCHA *may* reset the next time the script runs and not require the extra verification again.
113
+
45
114
  ## Contributing
46
115
 
47
116
  Contributions to the code are always welcome. You can either raise an issue to be discussed or submit a pull request directly. We try to follow the [GitHub Flow](https://guides.github.com/introduction/flow/) when proposing new features.
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.unshift File.expand_path('..', __FILE__)
4
+
5
+ require_relative '../declare_antigen'
6
+
7
+ DeclareAntigen.call
@@ -1,3 +1,3 @@
1
1
  module Declare
2
- VERSION = '0.2.1'.freeze
2
+ VERSION = '0.4.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,17 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: school_declare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Greenberg
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-30 00:00:00.000000000 Z
11
+ date: 2022-02-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: A gem to help send the daily health forms for Israeli schools using the
14
- tik-tak platform.
13
+ description: A gem to help send the daily health forms for Israeli schools.
15
14
  email:
16
15
  - ben.greenberg@hey.com
17
16
  executables:
@@ -22,6 +21,7 @@ files:
22
21
  - LICENSE.txt
23
22
  - README.md
24
23
  - bin/declare
24
+ - bin/declare_antigen
25
25
  - lib/declare/version.rb
26
26
  homepage: https://github.com/bencgreenberg/school-health-declaration-automation
27
27
  licenses:
@@ -30,7 +30,7 @@ metadata:
30
30
  homepage: https://github.com/bencgreenberg/school-health-declaration-automation
31
31
  source_code_uri: https://github.com/bencgreenberg/school-health-declaration-automation
32
32
  bug_tracker_uri: https://github.com/bencgreenberg/school-health-declaration-automation/issues
33
- post_install_message:
33
+ post_install_message:
34
34
  rdoc_options: []
35
35
  require_paths:
36
36
  - lib
@@ -45,8 +45,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  requirements: []
48
- rubygems_version: 3.1.4
49
- signing_key:
48
+ rubygems_version: 3.3.3
49
+ signing_key:
50
50
  specification_version: 4
51
51
  summary: Automate the sending of health declaration forms for Israeli schools.
52
52
  test_files: []