don't track hugo.toml and add example files
This commit is contained in:
parent
bb0554610d
commit
2f39c0c1b8
4 changed files with 71 additions and 15 deletions
36
example.fetch-and-convert.sh
Executable file
36
example.fetch-and-convert.sh
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Configuration
|
||||
PUBKEY="YOUR_PUBKEY"
|
||||
RELAY="wss://mega.supercool.relay"
|
||||
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"
|
||||
|
||||
echo "Saved to $DATA_DIR/$output.json"
|
||||
done
|
||||
|
||||
echo "All data fetched and converted!"
|
||||
echo "JSONL files have been removed."
|
||||
|
||||
echo "Building website"
|
||||
Loading…
Add table
Add a link
Reference in a new issue