Add pipeline CMake, source, and fetch script

This commit is contained in:
Aaron Po
2026-03-24 02:10:21 -04:00
parent 581863d69b
commit ad1adfeb62
5 changed files with 247 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
#!/bin/bash
# Fetch breweries data from OpenBreweryDB API and save to JSON files.
# Saves results to misc/raw-data/breweries-complete.json
OUTPUT_DIR="misc/raw-data"
API_BASE="https://api.openbrewerydb.org/v1/breweries"
mkdir -p "$OUTPUT_DIR"
echo "Fetching breweries from OpenBreweryDB API..."
echo "[]" > "$OUTPUT_FILE"
total_count=0
for page in {1..30}; do
echo "Fetching page $page..."
curl -s "$API_BASE?per_page=200&page=$page" | \
jq '.' > "$OUTPUT_DIR/page-$page.json"
count=$(jq 'length' "$OUTPUT_DIR/page-$page.json")
total_count=$((total_count + count))
echo " Got $count breweries (total: $total_count)"
done
echo "Done fetching. Total breweries fetched: $total_count"