From 2e1a851fe5d12a68915636d4063e8e1c0f8fec58 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Wed, 18 Sep 2024 13:46:00 -0300 Subject: [PATCH] asdasdjnklasdjknsadjkndasjkhlashjilasdjhkasd --- src/providers/main.cr | 2 +- src/providers/purpletv.cr | 2 +- src/vanity-tester-backend.cr | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/providers/main.cr b/src/providers/main.cr index 03e8a7d..18e3399 100644 --- a/src/providers/main.cr +++ b/src/providers/main.cr @@ -10,7 +10,7 @@ module Providers # bttv = Channel(JSON::Any).new # dankchat = Channel(JSON::Any).new # ffz = Channel(JSON::Any).new - info = [Channel(JSON::Any).new, Channel(JSON::Any).new, Channel(JSON::Any).new, Channel(JSON::Any).new, Channel(JSON::Any).new, Channel(JSON::Any).new] + info = [Channel(JSON::Any).new, Channel(JSON::Any).new, Channel(JSON::Any).new, Channel(JSON::Any).new, Channel(JSON::Any).new, Channel(JSON::Any).new, Channel(JSON::Any).new] # Compile with -Dpreview_mt for multithreading spawn { info[0].send(Providers::Chatterino.get_badges) } spawn { info[1].send(Providers::BTTV.get_badges) } diff --git a/src/providers/purpletv.cr b/src/providers/purpletv.cr index 5763386..6bd1f28 100644 --- a/src/providers/purpletv.cr +++ b/src/providers/purpletv.cr @@ -2,7 +2,7 @@ module Providers::PurpleTV extend self def get_badges - res = HTTP::Client.get("", headers: HEADERS) + res = HTTP::Client.get("https://api.nopbreak.ru/orange/donations", headers: HEADERS) JSON.parse(res.body) end end diff --git a/src/vanity-tester-backend.cr b/src/vanity-tester-backend.cr index b17d547..e396a64 100644 --- a/src/vanity-tester-backend.cr +++ b/src/vanity-tester-backend.cr @@ -25,6 +25,7 @@ HEADERS = HTTP::Headers{"User-Agent" => "Vanity-Tester-Backend/0.1.0"} before_get do |env| # Every response is a JSON env.response.content_type = "application/json" + env.response.headers["Access-Control-Allow-Origin"] = "*" end get "/badges" do |env|