limbusart/utils/filter-dead-twitter-links.sh
2024-06-11 02:51:07 +03:00

11 lines
276 B
Bash
Executable File

#!/usr/bin/env bash
touch filtered_arts.txt
while IFS= read -r line
do
header=$(curl -o save -w "%{header_json}" "$line" 2> /dev/null)
echo $header | jq -e '.location[]' >/dev/null
if [ "$?" = "0" ]; then
echo "$line" >> filtered_arts.txt
fi
done < $1