Links, mainly...
Some checks failed
/ Run system tests (push) Waiting to run
/ Build, push and deploy image (push) Blocked by required conditions
/ Run tests (push) Has been cancelled
/ Checkout (push) Successful in 8m9s

This commit is contained in:
david 2024-07-26 00:59:00 +02:00
parent fd42a3f173
commit 21ab02d647
69 changed files with 2258 additions and 155 deletions

16
app/lib/link_checker.rb Normal file
View file

@ -0,0 +1,16 @@
module LinkChecker
UA = "Mozilla/5.0 (Android 4.4; Mobile; rv:41.0) Gecko/41.0 Firefox/41.0"
module_function def http(input)
response = Net::HTTP.get_response(URI.parse(input), {"User-Agent": UA})
# debugger
case response
when Net::HTTPSuccess
response.uri
when Net::HTTPRedirection
http(response[:location])
else
false
end
end
end