From 8c443d69c70317d0a47cd980da764dedd3b98380 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 2 May 2019 04:08:45 +0200 Subject: [PATCH] prefer european blizzard api endpoint Didn't work earlier, but seems fine now and much faster. --- getsc2clan | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/getsc2clan b/getsc2clan index f3df754..60cbc1a 100755 --- a/getsc2clan +++ b/getsc2clan @@ -14,14 +14,14 @@ $profileid and $profileid =~ /\A\d+\z/ my %auth = do './.blizzard.passwd.pl' or die "no auth setup: $!\n"; my $bliz = LWP::Authen::OAuth2->new(%auth, - token_endpoint => 'https://us.battle.net/oauth/token', + token_endpoint => 'https://eu.battle.net/oauth/token', request_required_params => [qw( client_id client_secret grant_type )], ); $bliz->request_tokens(grant_type => 'client_credentials'); sub blizget { my $args = join('/', @_); - my $res = $bliz->get("https://us.api.blizzard.com/sc2/$args"); + my $res = $bliz->get("https://eu.api.blizzard.com/sc2/$args"); $res->is_success or die $res->status_line; my $json = $res->decoded_content; return decode_json($json); -- 2.30.0