diff options
author | Lukas Winkler <github@lw1.at> | 2019-03-28 10:43:17 +0300 |
---|---|---|
committer | Stefan Giehl <stefan@matomo.org> | 2019-03-28 10:43:17 +0300 |
commit | 93df2e7c61b800ba0627c4d02825d3697a836833 (patch) | |
tree | 47fb4c03e00b0915a7b6451e7696688b8b610a1e /misc | |
parent | 6963109658b5b411f8adf1a5ccb3ed5eb50fa4dc (diff) |
remove example API file (#14263)
Diffstat (limited to 'misc')
-rw-r--r-- | misc/others/api_rest_call.php | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/misc/others/api_rest_call.php b/misc/others/api_rest_call.php deleted file mode 100644 index 0c7e143626..0000000000 --- a/misc/others/api_rest_call.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php -exit; // REMOVE this line to run the script - -// this token is used to authenticate your API request. -// You can get the token on the API page inside your Piwik interface -$token_auth = 'anonymous'; - -// we call the REST API and request the 100 first keywords for the last month for the idsite=7 -$url = "https://demo.matomo.org/"; -$url .= "?module=API&method=Referrers.getKeywords"; -$url .= "&idSite=7&period=month&date=yesterday"; -$url .= "&format=PHP&filter_limit=20"; -$url .= "&token_auth=$token_auth"; - -$fetched = file_get_contents($url); -$content = unserialize($fetched); - -// case error -if (!$content) { - print("Error, content fetched = " . $fetched); -} - -print("<h1>Keywords for the last month</h1>\n"); -foreach ($content as $row) { - $keyword = htmlspecialchars(html_entity_decode(urldecode($row['label']), ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8'); - $hits = $row['nb_visits']; - - print("<b>$keyword</b> ($hits hits)<br>\n"); -} - |