Last active
November 16, 2022 03:23
-
-
Save timmc/1524e73039238ea4a94c106f8f71f90f to your computer and use it in GitHub Desktop.
Revisions
-
timmc revised this gist
Nov 16, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ all_output="$(curl -isS https://www.spidersge.org/)" status=$(echo "$all_output" | grep -Po '\s[0-9]{3}\s' | head -n1 | tr -dc 0-9) echo "Status is [$status]" body="$(echo "$all_output" | sed -ne $'/^\r$/,$p' | tail -n+2)" -
timmc revised this gist
Nov 16, 2022 . 1 changed file with 9 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ #!/bin/bash all_output="$(curl -isS https://www.spidersge.org/)" status=$(echo "$all_output" | head -n1 | grep -o -P '\s+[0-9]+\s*' | tr -dc 0-9) echo "Status is [$status]" body="$(echo "$all_output" | sed -ne $'/^\r$/,$p' | tail -n+2)" echo "Body is [$body]" -
timmc created this gist
Nov 16, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ #!/bin/bash all_out="$(curl -sS https://www.spidersge.org/ -w '%{http_code}')" status="$(echo "$all_out" | tail -c4)" echo "Status is [$status]" body="$(echo "$all_out" | head -c-4)" echo "Body is [$body]"