Are you tired of manually checking your prize bonds after every draw? PrizeBond Checker automates this process by sending you an email with the results, saving you time and effort. After each draw, you’ll receive a detailed email notification, so you'll instantly know if you’ve won!
- Automatically checks prize bonds against the latest draws.
- Sends detailed results via email.
- Simple setup using GitHub Actions or running locally.
-
Fork the repository.
-
Enable GitHub Actions (Settings -> Actions -> General -> Allow all actions).
-
Set up required secrets: Go to Settings -> Security -> Secrets and Variables -> Actions, and add the following secrets:
Secret Description EMAIL
Your Gmail address used for sending emails PASSWORD
Your Gmail account's app-specific password JSON_FILE_URL
URL of the hosted JSON file containing prize bond information (e.g., Gist) Note: Gmail accounts may require you to generate an app-specific password.
-
Submit your bonds: If you prefer not to fork, you can submit your bonds in the required format via a comment, and they will be added to the public list. You will receive emails every month based on your winnings.
The prize bond data should follow this structure:
{
"your_name": {
"bonds": {
"bond_value": [
["serial_start", "serial_end"],
["serial_start", "serial_end"]
]
},
"email": "your_email",
"cc": ["email1", "email2"]
}
}
Field | Type | Description |
---|---|---|
your_name |
str |
Your name (e.g., "Ali Salman") |
bond_value |
str |
Value of your bond (e.g., "100", "200", "750") |
serial_start |
int |
Starting serial number (e.g., 900101) |
serial_end |
int |
Ending serial number (e.g., 900200) |
your_email |
str |
Email to receive the results |
cc |
list[str] |
List of emails to CC in the result notifications |
{
"Ali Salman": {
"bonds": {
"200": [
[900101, 900200],
[890001, 890200]
],
"750": [
[670701, 670900]
]
},
"email": "[email protected]",
"cc": ["[email protected]", "[email protected]"]
}
}
If you want to run the checker locally, follow these steps:
git clone https://github.com/salman299/prizebond-checker.git
If you don’t have virtualenv
, install it by running:
pip install virtualenv
Then create and activate a virtual environment:
# Create a virtual environment named venv
virtualenv venv
# Activate the virtual environment
source venv/bin/activate
pip install -r requirements.txt
python3 ./main.py
The script supports various optional parameters:
Parameter | Default | Description |
---|---|---|
--year, -y |
Current year | Specify the year of the draw (e.g., 2022 ) |
--month, -m |
Current month | Specify the month of the draw (e.g., 8 for August) |
--send-email, -se |
False | Send the result via email if set to True |
--email, -e |
None | Sender's email (required if using --send-email ) |
--password, -p |
None | Sender's email password (required if using --send-email ) |
--file, -f |
./sample.json |
Path to your prize bond JSON data file |
--file-url, -fu |
None | URL of the hosted JSON file containing prize bond data |
--info |
False | Show logs of the prize bond checking process |
--debug |
False | Show detailed debug logs in the console |
-
Check bonds for August 2022:
python3 ./main.py --year 2022 --month 8 --info
-
Send email notifications:
- Using environment variables:
export EMAIL=<your_email> export PASSWORD=<your_password> python3 ./main.py --send-email --info
- Passing email and password as arguments:
python3 ./main.py --email <your_email> --password <your_password> --send-email --info
-
Use a custom data file:
python3 ./main.py -y 2022 -m 8 -f ./example.json --info