PHP
From iMacros
This PHP examples shows how to start iMacros from a PHP script from Apache or IIS running on a Windows Server.
The script can be started remotely via a URL in the form http://your-address.com/?macro=yourmacro&keyword=yourkeyword It displays the results on the website after the iMacros run (iimPlay) is completed. This method can be used to call iMacros remotely from another machine, for example a monitoring server running on the Linux OS or to collect the data from several monitoring stations to a central unit.
<?php
$fso = new COM('Scripting.FileSystemObject');
$fso = NULL;
$iim1 = new COM("imacros");
$s = $iim1->iimInit("-runner");
$s = $iim1->iimSet("-var_keyword", $_GET["keyword"]);
$s = $iim1->iimPlay($_GET["macro"]);
echo "iimplay=";
echo $s;
echo "extract=";
echo $iim1->iimGetLastExtract;
$s = $iim1->iimExit();
?>
Note: You can use the iimGetLastExtract command to return complete performance monitoring data and display it. Please see this response time measurement VBS macro for details.
