Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Lake
  5. * Date: 13/02/2016
  6. * Time: 18:15
  7. */
  8.  
  9.  
  10. ini_set('max_execution_time', 3600);
  11.  
  12. $url = "http://logs.tf/json_search?player=76561198043755694";
  13. $url2 = "http://logs.tf/json/";
  14.  
  15. $liste = json_decode(file_get_contents($url));
  16. $res = array();
  17.  
  18.  
  19.  
  20. foreach($liste->logs as $el)
  21. {
  22. $i++;
  23.  
  24. $log = json_decode(file_get_contents($url2.$el->id));
  25.  
  26. $soldier = false;
  27. foreach($log->players as $k=>$player)
  28. {
  29. if($k == "[U:1:83489966]")
  30. {
  31. foreach($player->class_stats as $class)
  32. {
  33. if($class->type == "soldier")
  34. {
  35. $soldier = true;
  36. }
  37. }
  38. }
  39. }
  40.  
  41. if($soldier)
  42. {
  43. foreach($log->healspread as $heal)
  44. {
  45.  
  46. $blitzo = false;
  47. $total = 0;
  48.  
  49. foreach($heal as $k =>$pheal)
  50. {
  51. $total = $total + $pheal;
  52.  
  53. if($k =="[U:1:83489966]")
  54. {
  55. $blitzo = $pheal;
  56. }
  57. }
  58.  
  59. if($blitzo)
  60. {
  61. $pourcent = round($blitzo/$total * 100,2);
  62.  
  63. if($pourcent>23)
  64. {
  65. $res[$el->id] = $pourcent;
  66. }
  67.  
  68.  
  69. }
  70.  
  71. }
  72. }
  73.  
  74. }
  75.  
  76.  
  77. echo '<table border="1">';
  78.  
  79. foreach($res as $k=>$ares)
  80. {
  81. echo "<tr><td>$k</td><td>$ares</td></tr>";
  82. }
  83.  
  84. echo "</table>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement