Skip to content

Commit 9df79ec

Browse files
committed
Added issue time support
1 parent 3078eb6 commit 9df79ec

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ EAS ENDEC.
1717

1818
Please please please please PLEASE use this responsibly. Did you just buy an old ENDEC on eBay and want to put it through its paces? This is the script for you!
1919

20-
Don't use this to hack / exploit anything. I made this for funsies in a few hours. Please use it accordingly.
20+
Don't use this to hack / exploit anything. Please use it accordingly.
2121

2222
# Installation
2323
To Run: `python3 <location of same.py> <args>`
@@ -55,6 +55,7 @@ For a more condenced version, check out [the readme of the dsame repo](https://g
5555
| --location00 | -l00 | 000000 | | A location code |
5656
| --location** | -l** | | | ** when between 01 and 30 are additional location codes |
5757
| --time | -t | 0015 | | How long the duration is. |
58+
| --issued | -i | now | 1100420 | Current date/time. DDDHHMM UTC format. (day is day of year out of 365 or 366). If left blank, it will be the current time. |
5859
| --callsign | -cs | KEAX/NWS | | Callsign of station broadcasting |
5960

6061
# Self-activating

same.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
import datetime # EAS alerts are heavily dependent on timestamps so this makes it easy to send a thing now
88
import argparse
99

10+
# EAS alerts are heavily dependent on timestamps so this makes it easy/fun to send a thing now
11+
sameCompatibleTimestamp = datetime.datetime.now().strftime("%j%H%M")
12+
13+
1014
# parse command-line arguments
1115
parser = argparse.ArgumentParser()
1216
parser.add_argument("--code", "-c", nargs='?', default="")
@@ -48,6 +52,7 @@
4852
parser.add_argument("--location29", "-l29", nargs='?', default=None)
4953
parser.add_argument("--location30", "-l30", nargs='?', default=None)
5054
parser.add_argument("--time", "-t", nargs='?', default="0015")
55+
parser.add_argument("--issued", "-i", nargs='?', default=sameCompatibleTimestamp)
5156
parser.add_argument("--callsign", "-cs", nargs='?', default="KEAX/NWS")
5257
args = parser.parse_args()
5358
######## CONFIG / constants ########
@@ -145,10 +150,6 @@ def preamble():
145150
# CombinedTone =
146151

147152

148-
149-
# EAS alerts are heavily dependent on timestamps so this makes it easy/fun to send a thing now
150-
sameCompatibleTimestamp = datetime.datetime.now().strftime("%j%H%M")
151-
152153
LocationList = ""
153154
# arguments are location.00 to location.30
154155
if args.location != None:
@@ -164,7 +165,7 @@ def preamble():
164165
if LocationList == "":
165166
LocationList = "000000"
166167
print(LocationList)
167-
code = "ZCZC" + "-" + args.org + "-" + args.event + "" + LocationList + "+" + args.time + "-" + sameCompatibleTimestamp + "-" + args.callsign + "-"
168+
code = "ZCZC" + "-" + args.org + "-" + args.event + "" + LocationList + "+" + args.time + "-" + args.issued + "-" + args.callsign + "-"
168169
if args.code != "" and args.code != None and args.code != " ":
169170
code = args.code
170171

0 commit comments

Comments
 (0)