| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <?php
- function dw_wik_places() {
- $url = "https://davidawindham.com/wik/";
- $url .= "?module=API&method=UserCountry.getCity";
- $url .= "&idSite=1&period=month&date=yesterday";
- $url .= "&format=JSON&filter_limit=50";
- $url .= "&token_auth=3910b0da85f448ae35d4b75b4e6912bb";
- $fetched = file_get_contents($url);
- $content = json_decode($fetched,true);
- if (!$content) {
- print("Error, content fetched = " . $fetched);
- }
- foreach ($content as $row) {
- $location = htmlspecialchars(html_entity_decode(urldecode($row['label']), ENT_QUOTES), ENT_QUOTES);
- $hits = $row['nb_visits'];
- $logo = $row['logo'];
- $length = $row['sum_visit_length'];
- print("<li class='list-group-item'><img src='https://davidawindham.com/wik/$logo' style='width:20px;'/> $location <span class='badge'> $hits </span></li>");
- }
- }
- function dw_wik_url() {
- $url = "https://davidawindham.com/wik/";
- $url .= "?module=API&method=Actions.getPageUrls";
- $url .= "&idSite=1&period=month&date=yesterday";
- // flat=1 expands the hierarchical folder report into individual page URLs, so the
- // /til subpages (tracked via docusaurus-plugin-matomo) show instead of one "til" folder.
- $url .= "&format=JSON&filter_limit=50&flat=1";
- $url .= "&token_auth=3910b0da85f448ae35d4b75b4e6912bb";
- $fetched = file_get_contents($url);
- $content = json_decode($fetched,true);
- if (!$content) {
- print("Error, content fetched = " . $fetched);
- }
- foreach ($content as $row) {
- $label = $row['label'];
- $hits = $row['nb_hits'];
- $path = '/' . ltrim( html_entity_decode( urldecode( $label ), ENT_QUOTES ), '/' ); // flat labels start with "/"
- $disp = htmlspecialchars( $path, ENT_QUOTES );
- $text = ( '/' === $path ) ? '/index' : $disp; // bare "/" is too small to click
- print("<li class='list-group-item'> <a href='https://davidwindham.com$disp'>$text</a> <span class='badge'> $hits </span></li>");
- }
- }
- function dw_wik_users() {
- $url = "https://davidawindham.com/wik/";
- $url .= "?module=API&method=DevicesDetection.getOsFamilies";
- $url .= "&idSite=1&period=month&date=yesterday";
- $url .= "&format=JSON&filter_limit=10";
- $url .= "&token_auth=3910b0da85f448ae35d4b75b4e6912bb";
- $fetched = file_get_contents($url);
- $content = json_decode($fetched,true);
- if (!$content) {
- print("Error, content fetched = " . $fetched);
- }
- foreach ($content as $row) {
- $urls = htmlspecialchars(html_entity_decode(urldecode($row['label']), ENT_QUOTES), ENT_QUOTES);
- $label = $row['label'];
- $hits = $row['nb_visits'];
- print("<li class='list-group-item'> $label <span class='badge'> $hits </span></li>");
- }
- }
- function dw_wik_keys() {
- $url = "https://davidawindham.com/wik/";
- $url .= "?module=API&method=Referrers.getReferrerType";
- $url .= "&idSite=1&period=month&date=yesterday";
- $url .= "&format=JSON&filter_limit=20";
- $url .= "&token_auth=3910b0da85f448ae35d4b75b4e6912bb";
- $fetched = file_get_contents($url);
- $content = json_decode($fetched,true);
- if (!$content) {
- print("Error, content fetched = " . $fetched);
- }
- foreach ($content as $row) {
- $urls = htmlspecialchars(html_entity_decode(urldecode($row['label']), ENT_QUOTES), ENT_QUOTES);
- $label = $row['label'];
- $hits = $row['nb_visits'];
- print("<li class='list-group-item'> $label <span class='badge'> $hits </span></li>");
- }
- }
- function dw_wik_refs() {
- $url = "https://davidawindham.com/wik/";
- $url .= "?module=API&method=Referrers.getAll";
- $url .= "&idSite=1&period=month&date=yesterday";
- $url .= "&format=JSON&filter_limit=20";
- $url .= "&token_auth=3910b0da85f448ae35d4b75b4e6912bb";
- $fetched = file_get_contents($url);
- $content = json_decode($fetched,true);
- if (!$content) {
- print("Error, content fetched = " . $fetched);
- }
- foreach ($content as $row) {
- $urls = htmlspecialchars(html_entity_decode(urldecode($row['label']), ENT_QUOTES), ENT_QUOTES);
- $label = $row['label'];
- $hits = $row['nb_visits'];
- print("<li class='list-group-item'> $label <span class='badge'> $hits </span></li>");
- }
- }
- ?>
|