analytics.php 879 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. function dw_wik_places() {
  3. $url = "https://davidawindham.com/wik/";
  4. $url .= "?module=API&method=UserCountry.getCity";
  5. $url .= "&idSite=1&period=month&date=yesterday";
  6. $url .= "&format=PHP&filter_limit=20";
  7. $url .= "&token_auth=d97e3e8f34071515ad1f6e345f6035af";
  8. $fetched = file_get_contents($url);
  9. $content = unserialize($fetched);
  10. if (!$content) {
  11. print("Error, content fetched = " . $fetched);
  12. }
  13. foreach ($content as $row) {
  14. $location = htmlspecialchars(html_entity_decode(urldecode($row['label']), ENT_QUOTES), ENT_QUOTES);
  15. $hits = $row['nb_visits'];
  16. $actions = $row['nb_actions'];
  17. $logo = $row['logo'];
  18. $length = $row['sum_visit_length'];
  19. print("<li class='list-group-item'><img src='https://davidawindham.com/wik/$logo'/> $location ( $hits hits ) <span class='badge'> $actions </span></li>");
  20. }
  21. }
  22. function dw_wik() {
  23. }
  24. ?>