';
$maybenone='none';
$moreemojibuttons='';
if (1 == 1 || isset($_GET['debug'])) {
$maybenone='block';
$moreemojibuttons=" Last Video📹 Last Animated GIF🖼";
}
function server_remote_addr() {
global $stfle;
$rma = $_SERVER['REMOTE_ADDR'];
$ua = strtolower((isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''));
// you can add different browsers with the same way ..
if(preg_match('/(chromium)[ \/]([\w.]+)/', $ua))
$rma = '000000'.$rma;
elseif(preg_match('/(chrome)[ \/]([\w.]+)/', $ua))
$rma = '00000'.$rma;
elseif(preg_match('/(safari)[ \/]([\w.]+)/', $ua))
$rma = '0000'.$rma;
elseif(preg_match('/(opera)[ \/]([\w.]+)/', $ua))
$rma = '000'.$rma;
elseif(preg_match('/(msie)[ \/]([\w.]+)/', $ua))
$rma = '00'.$rma;
elseif(preg_match('/(mozilla)[ \/]([\w.]+)/', $ua))
$rma = '0'.$rma;
return str_replace(":", "_", $rma);
}
if (isset($_GET['getvideo'])) {
$lenv='1';
if (isset($_GET['len'])) {
$lenv=$_GET['len'];
}
if ($_GET['getvideo'] == '1' && $lenv == '0') {
echo "'; } else if (parent.document.getElementById('mysource')) { parent.document.getElementById('mysource').src='data:video/mp4;base64," . base64_encode(file_get_contents('/tmp/video' . server_remote_addr() . '.mp4')) . "'; } else { parent.document.getElementById('divmedia').innerHTML+='
Video version below ... Back to top ...
'; } setTimeout(function(){ parent.document.getElementById('pvd').scrollIntoView(); }, 2000); \">";
} else {
if (file_exists('/tmp/video' . server_remote_addr() . '.mp4')) {
unlink('/tmp/video' . server_remote_addr() . '.mp4');
}
exec('ffmpeg -framerate 2 -i /tmp/slide_' . server_remote_addr() . '-%03d.png -vcodec libx264 -crf 22 /tmp/video' . server_remote_addr() . '.mp4');
echo "'; } else if (parent.document.getElementById('mysource')) { parent.document.getElementById('mysource').src='data:video/mp4;base64," . base64_encode(file_get_contents('/tmp/video' . server_remote_addr() . '.mp4')) . "'; } else { parent.document.getElementById('divmedia').innerHTML+='
Video version below ... Back to top ...
'; } setTimeout(function(){ parent.document.getElementById('pvd').scrollIntoView(); }, 2000); \">";
}
exit;
} else if (isset($_GET['getagif'])) {
$lenv='1';
if (isset($_GET['len'])) {
$lenv=$_GET['len'];
}
if ($_GET['getvideo'] == '1' && $lenv == '0') {
echo "
Animated GIF version below ... Back to top ...
'; } setTimeout(function(){ parent.document.getElementById('pag').scrollIntoView(); }, 2000); \">";
} else {
if (file_exists('/tmp/agif' . server_remote_addr() . '.gif')) {
unlink('/tmp/agif' . server_remote_addr() . '.gif');
}
exec('ffmpeg -framerate 2 -i /tmp/slide_' . server_remote_addr() . '-%03d.png /tmp/agif' . server_remote_addr() . '.gif');
echo "
Animated GIF version below ... Back to top ...
'; } setTimeout(function(){ parent.document.getElementById('pag').scrollIntoView(); }, 2000); \">";
}
exit;
} else if (isset($_GET['inwords'])) {
if (isset($_GET['curc'])) {
if ($_GET['curc'] == '1') {
foreach (glob('/tmp/slide_' . server_remote_addr() . '-*.png') as $ifil) {
unlink($ifil);
}
}
$slidename='/tmp/slide_' . server_remote_addr() . '-' . substr(('000' . $_GET['curc']),-3,3) . '.png';
if ($_GET['curc'] != '1') {
$tabbit=" if (window.parent) { if (parent.document.getElementById('trtdtd" . $_GET['curc'] . "')) { parent.appendthenfill(); } } ";
} else {
$tabbit='';
}
} else {
$tabbit='';
}
if (isset($_GET['chr'])) {
$suff=' -c "' . str_replace('+',' ',urldecode($_GET['chr'])) . '" ';
}
if (!file_exists('/tmp/cowsay.wds')) {
$serious=true;
file_put_contents('/tmp/cowsay.wds', $_GET['inwords']);
} else if (substr(file_get_contents('/tmp/cowsay.wds'),0,strlen($_GET['inwords'])) == $_GET['inwords']) {
$serious=false;
} else {
$serious=true;
file_put_contents('/tmp/cowsay.wds', $_POST['inwords']);
}
if (isset($_GET['and']) && file_exists('/tmp/cowsay.txt')) {
if (isset($_GET['outdrawing'])) {
file_put_contents('/tmp/cowsay.txt', str_replace('+',' ',urldecode($_GET['outdrawing'])));
}
if (file_exists('/tmp/cowsaytwo.txt')) { unlink('/tmp/cowsaytwo.txt'); }
if (file_exists('/tmp/cowsaythree.txt')) { unlink('/tmp/cowsaythree.txt'); }
if (file_exists('/tmp/cowsayzero.txt')) { unlink('/tmp/cowsayzero.txt'); }
exec("awk '{print length}' /tmp/cowsay.txt |sort -nr|head -1 | sed 's/[^0-9]//g' > /tmp/cowsayzn.txt");
if (isset($_GET['maxl'])) {
exec("cat /tmp/cowsay.txt | sed 's/ /:/g' | awk '{printf \"%-" . $_GET['maxl'] . "s\n\", $1}' | sed 's/:/ /g' > /tmp/cowsayzero.txt");
} else {
exec("cat /tmp/cowsay.txt | sed 's/ /:/g' | awk '{printf \"%-`cat /tmp/cowsayzn.txt | sed 's/[^0-9]//g'`s\n\", $1}' | sed 's/:/ /g' > /tmp/cowsayzero.txt");
}
exec("cat /tmp/cowsayzero.txt | head -1 | sed 's/[^\ ]/\ /g' > /tmp/cowsaynone.txt");
for ($i=0; $i<=100; $i++) {
exec("cat /tmp/cowsaynone.txt >> /tmp/cowsayzero.txt");
}
if ($serious) {
$three='three';
exec('cowsay' . $suff . ' -t "' . str_replace('+',' ',urldecode($_GET['inwords'])) . '" > /tmp/cowsaytwo.txt ; pr -m -t -w 500 /tmp/cowsayzero.txt /tmp/cowsaytwo.txt > /tmp/cowsaythree.txt'); // ; cp -f /tmp/cowsaythree.txt /tmp/cowsay.txt');
if ($slidename != '') {
if (strpos(file_get_contents('/tmp/cowsaytwo.txt'), "\\") !== false) {
//exec('convert -background ' . $bcol . ' -fill ' . $fcol . ' -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:"$(cat /tmp/imagerequest_' . server_remote_addr() . '-0.txt | ' . " sed '/ \\\\/s// \\\\\\\\/g')" . '" ' . $slidename);
exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsaytwo.txt | ' . " sed '/\\\\/s//\\\\\\\\/g')" . '" ' . $slidename);
} else {
exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsaytwo.txt | ' . " sed '/\\\\/s//`/g')" . '" ' . $slidename);
}
}
if ($tabbit != '') { $tabbit=str_replace('()', "('" . urlencode(file_get_contents('/tmp/cowsaytwo.txt')) . "')", $tabbit); }
} else {
exec('cowsay' . $suff . ' -t "' . str_replace('+',' ',urldecode($_GET['inwords'])) . '" > /tmp/cowsaytwo.txt ; pr -m -t -w 500 /tmp/cowsayzero.txt /tmp/cowsaytwo.txt > /tmp/cowsaythree.txt');
if ($slidename != '') {
if (strpos(file_get_contents('/tmp/cowsaytwo.txt'), "\\") !== false) {
//exec('convert -background ' . $bcol . ' -fill ' . $fcol . ' -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:"$(cat /tmp/imagerequest_' . server_remote_addr() . '-0.txt | ' . " sed '/ \\\\/s// \\\\\\\\/g')" . '" ' . $slidename);
exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsaytwo.txt | ' . " sed '/\\\\/s//\\\\\\\\/g')" . '" ' . $slidename);
} else {
exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsaytwo.txt | ' . " sed '/\\\\/s//`/g')" . '" ' . $slidename);
}
}
if ($tabbit != '') { $tabbit=str_replace('()', "('" . urlencode(file_get_contents('/tmp/cowsaytwo.txt')) . "')", $tabbit); }
}
//if (file_exists('/tmp/cowsaytwo.txt')) { unlink('/tmp/cowsaytwo.txt'); }
echo "Cow Says ... thanks to https://pypi.org/project/cowsay";
} else {
exec('cowsay' . $suff . ' -t "' . str_replace('+',' ',urldecode($_GET['inwords'])) . '" > /tmp/cowsay.txt');
if ($slidename != '') {
if (strpos(file_get_contents('/tmp/cowsay.txt'), "\\") !== false) {
exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsay.txt | ' . " sed '/\\\\/s//\\\\\\\\/g')" . '" ' . $slidename);
} else {
exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsay.txt | ' . " sed '/\\\\/s//`/g')" . '" ' . $slidename);
}
}
echo "Cow Says ... thanks to https://pypi.org/project/cowsay";
}
exit;
} else if (isset($_POST['inwords'])) {
if (isset($_POST['curc'])) {
if ($_POST['curc'] == '1') {
foreach (glob('/tmp/slide_' . server_remote_addr() . '-*.png') as $ifil) {
unlink($ifil);
}
}
$slidename='/tmp/slide_' . server_remote_addr() . '-' . substr(('000' . $_POST['curc']),-3,3) . '.png';
if ($_POST['curc'] != '1') {
$tabbit=" if (window.parent) { if (parent.document.getElementById('trtdtd" . $_POST['curc'] . "')) { parent.appendthenfill(); } } ";
} else {
$tabbit='';
}
} else {
$tabbit='';
}
if (isset($_POST['chr'])) {
$suff=' -c "' . str_replace('+',' ',urldecode($_POST['chr'])) . '" ';
}
if (!file_exists('/tmp/cowsay.wds')) {
$serious=true;
file_put_contents('/tmp/cowsay.wds', $_POST['inwords']);
} else if (substr(file_get_contents('/tmp/cowsay.wds'),0,strlen($_POST['inwords'])) == $_POST['inwords']) {
$serious=false;
} else {
$serious=true;
file_put_contents('/tmp/cowsay.wds', $_POST['inwords']);
}
if (isset($_POST['and']) && file_exists('/tmp/cowsay.txt')) {
if (isset($_POST['outdrawing'])) {
file_put_contents('/tmp/cowsay.txt', str_replace('+',' ',urldecode($_POST['outdrawing'])));
}
if (file_exists('/tmp/cowsaytwo.txt')) { unlink('/tmp/cowsaytwo.txt'); }
if (file_exists('/tmp/cowsaythree.txt')) { unlink('/tmp/cowsaythree.txt'); }
if (file_exists('/tmp/cowsayzero.txt')) { unlink('/tmp/cowsayzero.txt'); }
exec("awk '{print length}' /tmp/cowsay.txt |sort -nr|head -1 | sed 's/[^0-9]//g' > /tmp/cowsayzn.txt");
if (isset($_POST['maxl'])) {
exec("cat /tmp/cowsay.txt | sed 's/ /:/g' | awk '{printf \"%-" . $_POST['maxl'] . "s\n\", $1}' | sed 's/:/ /g' > /tmp/cowsayzero.txt");
} else {
exec("cat /tmp/cowsay.txt | sed 's/ /:/g' | awk '{printf \"%-`cat /tmp/cowsayzn.txt | sed 's/[^0-9]//g'`s\n\", $1}' | sed 's/:/ /g' > /tmp/cowsayzero.txt");
}
exec("cat /tmp/cowsayzero.txt | head -1 | sed 's/[^\ ]/\ /g' > /tmp/cowsaynone.txt");
for ($i=0; $i<=100; $i++) {
exec("cat /tmp/cowsaynone.txt >> /tmp/cowsayzero.txt");
}
if ($serious) {
$three='three';
exec('cowsay' . $suff . ' -t "' . str_replace('+',' ',urldecode($_POST['inwords'])) . '" > /tmp/cowsaytwo.txt ; pr -m -t -w 500 /tmp/cowsayzero.txt /tmp/cowsaytwo.txt > /tmp/cowsaythree.txt'); // ; cp -f /tmp/cowsaythree.txt /tmp/cowsay.txt');
if ($slidename != '') {
if (strpos(file_get_contents('/tmp/cowsaytwo.txt'), "\\") !== false) {
//exec('convert -background ' . $bcol . ' -fill ' . $fcol . ' -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:"$(cat /tmp/imagerequest_' . server_remote_addr() . '-0.txt | ' . " sed '/ \\\\/s// \\\\\\\\/g')" . '" ' . $slidename);
exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsaytwo.txt | ' . " sed '/\\\\/s//\\\\\\\\/g')" . '" ' . $slidename);
} else {
exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsaytwo.txt | ' . " sed '/\\\\/s//`/g')" . '" ' . $slidename);
}
}
if ($tabbit != '') { $tabbit=str_replace('()', "('" . urlencode(file_get_contents('/tmp/cowsaytwo.txt')) . "')", $tabbit); }
} else {
exec('cowsay' . $suff . ' -t "' . str_replace('+',' ',urldecode($_POST['inwords'])) . '" > /tmp/cowsaytwo.txt ; pr -m -t -w 500 /tmp/cowsayzero.txt /tmp/cowsaytwo.txt > /tmp/cowsaythree.txt');
if ($slidename != '') {
if (strpos(file_get_contents('/tmp/cowsaytwo.txt'), "\\") !== false) {
//exec('convert -background ' . $bcol . ' -fill ' . $fcol . ' -size ' . $wdt . 'x' . $hgt . ' -font ' . $fnt . ' -pointsize ' . $psiz . ' label:"$(cat /tmp/imagerequest_' . server_remote_addr() . '-0.txt | ' . " sed '/ \\\\/s// \\\\\\\\/g')" . '" ' . $slidename);
exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsaytwo.txt | ' . " sed '/\\\\/s//\\\\\\\\/g')" . '" ' . $slidename);
} else {
exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsaytwo.txt | ' . " sed '/\\\\/s//`/g')" . '" ' . $slidename);
}
}
if ($tabbit != '') { $tabbit=str_replace('()', "('" . urlencode(file_get_contents('/tmp/cowsaytwo.txt')) . "')", $tabbit); }
}
//if (file_exists('/tmp/cowsaytwo.txt')) { unlink('/tmp/cowsaytwo.txt'); }
echo "Cow Says ... thanks to https://pypi.org/project/cowsay";
} else {
exec('cowsay' . $suff . ' -t "' . str_replace('+',' ',urldecode($_POST['inwords'])) . '" > /tmp/cowsay.txt');
if ($slidename != '') {
if (strpos(file_get_contents('/tmp/cowsay.txt'), "\\") !== false) {
exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsay.txt | ' . " sed '/\\\\/s//\\\\\\\\/g')" . '" ' . $slidename);
} else {
exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsay.txt | ' . " sed '/\\\\/s//`/g')" . '" ' . $slidename);
}
}
echo "Cow Says ... thanks to https://pypi.org/project/cowsay";
} else {
exec('cowsay' . $suff . ' -t "' . str_replace('+',' ',urldecode($_POST['inwords'])) . '" > /tmp/cowsay.txt');
if ($slidename != '') {
if (strpos(file_get_contents('/tmp/cowsay.txt'), "\\") !== false) {
exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsay.txt | ' . " sed '/\\\\/s//\\\\\\\\/g')" . '" ' . $slidename);
} else {
exec('convert -background white -fill black -size 800x800 -font Courier -pointsize 36 label:"$(cat /tmp/cowsay.txt | ' . " sed '/\\\\/s//`/g')" . '" ' . $slidename);
}
}
echo "Cow Says ... thanks to https://pypi.org/project/cowsay";
}
exit;
}
echo "Cow Says ... thanks to https://pypi.org/project/cowsay
Cow Says ...
RJM Programming - February, 2025 - Cartoon💬 Speak🗣 Email📧 SMS📟" . $moreemojibuttons . "
";
?>