Added statistics generation script for zone file stats

This commit is contained in:
Dionysus 2024-03-05 21:24:01 -05:00
parent 542573a469
commit 3edd5fbcbc
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE
3 changed files with 20 additions and 2 deletions

View File

@ -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. 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 ## Usage
### Authentication ### Authentication
@ -29,7 +29,7 @@ python czds.py [--username <username> --password <password>] [--concurrency <int
``` ```
## Respects ## 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!
___ ___

18
extras/genstats Normal file
View File

@ -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