There be a website

This commit is contained in:
Roscoe 2025-09-21 03:09:52 +01:00
commit af0907c7c3
Signed by: RoscoeDaWah
SSH key fingerprint: SHA256:Hqn452XQ1ETzUt/FthJu6+OFkS4NBxCv5VQSEvuk7CE
65 changed files with 708 additions and 14 deletions

View file

@ -0,0 +1,21 @@
# frozen_string_literal: true
require "net/http"
require "json"
class WahComponent < ViewComponent::Base
def initialize(legacy:)
if legacy then
else
uri = URI.parse('https://api.tinyfox.dev/img.json?animal=wah')
req = Net::HTTP::Get.new(uri.to_s)
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) {|http|
http.request(req)
}
data = JSON.parse(res.body)
url = "https://tinyfox.dev" + data["loc"]
@wah_url = url
end
end
end