Skip to content

Instantly share code, notes, and snippets.

View ZaptorZap's full-sized avatar
:electron:
i dont wantn to see this . hate ecletron jjava scrdirpt

Zaptor ZaptorZap

:electron:
i dont wantn to see this . hate ecletron jjava scrdirpt
View GitHub Profile
@ZaptorZap
ZaptorZap / TR-cutoff-generator.sh
Created August 6, 2022 09:25
Generate TR cutoffs or "thresholds" for the TETR.IO webgame's ranked "TETRA LEAGUE" by interfacing with its public TETRA CHANNEL API. • Output is in valid JSON format.
#!/bin/bash
wget https://ch.tetr.io/api/users/lists/league/all --output-document ~/Downloads/all.json
originalranks=( "x" "u" "ss" "s+" "s" "s-" "a+" "a" "a-" "b+" "b" "b-" "c+" "c" "c-" "d+" )
originaltuiiranks=( "x" "u" "ss" "sp" "s" "sm" "ap" "a" "am" "bp" "b" "bm" "cp" "c" "cm" "dp" )
# short for Original Tenchi Ultra Improved Indistinguishable Ranks • created this way for compatibility with applications that depended on the output of data found on https://tetrio.team2xh.net/?t=ranks
printf "{\"date\":\"$(date --utc +"%Y-%m-%d %H:%M:%S UTC")\",\"thresholds\":[" > ~/Downloads/thresholds.json # begin the JSON object
for index in {0..15}; do