Jump to content


Get ClanWars battles through the API to website


  • Please log in to reply
3 replies to this topic

Ghostman101278 #1 Posted 12 April 2019 - 01:29 AM

    Private

  • Player
  • 4079 battles
  • 15
  • [KINAS] KINAS
  • Member since:
    03-01-2016

Hi, I came across this code and I would like to know if someone can help me change it to show on my website my clan's clan wars battles instead of my clan's members.

 

I would like it to show like this if there are no battles

CLAN'S BATTLES: 0

 

and like this if there are ordered by time of the battle

 

         CLAN'S BATTLES: 2        

 

       Clan           Province     Map    Time 
1     KINAS Ciudad Real Karelia 20:00
KINAS Ciudad Real Karelia

20:00

 

this is the code I have

 

Code

 

I would really apreciate some help

 

can someone help me please :)

 


Edited by Ghostman101278, 12 April 2019 - 01:30 AM.


Ghostman101278 #2 Posted 13 April 2019 - 05:52 PM

    Private

  • Player
  • 4079 battles
  • 15
  • [KINAS] KINAS
  • Member since:
    03-01-2016

Nevermind, I got it :) Too bad It doesn't show in real time, you have to wait for the turn before the battle to end for the API to show that battle.

 

Here's the code if anyone need something like this

 

Code

 



zmeclainan #3 Posted 23 April 2019 - 11:41 AM

    Private

  • Beta Tester
  • 21190 battles
  • 35
  • [TAKE] TAKE
  • Member since:
    10-01-2010

I'm a bit of noob on all these things...i get this error once I run the file:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/www/dynamic/uv.ro/efe-s.uv.ro/public_html/lala.php on line 35



Ghostman101278 #4 Posted 25 April 2019 - 04:59 PM

    Private

  • Player
  • 4079 battles
  • 15
  • [KINAS] KINAS
  • Member since:
    03-01-2016

View Postzmeclainan, on 23 April 2019 - 11:41 AM, said:

I'm a bit of noob on all these things...i get this error once I run the file:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/www/dynamic/uv.ro/efe-s.uv.ro/public_html/lala.php on line 35

 

check that the $jsonurl2 is correct

 

it should be like this

$jsonurl2 = "api.worldoftanks.eu/wot/globalmap/clanbattles/?application_id=$application_id&clan_id=$clan_id&fields=province_name,province_id,type,vehicle_level,time,front_id";

you need to add https:// before the api.worldoftanks.eu

if you copied the code I posted is got converted to a link and it's incomplete

 


Edited by Ghostman101278, 25 April 2019 - 05:04 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users