THIS IS HISTORY! Check fabien.benetou.fr for news.

Seedea, scalable creativity

Xye, consultancy for serious creators

Information

RSS

(Updates)

WikiBot

Principle

Collaborative software agent within a wiki environment in order to foster Human-Computer Stigmergy. See Oimp.WikiBot for more details.

Test

  1. test the module (:wikibot instruction pagetokeepupdated:) : "(:wikibot:)"
    1. should be tried with the vocabulary page (ehhh... it's on another wiki though... should then use XML-RPC or other wait to connect but not UpdagePage that is just internal, closure)

Code of the WikiBot module

beginning_of_code

<?php

Markup('wikibot', 'directives',
  '/\\(:wikibot:\\)/e',
  Keep(wikibot()));

function wikibot(){
    // read a marker to see if another bot is running
    // if another instance is running return that you can only run one instance at a time
    // else go on
    // every X amount of time
        // load the wiki page to update
        // query a remote API for that page
        // every Y<<X amount of time
            // if an answer arrived update the page
            // else do nothing

	$pagename = "WikiBotData.Test";

	$pagecontent = RetrieveAuthPage($pagename, $auth='edit', READPAGE_CURRENT); //RP_C==1?
	$content = $pagecontent;
	$content['text'] = $pagecontent['text']." test";
	//UpdatePage($pagename,$pagecontent,$content);
	//	-> Warning: array_keys() [function.array-keys]: The first argument should be an array in pmwiki.php on line 1647
	// $SaveAttrPatterns is empty
	// housekeeping/initializing things to do before updating a page

	//	UpdatePage($pagename,'',$content);
	//	-> Fatal error: Only variables can be passed by reference
	//Redirect($pagename); 

	return "Check if [[$pagename]] has been updated.";
}

?>

end_of_code

Known problems

To do

Page last modified on April 26, 2009, at 07:45 PM