czds

- ICANN Centralized Zone Data Service Tool
git clone git://git.acid.vegas/czds.git
Log | Files | Refs | Archive | README | LICENSE

commit 3edd5fbcbc2e540faf693b5df536b5ff7454d92c
parent 542573a469eaebea6f7dcced6d554d8047feb2be
Author: acidvegas <acid.vegas@acid.vegas>
Date: Tue, 5 Mar 2024 21:24:01 -0500

Added statistics generation script for zone file stats

Diffstat:
MREADME.md | 4++--
Aextras/genstats | 19+++++++++++++++++++
Rstats.csv -> extras/stats.csv | 0

3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
@@ -7,7 +7,7 @@ Zone files are updated once every 24 hours, specifically from 00:00 UTC to 06:00
 
 At the time of writing this repository, the CZDS offers access to 1,151 zones in total.
 
-1,079 have been approved, 55 are still pending *(after 3 months)*, 10 have been revoked because the TLDs are longer active, and 6 have been denied. Zones that have expired automatically had the expiration extended for me without doing anything, aside from 13 zones that remained expired. I have included a recent [stats file](./stats_2024-01-31.csv) directly from my ICANN account.
+1,079 have been approved, 55 are still pending *(after 3 months)*, 10 have been revoked because the TLDs are longer active, and 6 have been denied. Zones that have expired automatically had the expiration extended for me without doing anything, aside from 13 zones that remained expired. I have included a recent [stats file](./extras/stats.csv) directly from my ICANN account.
 
 ## Usage
 ### Authentication
@@ -29,7 +29,7 @@ python czds.py [--username <username> --password <password>] [--concurrency <int
 ```
 
 ## Respects
-While ICANN does have an official [czds-api-client-python](https://github.com/icann/czds-api-client-python) repository, I rewrote it from scratch to be more streamline & included a POSIX version for portability. There is some [official documentation](https://raw.githubusercontent.com/icann/czds-api-client-java/master/docs/ICANN_CZDS_api.pdf) that was referenced in the creation of the POSIX version. Either way, big props to ICANN for allowing me to use the CZDS for research purposes!
+While ICANN does have an official [czds-api-client-python](https://github.com/icann/czds-api-client-python) repository, I rewrote it from scratch to be more streamline & included a [POSIX version](./czds) for portability. There is some [official documentation](https://raw.githubusercontent.com/icann/czds-api-client-java/master/docs/ICANN_CZDS_api.pdf) that was referenced in the creation of the POSIX version. Either way, big props to ICANN for allowing me to use the CZDS for research purposes!
 
 ___
 
diff --git a/extras/genstats b/extras/genstats
@@ -0,0 +1,18 @@
+#!/bin/sh
+# CZDS Stats Generator from Report - developed by acidvegas (https://git.acid.vegas/czds)
+
+input="$1"
+
+[ ! -f "$input" ] && echo "error: '$input' not found." && exit 1
+
+tail -n +2 "$input" | while IFS=, read -r email tld_name status last_updated reason expire_date; do
+    clean_status=$(echo $status | tr -d '"')
+    case $clean_status in
+        "approved") echo "$email,$tld_name,$status,$last_updated,$reason,$expire_date" >> approved.txt ;;
+        "denied")   echo "$email,$tld_name,$status,$last_updated,$reason,$expire_date" >> denied.txt   ;;
+        "expired")  echo "$email,$tld_name,$status,$last_updated,$reason,$expire_date" >> expired.txt  ;;
+        "pending")  echo "$email,$tld_name,$status,$last_updated,$reason,$expire_date" >> pending.txt  ;;
+        "revoked")  echo "$email,$tld_name,$status,$last_updated,$reason,$expire_date" >> revoked.txt  ;;
+        *)          echo "Unknown status: $clean_status" ;;
+    esac
+done
+\ No newline at end of file
diff --git a/stats.csv b/extras/stats.csv