d3sd1 / OnLoL-Riot-API

Riot api base for PHP. Updated constantly and almost without bugs!
2 stars 2 forks source link

Fetching multiple matches #5

Closed SeaRoth closed 7 years ago

SeaRoth commented 7 years ago

Hey Andi2Garcia,

How do you think I could implement a method to fetch a group of matches like your method $api->getSummonerbyName does with summoner names? (10 in this case).

$api-> match(matchId,region,timeline=false) with timeline == TRUE

I was thinking of doing it two ways:

  1. Javascript loop with AJAX requests to $api->match every .5 to 1 second, every time the user searches a new summoner (10 matches total)
  2. Creating a new method inside your PHP code to do the same thing (approximately)

What do you think I should do? My goal is to utilize the convenient data located inside the match data with TIMELINE == TRUE to expand these graphs and equations to give more pertinent information to the user.

d3sd1 commented 7 years ago

You should not do it on that way. It would be massive requests, so you can cache with another key with a cron, or fetch match when an user wants to know it's data, but not all at a time, because it will take so long for user experience (you can also do it on background).