limbusart/utils/filter-dead-twitter-links.sh

11 lines
276 B
Bash
Raw Normal View History

2024-06-11 02:51:07 +03:00
#!/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