1
0
Fork 0
mirror of https://github.com/imjasonh/urls synced 2026-07-08 15:35:29 +00:00
urls/crawl.sh
2023-02-03 22:32:07 -05:00

22 lines
629 B
Bash
Executable file

#! /usr/bin/env bash
set -euo pipefail
while read l; do
[[ -z $l ]] && continue
[[ $l =~ ^#.* ]] && continue
fn=${l#"https://"}
echo $fn
mkdir -p $(dirname $fn)
curl -s $l | jq > $fn
done < urls.txt
tmp=$(mktemp)
# Sort keys for better diffs.
jq -S '.' www.googleapis.com/oauth2/v1/certs > ${tmp} && mv ${tmp} www.googleapis.com/oauth2/v1/certs
jq -S '.keys = (.keys | sort_by("kid"))' appleid.apple.com/auth/keys > ${tmp} && mv ${tmp} appleid.apple.com/auth/keys
# Ignore changes where rate limit is exceeded.
if grep "API rate limit exceeded" api.github.com/meta; then git checkout -- api.github.com/meta; fi