From 0956906e98a0f670be946ef49ec17cbbb575f330 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Fri, 5 Apr 2019 13:37:01 -0400 Subject: [PATCH] Request unlimited number of a sites from matomo By default, matomo applies a limit of 100 results to all API endpoints that return an array. By passing filter_limit -1 all results can be fetched in a single call for the site lists. Ref: https://developer.matomo.org/api-reference/reporting-api --- bureau/class/m_piwik.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bureau/class/m_piwik.php b/bureau/class/m_piwik.php index d905699b..6b841884 100644 --- a/bureau/class/m_piwik.php +++ b/bureau/class/m_piwik.php @@ -326,7 +326,8 @@ class m_piwik { $msg->debug("piwik","site_list"); $this->get_alternc_sites(); - $api_data = $this->call_privileged_page('API', 'SitesManager.getAllSites'); + $api_data = $this->call_privileged_page('API', 'SitesManager.getAllSites', + array('filter_limit' => -1)); $data = array(); if($api_data) { @@ -364,7 +365,8 @@ class m_piwik { function get_site_list() { - return $this->call_privileged_page('API', 'SitesManager.getAllSites'); + return $this->call_privileged_page('API', 'SitesManager.getAllSites', + array('filter_limit' => -1)); } // Ajoute un site à Piwik // can't figure out how to pass multiple url through the API