From f600603dae679440e8b3465e14ebdc30104f7c4f Mon Sep 17 00:00:00 2001 From: gigirassy Date: Mon, 31 Aug 2026 01:15:40 +0200 Subject: [PATCH] Add check/check --- check/check | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 check/check diff --git a/check/check b/check/check new file mode 100644 index 0000000..bc87014 --- /dev/null +++ b/check/check @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +# to check whether a url has been archived by archivebot +import sys +import requests +from urllib.parse import quote + +url_to_query = sys.argv[1] +url = "https://archive.fart.website/archivebot/viewer/?q=" + quote(url_to_query, safe="") + +headers = { + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0" +} + +response = requests.get(url, headers=headers, timeout=15) + +if "No search results" in response.text: + print("No search results") +else: + print("Search results found") \ No newline at end of file