did all this shit without even commiting once ffs

This commit is contained in:
sakrecoer 2026-07-31 00:27:45 +02:00
commit 26e489f0bf
12 changed files with 2978 additions and 0 deletions

41
fetch-and-convert.sh Executable file
View file

@ -0,0 +1,41 @@
#!/bin/bash
# Configuration
PUBKEY="setto@basspistol.org"
RELAY="wss://basspistol.org"
DATA_DIR="data"
# Clean up old JSON files (optional)
# rm -f data/*/*.json
# Define kind mappings
declare -A KINDS
KINDS[0]="profile/profile"
KINDS[30023]="longform/blog"
KINDS[36787]="music/tracks"
KINDS[20]="pictures/photos"
KINDS[22]="videos/videos"
# Fetch each kind
for kind in "${!KINDS[@]}"; do
output="${KINDS[$kind]}"
echo "Fetching kind $kind..."
# Create directory if it doesn't exist
mkdir -p "$DATA_DIR/$(dirname "$output")"
# Fetch and convert to JSON
nak req -k "$kind" -a "$PUBKEY" "$RELAY" | jq -s '.' > "$DATA_DIR/$output.json"
# Remove any existing .jsonl file in the same directory
rm -f "$DATA_DIR/$(dirname "$output")"/*.jsonl
echo "Saved to $DATA_DIR/$output.json"
done
echo "All data fetched and converted!"
echo "JSONL files have been removed."
echo "Building website"
hugo build