pull.sh 791 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. cd "$(dirname "$0")" || exit 1
  3. while read -r h n pro
  4. do
  5. echo "$h -> $n -> $pro"
  6. lo="$(echo "$h" | cut -d '@' -f2)"
  7. ho="$(echo "$h" | cut -d '@' -f3)"
  8. curl \
  9. --create-dirs \
  10. --dump-header "webfinger/$h.head" \
  11. --header "Accept: application/jrd+json" \
  12. --location \
  13. --max-time 5.0 \
  14. --output "webfinger/$h.json" \
  15. --silent \
  16. "$ho/.well-known/webfinger?resource=acct:$lo@$ho" \
  17. > /dev/null
  18. curl \
  19. --create-dirs \
  20. --dump-header "profile/$h.head" \
  21. --header 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams"' \
  22. --header 'Accept: application/activity+json' \
  23. --location \
  24. --max-time 5.0 \
  25. --output "profile/$h.json" \
  26. --silent \
  27. "$pro" \
  28. > /dev/null
  29. done \
  30. < accounts.txt