Skip to content

Instantly share code, notes, and snippets.

@psd
Last active July 5, 2025 17:03
Show Gist options
  • Select an option

  • Save psd/0a34d9952f97085f25fec40d3a288611 to your computer and use it in GitHub Desktop.

Select an option

Save psd/0a34d9952f97085f25fec40d3a288611 to your computer and use it in GitHub Desktop.
Digital Land collected data
endpoint.csv
#!/bin/bash
let page=0
organisation=digital-land
while :
do
let page=page+1
sleep 0.5
chunk=$(
curl -qs "https://api.github.com/users/$organisation/repos?per_page=100&page=$page" |
jq '.[] | .name'
)
if [ -z "$chunk" ]
then
break
fi
echo "$chunk"
done |
grep -- '-collection' |
sed -e 's/"//g' |
while read repo
do
if grep -Fq "[$repo]" endpoint.md
then
e="**"
else
e=""
fi
echo "* $e[$repo](https://github.com/digital-land/$repo)$e"
done
#!/bin/bash
set -e
csvcut -c "endpoint_url,end_date" |
grep -v ',$' |
grep 'https://raw.githubusercontent.com/digital-land/' |
grep -v 'https://raw.githubusercontent.com/digital-land/conservation-area-data/' |
sed -e 's/^.*raw.githubusercontent.com\/digital-land\/\([^\/]*\).*$/\1/' |
sort -u |
while read repo
do
echo "* [$repo](https://github.com/digital-land/$repo)"
done
all: endpoint.md collection.md
collection.md: collection.sh endpoint.md
bash collection.sh > $@
endpoint.md: endpoint.csv endpoint.sh
bash endpoint.sh < $< > $@
endpoint.csv:
curl -Lqs 'https://datasette.planning.data.gov.uk/digital-land/endpoint.csv?_stream=on&_size=max' > $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment