Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions WGAPI.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,6 +19,7 @@ class WGAPI {
private $apikey = NULL;
private $access_token = NULL;

private $api_format_wgn = "api.worldoftanks.%s/wgn/%s/%s/";
private $api_format_wot = "api.worldoftanks.%s/wot/%s/%s/";
private $api_format_wowp = "api.worldofwarplanes.%s/wowp/%s/%s/";

Expand DownExpand Up@@ -191,7 +192,7 @@ function clanList($search, $limit = 100, $order_by = "", $fields = array()) {
if(count($fields) > 0)
$request_data['fields'] = $fields;

return $this->doRequest(sprintf($this->api_format_wot, $this->tld, "clan", "list"), $request_data);
return $this->doRequest(sprintf($this->api_format_wgn, $this->tld, "clans", "list"), $request_data);
}

/*
Expand DownExpand Up@@ -328,7 +329,7 @@ function clanMemberInfo($member_id, $fields = array()) {
if(count($fields) > 0)
$request_data['fields'] = $fields;

return $this->doRequest(sprintf($this->api_format_wot, $this->tld, "clan", "membersinfo"), $request_data);
return $this->doRequest(sprintf($this->api_format_wgn, $this->tld, "clans", "membersinfo"), $request_data);
}

////////////////////////////
Expand DownExpand Up@@ -540,7 +541,11 @@ private function formStandardClanRequest($function, $clan_id, $fields) {
if(count($fields) > 0)
$request_data['fields'] = $fields;

return $this->doRequest(sprintf($this->api_format_wot, $this->tld, "clan", $function), $request_data);
// wot api for clans is partial deprecated...
if( $function === 'info' )
return $this->doRequest(sprintf($this->api_format_wgn, $this->tld, "clans", $function), $request_data);
else
return $this->doRequest(sprintf($this->api_format_wot, $this->tld, "clan", $function), $request_data);
}

///////////////////////////////////
Expand DownExpand Up@@ -586,4 +591,4 @@ private function doRequest($url, $data, $force_https = false) {
return $response;
}
}
?>
?>