[Piwik-svn] r153 - trunk/misc

svnmaster at piwik.org svnmaster at piwik.org
Mon Jan 14 01:07:33 CET 2008


Author: matt
Date: 2008-01-14 01:07:33 +0100 (Mon, 14 Jan 2008)
New Revision: 153

Added:
   trunk/misc/api_internal_call.php
Log:


Added: trunk/misc/api_internal_call.php
===================================================================
--- trunk/misc/api_internal_call.php	                        (rev 0)
+++ trunk/misc/api_internal_call.php	2008-01-14 00:07:33 UTC (rev 153)
@@ -0,0 +1,26 @@
+{{{
+#!php
+<?php
+
+define('PIWIK_INCLUDE_PATH', '..');
+define('ENABLE_DISPATCH', false);	
+require_once PIWIK_INCLUDE_PATH . "/index.php";
+require_once PIWIK_INCLUDE_PATH . "/modules/API/Request.php";
+
+// we call the API from a php code
+// it will check that you have the necessary rights
+// - either you are loggued in piwik and have a cookie in your browser
+// - or you will have to add the token_auth=XXX to the request string to authenticate
+//   beware that the token_auth changes every time you change your password
+$request = new Piwik_API_Request('
+			method=UserSettings.getResolution
+			&idSite=1
+ 			&date=yesterday
+			&period=week
+			&format=xml
+			&filter_limit=5
+			&filter_offset=0
+');
+$result = $request->process();
+echo $result;
+}}}
\ No newline at end of file



More information about the Piwik-svn mailing list