#!/bin/sh
# ghost-links.sh
#
# Asks five platforms about a post that does not exist, and prints what they say.
#
# Every URL below is fabricated. The user does not exist, the video id is not a
# real id. A platform that answers 200 is telling you a page is there.
#
# Read it before you run it. It does five GET requests and nothing else: no
# arguments, no writes, no auth, no data leaving except the requests themselves.
#
#   sh ghost-links.sh
#
# Published by Vouched. https://vouched.ph/unverified/ghost-links

UA='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0 Safari/537.36'

ask() {
  # $1 platform, $2 url
  code=$(curl -sL -o /dev/null -w '%{http_code}' -m 20 -A "$UA" "$2" 2>/dev/null)
  case "$code" in
    200) verdict='says the post is there' ;;
    000) verdict='no answer, check your connection' ;;
    *)   verdict='admits it is gone' ;;
  esac
  printf '  %-10s  %s  %s\n' "$1" "$code" "$verdict"
}

echo
echo '  Asking five platforms about posts that were never made.'
echo

ask tiktok    'https://www.tiktok.com/@nonexistentuser99/video/7000000000000000001'
ask instagram 'https://www.instagram.com/p/ZZZZfakeid99/'
ask youtube   'https://www.youtube.com/watch?v=zzzzFAKEid1'
ask facebook  'https://www.facebook.com/reel/999999999999999'
ask x         'https://x.com/nobody/status/1000000000000000001'

echo
echo '  A 200 means the platform served a page for a post that does not exist.'
echo '  Anything built on "the link works, so the post is up" is guessing.'
echo
