[Piwik-svn] r155 - trunk/misc

svnmaster at piwik.org svnmaster at piwik.org
Mon Jan 14 01:55:04 CET 2008


Author: matt
Date: 2008-01-14 01:55:04 +0100 (Mon, 14 Jan 2008)
New Revision: 155

Added:
   trunk/misc/api_rest_call.php
Removed:
   trunk/misc/api_php_call.php
Modified:
   trunk/misc/api_internal_call.php
Log:


Modified: trunk/misc/api_internal_call.php
===================================================================
--- trunk/misc/api_internal_call.php	2008-01-14 00:29:02 UTC (rev 154)
+++ trunk/misc/api_internal_call.php	2008-01-14 00:55:04 UTC (rev 155)
@@ -1,5 +1,3 @@
-{{{
-#!php
 <?php
 define('PIWIK_INCLUDE_PATH', '..');
 define('ENABLE_DISPATCH', false);	
@@ -22,5 +20,4 @@
 $result = $request->process();
 echo $result;
 
-?>
-}}}
\ No newline at end of file
+?>
\ No newline at end of file

Deleted: trunk/misc/api_php_call.php
===================================================================
--- trunk/misc/api_php_call.php	2008-01-14 00:29:02 UTC (rev 154)
+++ trunk/misc/api_php_call.php	2008-01-14 00:55:04 UTC (rev 155)
@@ -1,33 +0,0 @@
-{{{
-#!php
-<?php
-// this token is used to authenticate your API request. 
-// You can get the token on the API page inside your Piwik interface
-$token_auth = '0b809661490d605bfd77f57ed11f0b14';
-
-// we call the REST API and request the 100 first keywords for the last month for the idsite=1
-$url = "http://127.0.0.1/svn-dev/trunk/";
-$url .= "?module=API&method=Referers.getKeywords";
-$url .= "&idSite=1&period=month&date=yesterday";
-$url .= "&format=PHP&filter_limit=100";
-$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>");
-foreach($content as $row)
-{
-	$keyword = urldecode($row['label']);
-	$hits = $row['nb_visits'];
-	
-	print("<b>$keyword</b> ($hits hits)<br>");
-}
-?>
-}}}
\ No newline at end of file

Copied: trunk/misc/api_rest_call.php (from rev 154, trunk/misc/api_php_call.php)
===================================================================
--- trunk/misc/api_rest_call.php	                        (rev 0)
+++ trunk/misc/api_rest_call.php	2008-01-14 00:55:04 UTC (rev 155)
@@ -0,0 +1,30 @@
+<?php
+// this token is used to authenticate your API request. 
+// You can get the token on the API page inside your Piwik interface
+$token_auth = '0b809661490d605bfd77f57ed11f0b14';
+
+// we call the REST API and request the 100 first keywords for the last month for the idsite=1
+$url = "http://127.0.0.1/svn-dev/trunk/";
+$url .= "?module=API&method=Referers.getKeywords";
+$url .= "&idSite=1&period=month&date=yesterday";
+$url .= "&format=PHP&filter_limit=100";
+$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>");
+foreach($content as $row)
+{
+	$keyword = urldecode($row['label']);
+	$hits = $row['nb_visits'];
+	
+	print("<b>$keyword</b> ($hits hits)<br>");
+}
+?>
\ No newline at end of file



More information about the Piwik-svn mailing list