aboutsummaryrefslogtreecommitdiff
path: root/bin/ak2html
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2023-03-29 23:45:49 +0300
committerkaotisk <kaotisk@arching-kaos.org>2023-03-29 23:45:49 +0300
commit286b71a6ead8c7234cfbc0b8ece05c8239a4f32c (patch)
treef4662c1517fe14018d93c5503a72b8ba9da0c674 /bin/ak2html
parentb5394a6bd9f0b9fbd9bafc3e963dafbbc87f2ed2 (diff)
downloadarching-kaos-tools-286b71a6ead8c7234cfbc0b8ece05c8239a4f32c.tar.gz
arching-kaos-tools-286b71a6ead8c7234cfbc0b8ece05c8239a4f32c.tar.bz2
arching-kaos-tools-286b71a6ead8c7234cfbc0b8ece05c8239a4f32c.zip
Renamed everything
Diffstat (limited to 'bin/ak2html')
-rwxr-xr-xbin/ak2html45
1 files changed, 45 insertions, 0 deletions
diff --git a/bin/ak2html b/bin/ak2html
new file mode 100755
index 0000000..1fb0114
--- /dev/null
+++ b/bin/ak2html
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+# Check if there are enough arguments
+if [ $# -lt 1 ]
+then
+ echo "Error: Not enough arguments provided"
+ exit 1
+fi
+
+# Create HTML document
+echo "<html>"
+echo "<head>"
+echo " <title>Arching Kaos Chain Data</title>"
+echo "</head>"
+echo "<body>"
+
+# Iterate through each argument and parse data
+for arg in "$@"
+do
+ # Extract data from argument
+ zblock=$(echo $arg | jq -r '.zblock')
+ block=$(echo $arg | jq -r '.block')
+ timestamp=$(echo $arg | jq -r '.timestamp')
+ block_signature=$(echo $arg | jq -r '.block_signature')
+ detach=$(echo $arg | jq -r '.detach')
+ module=$(echo $arg | jq -r '.module')
+ action=$(echo $arg | jq -r '.action')
+ gpg=$(echo $arg | jq -r '.gpg')
+ previous=$(echo $arg | jq -r '.previous')
+
+ # Output data in HTML format
+ echo " <h2>ZBLOCK: $zblock</h2>"
+ echo " <p>BLOCK: $block</p>"
+ echo " <p>TIMESTAMP: $timestamp</p>"
+ echo " <p>BLOCK SIGNATURE: $block_signature</p>"
+ echo " <p>DETACH: $detach</p>"
+ echo " <p>MODULE: $module</p>"
+ echo " <p>ACTION: $action</p>"
+ echo " <p>GPG: $gpg</p>"
+ echo " <p>PREVIOUS: $previous</p>"
+done
+
+echo "</body>"
+echo "</html>"
+