From 3becbff4bdee89267e19f2481e3b9ab194c72904 Mon Sep 17 00:00:00 2001 From: Jarrett Aiken Date: Tue, 5 May 2026 16:43:20 -0400 Subject: [PATCH] Remove unnecessary API call. --- .gitea/workflows/scrape.yml | 2 +- scrape.sh | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/scrape.yml b/.gitea/workflows/scrape.yml index 2e20ea1..ae67762 100644 --- a/.gitea/workflows/scrape.yml +++ b/.gitea/workflows/scrape.yml @@ -3,7 +3,7 @@ name: Scrape latest data on: push: schedule: - - cron: '*/30 * * * *' + - cron: '0 * * * *' workflow_dispatch: jobs: diff --git a/scrape.sh b/scrape.sh index 1e7f7c9..2f51dda 100755 --- a/scrape.sh +++ b/scrape.sh @@ -7,16 +7,12 @@ rm -r out 2>/dev/null || true; mkdir -p out CLOUDFLARE_API="https://api.cloudflare.com/client/v4" HEADERS=( -H "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}" - -H "Content-Type: application/json" ) curl -s "${CLOUDFLARE_API}/zones" "${HEADERS[@]}" | \ - jq -r '.result[] | .id' | while read zone_id; do - - zone_name=$(curl -s "${CLOUDFLARE_API}/zones/${zone_id}" "${HEADERS[@]}" | \ - jq -r '.result.name') + jq -r '.result[] | "\(.id) \(.name)"' | while read zone_id zone_name; do echo "Fetching DNS records for: ${zone_name}" curl -s "${CLOUDFLARE_API}/zones/${zone_id}/dns_records/export" "${HEADERS[@]}" \ - > "out/${zone_name}.txt" && sed -i '/^;; Exported:/d' "out/${zone_name}.txt" + > "out/${zone_name}.txt" done