logo

utils

~/.local/bin tools and git-hooks
commit: cefaecfb8d425a65c4527f365719e6073f267919
parent: 743b2f83cd2f304dca7df2d4223d8d59312fb584
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue,  5 May 2020 23:37:38 +0200

bin/ap-fetch.sh: Moved to https://hacktivis.me/git/ap-client/

Diffstat:

Dbin/ap-fetch.sh22----------------------
1 file changed, 0 insertions(+), 22 deletions(-)

diff --git a/bin/ap-fetch.sh b/bin/ap-fetch.sh @@ -1,22 +0,0 @@ -#!/bin/sh -url="$1" -accept_header='Accept: application/ld+json,application/activity+json,application/json' - -die() { - echo $@ - exit 1 -} - -if [[ -z "${url}" ]] -then - die "Usage: ${0} [url]" -fi - -curl -sSL -H "${accept_header}" ${url} -I | tee /dev/stderr | grep -q -i -e '^Content-Type: application/.*json' - -if [[ "$?" != 0 ]] -then - die "Doesn’t have “Content-Type: application/.*json” in the headers" -fi - -curl -sSL -H "${accept_header}" ${url} | jq .