Or if you are smart enough you can even use -m on linux to have it send the output to a process
I've written a pair of shell scripts to use -m to log remotely
cgminer -m script.sh
#!/bin/sh
#
cat | nc remoteIP 7777 &
ncpid="$!"
trap "kill $ncpid" SIGINT SIGTERM EXIT
wait
Running on remoteIP:
#!/bin/sh
#
while true ; do
echo "`date`: Opening new reader"
nc -l 7777
echo "`date`: Reader exited"
done
No doubt someone could spend effort to get that to do it
FYI the php to do the calculation on my web site is something like:
... get $btcperblock if required ...
... get $difficulty if required ...
$aval = '0.8';
$feeperc = '2';
$sharecap = '5';
$feepps = '3';
$sharediff = '10';
$workdiff = '1';
... get variables if supplied ...
$cap = $sharecap * $difficulty;
$btcperblockpaid = $btcperblock * (100 - $feeperc) / 100;
$a = $aval
$factor = (1-$a) / (1 - ($a * pow($workdiff, (1-$a)) * pow($cap, ($a-1))));
$shares = $workdiff * $factor * pow(min($sharediff, $cap) / $workdiff, $aval);
$sharevalue = $btcperblockpaid / $difficulty;
$potvalue = $shares * $sharevalue;
$ppsperc = ($shares / $workdiff) * 100 / (1 - $feepps / 100);