[Piwik-svn] r154 - trunk/misc

svnmaster at piwik.org svnmaster at piwik.org
Mon Jan 14 01:29:03 CET 2008


Author: matt
Date: 2008-01-14 01:29:02 +0100 (Mon, 14 Jan 2008)
New Revision: 154

Added:
   trunk/misc/generateDoc.bat
Modified:
   trunk/misc/api_internal_call.php
   trunk/misc/api_php_call.php
   trunk/misc/phpdoc-config.ini
Log:
- adding doc

Modified: trunk/misc/api_internal_call.php
===================================================================
--- trunk/misc/api_internal_call.php	2008-01-14 00:07:33 UTC (rev 153)
+++ trunk/misc/api_internal_call.php	2008-01-14 00:29:02 UTC (rev 154)
@@ -1,13 +1,12 @@
 {{{
 #!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
+// 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
@@ -15,12 +14,13 @@
 $request = new Piwik_API_Request('
 			method=UserSettings.getResolution
 			&idSite=1
- 			&date=yesterday
+			&date=yesterday
 			&period=week
-			&format=xml
+			&format=JSON
 			&filter_limit=5
-			&filter_offset=0
 ');
 $result = $request->process();
 echo $result;
+
+?>
 }}}
\ No newline at end of file

Modified: trunk/misc/api_php_call.php
===================================================================
--- trunk/misc/api_php_call.php	2008-01-14 00:07:33 UTC (rev 153)
+++ trunk/misc/api_php_call.php	2008-01-14 00:29:02 UTC (rev 154)
@@ -1,16 +1,19 @@
-<?php
-// the token will be given in the User page in piwik
-// but we can build it because we know the piwik internals
-$token = md5('root'.'nintendo');
+{{{
+#!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://localhost/dev/piwiktrunk/";
-$url .= "?module=API&method=Referers.getKeywords&idSite=1&period=month&date=yesterday";
-$url .= "&format=PHP&filter_limit=100";
-$url .= "&token=$token";
+$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);
+$content = unserialize($fetched);
 
 // case error
 if(!$content)
@@ -18,12 +21,13 @@
 	print("Error, content fetched = ".$fetched);
 }
 
-print("<h2>Keywords for the last month</h2>");
+print("<h1>Keywords for the last month</h1>");
 foreach($content as $row)
 {
-	$keyword = urldecode($row['columns']['label']);
-	$hits = $row['columns']['nb_visits'];
+	$keyword = urldecode($row['label']);
+	$hits = $row['nb_visits'];
 	
 	print("<b>$keyword</b> ($hits hits)<br>");
 }
-
+?>
+}}}
\ No newline at end of file

Added: trunk/misc/generateDoc.bat
===================================================================
--- trunk/misc/generateDoc.bat	                        (rev 0)
+++ trunk/misc/generateDoc.bat	2008-01-14 00:29:02 UTC (rev 154)
@@ -0,0 +1,3 @@
+cd ..
+"C:\Program Files\EasyPHP 2.0b1\php5\php.exe" libs\PhpDocumentor-1.3.2\phpdoc -c misc\phpdoc-config.ini
+pause
\ No newline at end of file

Modified: trunk/misc/phpdoc-config.ini
===================================================================
--- trunk/misc/phpdoc-config.ini	2008-01-14 00:07:33 UTC (rev 153)
+++ trunk/misc/phpdoc-config.ini	2008-01-14 00:29:02 UTC (rev 154)
@@ -1,18 +1,3 @@
-;; phpDocumentor parse configuration file
-;;
-;; This file is designed to cut down on repetitive typing on the command-line or web interface
-;; You can copy this file to create a number of configuration files that can be used with the
-;; command-line switch -c, as in phpdoc -c default.ini or phpdoc -c myini.ini.  The web
-;; interface will automatically generate a list of .ini files that can be used.
-;;
-;; default.ini is used to generate the online manual at http://www.phpdoc.org/docs
-;;
-;; ALL .ini files must be in the user subdirectory of phpDocumentor with an extension of .ini
-;;
-;; Copyright 2002, Greg Beaver <cellog at users.sourceforge.net>
-;;
-;; WARNING: do not change the name of any command-line parameters, phpDocumentor will ignore them
-
 [Parse Data]
 ;; title of all the documentation
 ;; legal values: any string
@@ -30,10 +15,6 @@
 ;; legal values: on, off
 javadocdesc = off
 
-;; add any custom @tags separated by commas here
-;; legal values: any legal tagname separated by commas.
-;customtags = mytag1,mytag2
-
 ;; This is only used by the XML:DocBook/peardoc2 converter
 defaultcategoryname = Documentation
 
@@ -41,15 +22,6 @@
 ;; legal values: alphanumeric string plus - and _
 defaultpackagename = Piwik
 
-;; output any parsing information?  set to on for cron jobs
-;; legal values: on
-;quiet = on
-
-;; parse a PEAR-style repository.  Do not turn this on if your project does
-;; not have a parent directory named "pear"
-;; legal values: on/off
-;pear = on
-
 ;; where should the documentation be written?
 ;; legal values: a legal path
 ;target = /home/cellog/output
@@ -70,17 +42,8 @@
 
 ;; comma-separated list of directories to parse
 ;; legal values: directory paths separated by commas
-;directory = /path1,/path2,.,..,subdirectory
-;directory = /home/jeichorn/cvs/pear
-directory = modules,core,plugins
-;target = /you-MUST/also-change-me/to-fit/your-environment
+directory = modules,plugins
 
-;; template base directory (the equivalent directory of <installdir>/phpDocumentor)
-;templatebase = /path/to/my/templates
-
-;; directory to find any example files in through @example and {@example} tags
-;examplesdir = /path/to/my/templates
-
 ;; comma-separated list of files, directories or wildcards ? and * (any wildcard) to ignore
 ;; legal values: any wildcard strings separated by commas
 ;ignore = /path/to/ignore*,*list.php,myfile.php,subdirectory/
@@ -94,6 +57,7 @@
 ;;               HTML:Smarty:default,HTML:Smarty:PHP,HTML:Smarty:HandS
 ;;               PDF:default:default,CHM:default:default,XML:DocBook/peardoc2:default
 output=HTML:frames:earthli
+;output=HTML:Smarty:HandS
 
 ;; turn this option on if you want highlighted source code for every file
 ;; legal values: on/off



More information about the Piwik-svn mailing list