{"id":54289,"date":"2021-12-06T03:01:40","date_gmt":"2021-12-05T17:01:40","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=54289"},"modified":"2021-12-16T11:29:42","modified_gmt":"2021-12-16T01:29:42","slug":"mac-os-mamp-timekeeping-web-application-php-calendar-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/mac-os-mamp-timekeeping-web-application-php-calendar-tutorial\/","title":{"rendered":"Mac OS MAMP Timekeeping Web Application PHP Calendar Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Mac OS MAMP Timekeeping Web Application PHP Calendar Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/timekeeper_calendar.gif\" title=\"Mac OS MAMP Timekeeping Web Application PHP Calendar Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Mac OS MAMP Timekeeping Web Application PHP Calendar Tutorial<\/p><\/div>\n<p>Okay then, yesterday&#8217;s <a title='Mac OS MAMP Timekeeping Web Application PHP Image Metadata Tutorial' href='#mosmamptwaphpimt'>Mac OS MAMP Timekeeping Web Application PHP Image Metadata Tutorial<\/a> &#8220;image metadata smarts&#8221; puts us in a position to get onto the &#8220;bells and whistles&#8221; side of our Timekeeping (macOS and Mac OS X only at this stage) web application.  We channel the calendar display talents of <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/monthly-chronicler-localstorage-tutorial\/' title='Monthly Chronicler LocalStorage Tutorial'>Monthly Chronicler LocalStorage Tutorial<\/a> in thought and act (its web application is opened in an iframe &#8230; hence our need to ask you to download <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/monthly_chronicler.html---GETME\">monthly_chronicler.html<\/a> to <a target=_blank title='MAMP for Apache\/PHP\/MySql on Mac OS X local web server' href='http:\/\/www.mamp.info'>MAMP<\/a>&#8216;s $_SERVER[&#8216;DOCUMENT_ROOT&#8217;] &#8220;HTMLCSS&#8221; subfolder) to offer a new (<a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/reveal\" title='WordPress reveal posts'>&#8220;reveal&#8221;<\/a>) piece of <a target=_blank title='HTML details tag information from w3schools' href='https:\/\/www.w3schools.com\/tags\/tag_details.asp'>details<\/a>\/<a target=_blank title='HTML summary tag information from w3schools' href='https:\/\/www.w3schools.com\/tags\/tag_details.asp'>summary<\/a> hosted <font color=blue>&#8220;Yearly Report Calendar&#8221;<\/font> functionality.<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n\/\/ quarter_hour_timer.php<br \/>\n\/\/ RJM Programming<br \/>\n\/\/ December, 2021<br \/>\n<br \/>\n\/\/ iptc_make_tag() function by Thies C. Arntzen<br \/>\nfunction iptc_make_tag($rec, $data, $value) {<br \/>\n    $length = strlen($value);<br \/>\n    $retval = chr(0x1C) . chr($rec) . chr($data);<br \/>\n<br \/>\n    if($length &lt; 0x8000)<br \/>\n    {<br \/>\n        $retval .= chr($length &gt;&gt; 8) .  chr($length & 0xFF);<br \/>\n    }<br \/>\n    else<br \/>\n    {<br \/>\n        $retval .= chr(0x80) .<br \/>\n                   chr(0x04) .<br \/>\n                   chr(($length &gt;&gt; 24) & 0xFF) .<br \/>\n                   chr(($length &gt;&gt; 16) & 0xFF) .<br \/>\n                   chr(($length &gt;&gt; 8) & 0xFF) .<br \/>\n                   chr($length & 0xFF);<br \/>\n    }<br \/>\n<br \/>\n    return $retval . $value;<br \/>\n}<br \/>\n<br \/>\nif (isset($_GET['myta'])) {<br \/>\n <font color=blue>$dru=\"HTTP:\/\/\" . $_SERVER['SERVER_NAME'] . \"\" . str_replace(\"~\",\"\",str_replace(\":443~\",\"\",str_replace(\":80~\",\"\",(\":\" . $_SERVER['SERVER_PORT'] . \"~\")))) . \"\/\";<\/font><br \/>\n $contis=str_replace('+',' ',urldecode($_GET['myta']));<br \/>\n \/\/file_put_contents('xx.xx', $contis);<br \/>\n $myf='';<br \/>\n $backi='';<br \/>\n <font color=blue>$cali='';<\/font><br \/>\n $taback='';<br \/>\n $bcontis=\"'\" . str_replace(chr(34), \"' + String.fromCharCode(34) + '\", str_replace(\"\\n\", \"' + String.fromCharCode(10) + '\", str_replace(\"\\r\\n\", \"' + String.fromCharCode(10) + '\", str_replace(\"'\", \"' + String.fromCharCode(39) + '\", $contis)))) . \"'\";<br \/>\n if (substr(($bcontis . '   '),0,3) == \"' + \") {  $bcontis=$bcontis.substr(3); }<br \/>\n if (substr(('   ' . $bcontis),-3,3) == \" + '\") {  $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); }<br \/>\n foreach ($_GET as $name=&gt;$val) {<br \/>\n   if ($name != 'myta' && $val == '') {<br \/>\n   \/\/echo $name;<br \/>\n     $myf=$name;<br \/>\n     $taback=str_replace('-','_',str_replace('itd','tatd',$myf));<br \/>\n     $backi=str_replace('-','_',str_replace('screen-','itd_',$myf));<br \/>\n     <font color=blue>$cali=str_replace('-','',str_replace('screen-','td',$myf));<br \/>\n     $idcali=explode('-',explode('_',str_replace('screen-','td',str_replace('itd_','td',$myf)))[0])[0];<\/font><br \/>\n<br \/>\n\/\/ Thanks to https:\/\/doc.bccnsoft.com\/docs\/php-docs-7-en\/function.iptcembed.html<br \/>\n<br \/>\n\/\/ Path to jpeg file<br \/>\n$path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg';<br \/>\n\/\/file_put_contents('x.x',$path);<br \/>\n<br \/>\n$capt = \"\";  \/\/ Thanks to https:\/\/www.php.net\/manual\/en\/function.iptcparse.php<br \/>\n$size = getimagesize( $path, $info );<br \/>\nif (isset($info[\"APP13\"])) {<br \/>\n\/\/file_put_contents('xx.xx',$path);<br \/>\n    if ($iptc = iptcparse( $info[\"APP13\"] ) ) {<br \/>\n\/\/file_put_contents('xxx.xxx',$path);<br \/>\n        $capt = str_replace( \"\\000\", \"\", $iptc[\"2#120\"][0] );<br \/>\n\/\/file_put_contents('xxxx.xxxx',$capt);<br \/>\n    }<br \/>\n}<br \/>\n $bcontis=\"\" . str_replace(chr(34), \"' + String.fromCharCode(34) + '\", str_replace(\"\\n\", \"' + String.fromCharCode(10) + '\", str_replace(\"\\r\\n\", \"' + String.fromCharCode(10) + '\", str_replace(\"'\", \"' + String.fromCharCode(39) + '\", $capt)))) . \"\";<br \/>\n <font color=blue>$ccpre=\"&lt;p onclick=this.innerHTML+=String.fromCharCode(60)+String.fromCharCode(98)+String.fromCharCode(114)+String.fromCharCode(62); style=background-color:orange;background-size:contain;background-image:linear-gradient(rgba(255,255,255,0.3),rgba(255,255,255,0.3)),URL(\" . $dru . str_replace('_','-',str_replace('itd_','screen-',$myf)) . \".jpg\" . \"); title=\" . substr(str_replace('td','p',$cali),-4,2) . \":\" . substr(str_replace('td','p',$cali),-2,2) . \"++ id=\" . str_replace('td','p',$cali) . \"&gt;\";<br \/>\n $ccpost=\"&lt;\/p&gt;\";<br \/>\n $ccontis=\"&lt;br&gt;&lt;p style='background-color:orange; title='\" . str_replace('td','p',$cali) . \"' id=\" . str_replace('td','p',$cali) . \"&gt;\" . str_replace(chr(34), \"' + String.fromCharCode(34) + '\", str_replace(\"\\n\", \"&lt;br&gt;\", str_replace(\"\\r\\n\", \"&lt;br&gt;\", str_replace(\"'\", \"' + String.fromCharCode(39) + '\", $capt)))) . \"&lt;\/p&gt;\";<\/font><br \/>\n\/\/file_put_contents('xxxxx.xxxxx',$bcontis);<br \/>\n\/\/file_put_contents('xxxxxx.xxxxxx',$taback . ' ... ' . $backi);<br \/>\n\/\/file_put_contents('xxxxxxx.xxxxxxx',\"parent.document.getElementById('\" . $backi . \"').title='\" . $bcontis . \"';  parent.document.getElementById('\" . $taback . \"').value='\" . $bcontis . \"'; \");<br \/>\n<br \/>\n   }<br \/>\n if ($bcontis != \"''\") { echo \"&lt;html&gt;&lt;body onload=\\\" parent.document.getElementById('\" . $backi . \"').title='\" . $bcontis . \"';  parent.document.getElementById('\" . $taback . \"').value='\" . $bcontis . \"';   <font color=blue>if (parent.document.getElementById('\" . $idcali . \"')) { var huhg='\" . $ccpre . \"' + parent.document.getElementById('\" . $taback . \"').value + '\" . $ccpost . \"';  while (huhg.indexOf(String.fromCharCode(10)) != -1) { huhg=huhg.replace(String.fromCharCode(10),'&lt;br&gt;');  } parent.document.getElementById('\" . $idcali . \"').innerHTML+=huhg; }<\/font>  \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\"; }<br \/>\n }<br \/>\n } else if (isset($_POST['myta'])) {<br \/>\n <font color=blue>$dru=\"HTTP:\/\/\" . $_SERVER['SERVER_NAME'] . \"\" . str_replace(\"~\",\"\",str_replace(\":443~\",\"\",str_replace(\":80~\",\"\",(\":\" . $_SERVER['SERVER_PORT'] . \"~\")))) . \"\/\";<\/font><br \/>\n $contis=str_replace('+',' ',urldecode($_POST['myta']));<br \/>\n \/\/file_put_contents('xx.xx', $contis);<br \/>\n $myf='';<br \/>\n $backi='';<br \/>\n <font color=blue>$cali='';<\/font><br \/>\n $bcontis=\"'\" . str_replace(chr(34), \"' + String.fromCharCode(34) + '\", str_replace(\"\\n\", \"' + String.fromCharCode(10) + '\", str_replace(\"\\r\\n\", \"' + String.fromCharCode(10) + '\", str_replace(\"'\", \"' + String.fromCharCode(39) + '\", $contis)))) . \"'\";<br \/>\n<br \/> <br \/>\n <font color=blue>$ccpre=\"&lt;p onclick=this.innerHTML+=String.fromCharCode(60)+String.fromCharCode(98)+String.fromCharCode(114)+String.fromCharCode(62); style=background-color:orange;background-size:contain;background-image:linear-gradient(rgba(255,255,255,0.3),rgba(255,255,255,0.3)),URL(\" . $dru . str_replace('_','-',str_replace('itd_','screen-',$myf)) . \".jpg\" . \"); title=\" . substr(str_replace('td','p',$cali),-4,2) . \":\" . substr(str_replace('td','p',$cali),-2,2) . \"++ id=\" . str_replace('td','p',$cali) . \"&gt;\";<br \/>\n $ccpost=\"&lt;\/p&gt;\";<br \/>\n $ccontis=\"&lt;br&gt;&lt;p style='background-color:orange; title='\" . str_replace('td','p',$cali) . \"' id=\" . str_replace('td','p',$cali) . \"&gt;\" . str_replace(chr(34), \"' + String.fromCharCode(34) + '\", str_replace(\"\\n\", \"&lt;br&gt;\", str_replace(\"\\r\\n\", \"&lt;br&gt;\", str_replace(\"'\", \"' + String.fromCharCode(39) + '\", $capt)))) . \"&lt;\/p&gt;\";<\/font><br \/>\n<br \/>\n if (substr(($bcontis . '   '),0,3) == \"' + \") {  $bcontis=$bcontis.substr(3); }<br \/>\n if (substr(('   ' . $bcontis),-3,3) == \" + '\") {  $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); }<br \/>\n foreach ($_POST as $name=&gt;$val) {<br \/>\n   if ($name != 'myta') {<br \/>\n     $myf=$name;<br \/>\n     $backi=str_replace('-','_',str_replace('screen-','itd_',$myf));<br \/>\n     <font color=blue>$taback=str_replace('tatd','tatd_',substr(str_replace('-','',str_replace('_','',str_replace('itd','tatd',str_replace('screen','tatd',$myf)))),0,12)) . '_' . substr(str_replace('-','',str_replace('_','',str_replace('itd','tatd',str_replace('screen','tatd',$myf)))),-4,4);<br \/>\n     $pback=str_replace('tatd','ip',$taback);<br \/>\n     $cali=str_replace('-','',str_replace('screen-','td',$myf));<br \/>\n     $idcali=explode('-',explode('_',str_replace('screen-','td',str_replace('itd_','td',$myf)))[0])[0];<\/font><br \/>\n<br \/>\n\/\/ Thanks to https:\/\/doc.bccnsoft.com\/docs\/php-docs-7-en\/function.iptcembed.html<br \/>\n<br \/>\n\/\/ Path to jpeg file<br \/>\n$path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $myf . '.jpg';<br \/>\n<br \/>\n\/\/file_put_contents('x.x', $path);<br \/>\n<br \/>\n\/\/ Set the IPTC tags<br \/>\n$iptc = array(<br \/>\n    '2#120' =&gt; $contis,<br \/>\n    '2#116' =&gt; 'Copyright 2021, RJM Programming'<br \/>\n);<br \/>\n<br \/>\n\/\/ Convert the IPTC tags into binary code<br \/>\n$data = '';<br \/>\n<br \/>\nforeach($iptc as $tag =&gt; $string) {<br \/>\n    $tag = substr($tag, 2);<br \/>\n    $data .= iptc_make_tag(2, $tag, $string);<br \/>\n}<br \/>\n<br \/>\n\/\/ Embed the IPTC data<br \/>\n$content = iptcembed($data, $path);<br \/>\n<br \/>\n\/\/ Write the new image data out to the file.<br \/>\n$fp = fopen($path, \"wb\");<br \/>\nfwrite($fp, $content);<br \/>\nfclose($fp);<br \/>\n<br \/>\n   }<br \/>\n echo \"&lt;html&gt;&lt;body onload=\\\" parent.document.getElementById('\" . $backi . \"').title=\" . $bcontis . \";  <font color=blue> if (parent.document.getElementById('\" . $idcali . \"')) { var huhg='\" . $ccpre . \"' + parent.document.getElementById('\" . $taback . \"').value + '\" . $ccpost . \"';  if (parent.document.getElementById('\" . $pback . \"')) { huhg=parent.document.getElementById('\" . $taback . \"').value; }  while (huhg.indexOf(String.fromCharCode(10)) != -1) { huhg=huhg.replace(String.fromCharCode(10),'&lt;br&gt;');  }    if (parent.document.getElementById('\" . $pback . \"')) {  parent.document.getElementById('\" . $pback . \"').innerHTML=huhg; } else { parent.document.getElementById('\" . $idcali . \"').innerHTML+=huhg; }<\/font> }  \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n }<br \/>\n } else {<br \/>\n exec(\"\/usr\/sbin\/screencapture -Cd -tjpg \/Applications\/MAMP\/htdocs\/screen-`date +\\\"%Y%m%d-%H%M\\\"`.jpg\");<br \/>\n }<br \/>\n exit;<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p>And so, again, <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.html----GETME\">our changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.html----GETME\">quarter_hour_timer.html<\/a> (we ask you to download to <a target=_blank title='MAMP for Apache\/PHP\/MySql on Mac OS X local web server' href='http:\/\/www.mamp.info'>MAMP<\/a>&#8216;s $_SERVER[&#8216;DOCUMENT_ROOT&#8217;] &#8220;HTMLCSS&#8221; subfolder) <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.html\">Timekeeping Web Application<\/a> suited to macOS (or Mac OS X) &#8220;screencapture&#8221; command line usage, is helped out by a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.php--GETME\">calendar integrationally changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.php--GETME\">quarter_hour_timer.php<\/a> PHP (we ask you to download to <a target=_blank title='MAMP for Apache\/PHP\/MySql on Mac OS X local web server' href='http:\/\/www.mamp.info'>MAMP<\/a>&#8216;s $_SERVER[&#8216;DOCUMENT_ROOT&#8217;] &#8220;HTMLCSS&#8221; subfolder) for you to try out on your MAMP macOS environment.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/mac-os-mamp-timekeeping-web-application-php-calendar-tutorial\/'>Mac OS MAMP Timekeeping Web Application PHP Calendar Tutorial<\/a>.<\/p-->\n<hr>\n<p id='mosmamptwaphpimt'>Previous relevant <a target=_blank title='Mac OS MAMP Timekeeping Web Application PHP Image Metadata Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/mac-os-mamp-timekeeping-web-application-php-image-metadata-tutorial\/'>Mac OS MAMP Timekeeping Web Application PHP Image Metadata Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Mac OS MAMP Timekeeping Web Application PHP Image Metadata Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/screencapture_php_iptc.gif\" title=\"Mac OS MAMP Timekeeping Web Application PHP Image Metadata Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Mac OS MAMP Timekeeping Web Application PHP Image Metadata Tutorial<\/p><\/div>\n<p>In our opinion, what would make the day before yesterday&#8217;s <a title='Mac OS MAMP Timekeeping Web Application PHP Intranet Tutorial' href='#mosmamptwaphpit'>Mac OS MAMP Timekeeping Web Application PHP Intranet Tutorial<\/a> &#8220;Timekeeping Web Application&#8221; <i>cooler<\/i> would be to add to the intelligence of the screen capture images, ahead of other data related improvements to come.<\/p>\n<p>We&#8217;ve spoken in the past about <a target=_blank title='Exif information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Exif'>Exif<\/a> in that respect but PHP has Iptc image metadata functions we can call on &#8230;<\/p>\n<ul>\n<li><a target=_blank href='https:\/\/www.php.net\/manual\/en\/function.iptcembed.php'>iptcembed<\/a> to embed new metadata into an existant image from those associated &#8220;caption&#8221; textarea elements we offer<\/li>\n<li><a target=_blank href='https:\/\/www.php.net\/manual\/en\/function.iptcparse.php'>iptcparse<\/a> to extract old metadata from an existant image into those associated &#8220;caption&#8221; textarea elements we offer<\/li>\n<\/ul>\n<p>This metadata can be like a database source we use moving forward on this project, meaning the one image data entity can suffice for both visual and textual usage purposes.<\/p>\n<p>And so <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.html---GETME\">our changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.html---GETME\">quarter_hour_timer.html<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.html\">Timekeeping Web Application<\/a> suited to macOS (or Mac OS X) &#8220;screencapture&#8221; command line usage, is helped out by a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.php-GETME\">much more usefully changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.php-GETME\">quarter_hour_timer.php<\/a> PHP &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n\/\/ quarter_hour_timer.php<br \/>\n\/\/ RJM Programming<br \/>\n\/\/ December, 2021<br \/>\n<br \/>\n\/\/ iptc_make_tag() function by Thies C. Arntzen<br \/>\nfunction iptc_make_tag($rec, $data, $value) {<br \/>\n    $length = strlen($value);<br \/>\n    $retval = chr(0x1C) . chr($rec) . chr($data);<br \/>\n<br \/>\n    if($length &lt; 0x8000)<br \/>\n    {<br \/>\n        $retval .= chr($length &gt;&gt; 8) .  chr($length & 0xFF);<br \/>\n    }<br \/>\n    else<br \/>\n    {<br \/>\n        $retval .= chr(0x80) .<br \/>\n                   chr(0x04) .<br \/>\n                   chr(($length &gt;&gt; 24) & 0xFF) .<br \/>\n                   chr(($length &gt;&gt; 16) & 0xFF) .<br \/>\n                   chr(($length &gt;&gt; 8) & 0xFF) .<br \/>\n                   chr($length & 0xFF);<br \/>\n    }<br \/>\n<br \/>\n    return $retval . $value;<br \/>\n}<br \/>\n<br \/>\nif (isset($_GET['myta'])) {<br \/>\n $contis=str_replace('+',' ',urldecode($_GET['myta']));<br \/>\n \/\/file_put_contents('xx.xx', $contis);<br \/>\n $myf='';<br \/>\n $backi='';<br \/>\n $taback='';<br \/>\n $bcontis=\"'\" . str_replace(chr(34), \"' + String.fromCharCode(34) + '\", str_replace(\"\\n\", \"' + String.fromCharCode(10) + '\", str_replace(\"\\r\\n\", \"' + String.fromCharCode(10) + '\", str_replace(\"'\", \"' + String.fromCharCode(39) + '\", $contis)))) . \"'\";<br \/>\n if (substr(($bcontis . '   '),0,3) == \"' + \") {  $bcontis=$bcontis.substr(3); }<br \/>\n if (substr(('   ' . $bcontis),-3,3) == \" + '\") {  $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); }<br \/>\n foreach ($_GET as $name=&gt;$val) {<br \/>\n   if ($name != 'myta' && $val == '') {<br \/>\n   \/\/echo $name;<br \/>\n     $myf=$name;<br \/>\n     $taback=str_replace('-','_',str_replace('itd','tatd',$myf));<br \/>\n     $backi=str_replace('-','_',str_replace('screen-','itd_',$myf));<br \/>\n<br \/>\n\/\/ Thanks to https:\/\/doc.bccnsoft.com\/docs\/php-docs-7-en\/function.iptcembed.html<br \/>\n<br \/>\n\/\/ Path to jpeg file<br \/>\n$path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . str_replace('_','-',str_replace('itd_','screen-',$myf)) . '.jpg';<br \/>\n\/\/file_put_contents('x.x',$path);<br \/>\n<br \/>\n$capt = \"\";  \/\/ Thanks to https:\/\/www.php.net\/manual\/en\/function.iptcparse.php<br \/>\n$size = getimagesize( $path, $info );<br \/>\nif (isset($info[\"APP13\"])) {<br \/>\n\/\/file_put_contents('xx.xx',$path);<br \/>\n    if ($iptc = iptcparse( $info[\"APP13\"] ) ) {<br \/>\n\/\/file_put_contents('xxx.xxx',$path);<br \/>\n        $capt = str_replace( \"\\000\", \"\", $iptc[\"2#120\"][0] );<br \/>\n\/\/file_put_contents('xxxx.xxxx',$capt);<br \/>\n    }<br \/>\n}<br \/>\n $bcontis=\"\" . str_replace(chr(34), \"' + String.fromCharCode(34) + '\", str_replace(\"\\n\", \"' + String.fromCharCode(10) + '\", str_replace(\"\\r\\n\", \"' + String.fromCharCode(10) + '\", str_replace(\"'\", \"' + String.fromCharCode(39) + '\", $capt)))) . \"\";<br \/>\n\/\/file_put_contents('xxxxx.xxxxx',$bcontis);<br \/>\n\/\/file_put_contents('xxxxxx.xxxxxx',$taback . ' ... ' . $backi);<br \/>\n\/\/file_put_contents('xxxxxxx.xxxxxxx',\"parent.document.getElementById('\" . $backi . \"').title='\" . $bcontis . \"';  parent.document.getElementById('\" . $taback . \"').value='\" . $bcontis . \"'; \");<br \/>\n<br \/>\n   }<br \/>\n if ($bcontis != \"''\") { echo \"&lt;html&gt;&lt;body onload=\\\" parent.document.getElementById('\" . $backi . \"').title='\" . $bcontis . \"';  parent.document.getElementById('\" . $taback . \"').value='\" . $bcontis . \"'; \\\"&gt;&lt;p&gt;parent.document.getElementById('\" . $backi . \"').title='\" . $bcontis . \"';  parent.document.getElementById('\" . $taback . \"').value='\" . $bcontis . \"';&lt;\/p&gt;&lt;\/body&gt;&lt;\/html&gt;\"; }<br \/>\n }<br \/>\n } else if (isset($_POST['myta'])) {<br \/>\n $contis=str_replace('+',' ',urldecode($_POST['myta']));<br \/>\n \/\/file_put_contents('xx.xx', $contis);<br \/>\n $myf='';<br \/>\n $backi='';<br \/>\n $bcontis=\"'\" . str_replace(chr(34), \"' + String.fromCharCode(34) + '\", str_replace(\"\\n\", \"' + String.fromCharCode(10) + '\", str_replace(\"\\r\\n\", \"' + String.fromCharCode(10) + '\", str_replace(\"'\", \"' + String.fromCharCode(39) + '\", $contis)))) . \"'\";<br \/>\n if (substr(($bcontis . '   '),0,3) == \"' + \") {  $bcontis=$bcontis.substr(3); }<br \/>\n if (substr(('   ' . $bcontis),-3,3) == \" + '\") {  $bcontis=$bcontis.substr(0,(-3 + strlen($bcontis))); }<br \/>\n foreach ($_POST as $name=&gt;$val) {<br \/>\n   if ($name != 'myta') {<br \/>\n     $myf=$name;<br \/>\n     $backi=str_replace('-','_',str_replace('screen-','itd_',$myf));<br \/>\n<br \/>\n\/\/ Thanks to https:\/\/doc.bccnsoft.com\/docs\/php-docs-7-en\/function.iptcembed.html<br \/>\n<br \/>\n\/\/ Path to jpeg file<br \/>\n$path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $myf . '.jpg';<br \/>\n<br \/>\n\/\/file_put_contents('x.x', $path);<br \/>\n<br \/>\n\/\/ Set the IPTC tags<br \/>\n$iptc = array(<br \/>\n    '2#120' =&gt; $contis,<br \/>\n    '2#116' =&gt; 'Copyright 2021, RJM Programming'<br \/>\n);<br \/>\n<br \/>\n\/\/ Convert the IPTC tags into binary code<br \/>\n$data = '';<br \/>\n<br \/>\nforeach($iptc as $tag =&gt; $string) {<br \/>\n    $tag = substr($tag, 2);<br \/>\n    $data .= iptc_make_tag(2, $tag, $string);<br \/>\n}<br \/>\n<br \/>\n\/\/ Embed the IPTC data<br \/>\n$content = iptcembed($data, $path);<br \/>\n<br \/>\n\/\/ Write the new image data out to the file.<br \/>\n$fp = fopen($path, \"wb\");<br \/>\nfwrite($fp, $content);<br \/>\nfclose($fp);<br \/>\n<br \/>\n   }<br \/>\n echo \"&lt;html&gt;&lt;body onload=\\\" parent.document.getElementById('\" . $backi . \"').title=\" . $bcontis . \"; \\\"&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n }<br \/>\n } else {<br \/>\n exec(\"\/usr\/sbin\/screencapture -Cd -tjpg \/Applications\/MAMP\/htdocs\/screen-`date +\\\"%Y%m%d-%H%M\\\"`.jpg\");<br \/>\n }<br \/>\n exit;<\/code><br \/>\n?&gt;<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank href='\/\/www.rjmprogramming.com.au\/ITblog\/new-mac-os-mamp-timekeeping-web-application-php-intranet-tutorial\/'>New Mac OS MAMP Timekeeping Web Application PHP Intranet Tutorial<\/a> ...<\/p>\n\n\n\n\n\n<hr>\n\n\n\n\n\n<p id='mosmamptwaphpit'>Previous relevant <a target=_blank title='Mac OS MAMP Timekeeping Web Application PHP Intranet Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/mac-os-mamp-timekeeping-web-application-php-intranet-tutorial\/'>Mac OS MAMP Timekeeping Web Application PHP Intranet Tutorial<\/a> is shown below.<\/p>\n\n\n\n[caption id=\"\" align=\"alignnone\" width=\"220\" caption=\"Mac OS MAMP Timekeeping Web Application PHP Intranet Tutorial\"]<a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Mac OS MAMP Timekeeping Web Application PHP Intranet Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer_php_intranet.gif\" title=\"Mac OS MAMP Timekeeping Web Application PHP Intranet Tutorial\"  style=\"float:left;\"   \/><\/a>[\/caption]\n\n\n\n<p>It's \"Intranet\" time again, this time the integration just \"client side\" based, and with a previously client only <a title='Mac OS X MAMP Timekeeping Web Application Email Tutorial' href='#mosxmamptwaet'>Mac OS X MAMP Timekeeping Web Application Email Tutorial<\/a> web application's ...<\/p>\n\n\n\n\n\n<blockquote cite='\/\/www.rjmprogramming.com.au\/ITblog\/mac-os-x-mamp-timekeeping-web-application-email-tutorial\/' style='background-color:#f0f0f0;'>\n\n\n<ul>\n\n\n<li><i>Mac OS X<\/i> operating system +<\/li>\n\n\n\n\n<li>Existance of [\/usr\/sbin\/]<a target=_blank title='screencapture command information from Apple' href='https:\/\/developer.apple.com\/legacy\/library\/documentation\/Darwin\/Reference\/ManPages\/man1\/screencapture.1.html'><i>screencapture<\/i><\/a> +<\/li>\n\n\n\n\n<li><a target=_blank title='crontab information from computerhope ... thanks' href='http:\/\/www.computerhope.com\/jargon\/c\/cron.htm'><i>crontab<\/i><\/a> active and editable via <i>crontab -e<\/i> +<\/li>\n\n\n\n\n<li>One of ...\n\n\n<ol>\n\n\n<li><a target=_blank title='MAMP for Apache\/PHP\/MySql on Mac OS X local web server' href='http:\/\/www.mamp.info'><i>MAMP<\/i><\/a> installed to, in our case, <i>\/Applications\/MAMP\/htdocs\/<\/i> (as is mentioned in the relevant <i>crontab<\/i> background task that snapshots the user's screen every quarter hour) that maps to the MAMP web application URL <i>http:\/\/localhost:8888\/<\/i> ... or ...<\/li>\n\n\n\n\n<li><i>crontab<\/i> directory mention that corresponds to a URL call of our web application like for our Google Chrome example (where the <i>directory<\/i> below, used, could be a place of your choosing (that matches what is in your <i>crontab<\/i> task entry)) ...\n<code>\nfile:\/\/<i>\/Applications\/MAMP\/htdocs\/<\/i><font color=blue>HTMLCSS\/<\/font>quarter_hour_timer.html?localplace=\n<\/code>\n... or just, via the web browser's File -&gt; Open File menu ...\n<code>\nfile:\/\/<i>\/Applications\/MAMP\/htdocs\/<\/i><font color=blue>HTMLCSS\/<\/font>quarter_hour_timer.html\n<\/code>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.gif\"><\/img>\n<\/li>\n\n\n<\/ol>\n\n\n<\/li>\n\n\n<\/ul>\n\n\n<\/blockquote>\n\n\n\n\n\n<p> ... today we're <font color=blue>changing that into<\/font> ...<\/p>\n\n\n\n\n\n<ul>\n\n\n<li><i><font color=blue>mac OS or<\/font> Mac OS X<\/i> operating system +<\/li>\n\n\n\n\n<li>Existance of [\/usr\/sbin\/]<a target=_blank title='screencapture command information from Apple' href='https:\/\/developer.apple.com\/legacy\/library\/documentation\/Darwin\/Reference\/ManPages\/man1\/screencapture.1.html'><i>screencapture<\/i><\/a> +<\/li>\n\n\n\n\n<li><a target=_blank title='crontab information from computerhope ... thanks' href='http:\/\/www.computerhope.com\/jargon\/c\/cron.htm'><i>crontab<\/i><\/a> <font color=blue>(no longer relied upon)<\/font> active and editable via <i>crontab -e<\/i>  <font color=blue>(replaced by inline calling of new <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.php_GETME\">quarter_hour_timer.php<\/a> (which, as well as HTML below, should be downloaded to your MAMP's $_SERVER['DOCUMENT_ROOT'] \"HTMLCSS\" folder)<\/font>) ...\n<code>\n&lt;?php\n\/\/ quarter_hour_timer.php\n\/\/ RJM Programming\n\/\/ December, 2021\n exec(\"\/usr\/sbin\/screencapture -Cd -tjpg \/Applications\/MAMP\/htdocs\/screen-`date +\\\"%Y%m%d-%H%M\\\"`.jpg\");\n exit;\n?&gt;\n<\/code>\n<\/font> +<\/li>\n\n\n\n\n<li>One of ...\n\n\n<ol>\n\n\n<li><a target=_blank title='MAMP for Apache\/PHP\/MySql on Mac OS X local web server' href='http:\/\/www.mamp.info'><i>MAMP<\/i><\/a> installed to, in our case, <i>\/Applications\/MAMP\/htdocs\/<\/i> <strike style=color:blue;>(as is mentioned in the relevant <i>crontab<\/i> background task that snapshots the user's screen every quarter hour)<\/strike> that maps to the MAMP web application URL <i>http:\/\/localhost:8888\/<\/i> <font color=blue>(that incarnation called \"Intranet style\" from the public RJM Programming domain URL for <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.html--GETME\">quarter_hour_timer.html<\/a> <font color=blue>(and should be downloaded to your MAMP's $_SERVER['DOCUMENT_ROOT'] \"HTMLCSS\" folder)<\/font> which changed to cater for today's rearrangements in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.html--GETME\">this way<\/a>)<\/font> ... or ...<\/li>\n\n\n\n\n<li><strike style=color:blue;><i>crontab<\/i><\/strike> <font color=blue>PHP<\/font> directory mention that corresponds to a URL call of our web application like for our Google Chrome example (where the <i>directory<\/i> below, used, could be a place of your choosing (that matches what is in your <i>crontab<\/i> task entry)) ...\n<code>\nfile:\/\/<i>\/Applications\/MAMP\/htdocs\/<\/i><font color=blue>HTMLCSS\/<\/font>quarter_hour_timer.html?localplace=\n<\/code>\n... or just, via the web browser's File -&gt; Open File menu ...\n<code>\nfile:\/\/<i>\/Applications\/MAMP\/htdocs\/<\/i><font color=blue>HTMLCSS\/<\/font>quarter_hour_timer.html\n<\/code>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer_php_intranet.gif\"><\/img>\n<\/li>\n\n\n<\/ol>\n\n\n<\/li>\n\n\n<\/ul>\n\n\n\n\n\n<p> ... for your \"Intranet makeover\"!  Today's work in that vein shows a (Javascript) client only approach ...<\/p>\n\n\n  \n<code>\n var lportbit=getOS(':8888');\n var imgn='imgm' + Math.floor(Math.random() * 1987656453) + '.gif';\n var tryit='HTTP:\/\/localhost' + lportbit + '\/' + imgn; \n var thatone='', thattwo='';\n var wowowo=null;\n<br \/>\n function getOS(inlp) {\n var OSName = \"Win Unknown\";\n if (window.navigator.userAgent.indexOf(\"Windows NT 11.0\")!= -1) OSName=\"Windows 11\";\n if (window.navigator.userAgent.indexOf(\"Windows NT 10.0\")!= -1) OSName=\"Windows 10\";\n if (window.navigator.userAgent.indexOf(\"Windows NT 6.3\") != -1) OSName=\"Windows 8.1\";\n if (window.navigator.userAgent.indexOf(\"Windows NT 6.2\") != -1) OSName=\"Windows 8\";\n if (window.navigator.userAgent.indexOf(\"Windows NT 6.1\") != -1) OSName=\"Windows 7\";\n if (window.navigator.userAgent.indexOf(\"Windows NT 6.0\") != -1) OSName=\"Windows Vista\";\n if (window.navigator.userAgent.indexOf(\"Windows NT 5.1\") != -1) OSName=\"Windows XP\";\n if (window.navigator.userAgent.indexOf(\"Windows NT 5.0\") != -1) OSName=\"Windows 2000\";\n if (window.navigator.userAgent.indexOf(\"Mac\")            != -1) OSName=\"Mac\/iOS\";\n if (window.navigator.userAgent.indexOf(\"X11\")            != -1) OSName=\"UNIX\";\n if (window.navigator.userAgent.indexOf(\"Linux\")          != -1) OSName=\"Linux\";\n if (OSName.substring(0,3).toLowerCase() == 'win') { inlp='';  }\n return inlp;\n }\n <br \/> \n function calledlater() {\n            if (tryit != '') {\n            if (!inIframe() && document.URL.indexOf('https:') == 0 && document.URL.indexOf('localhost') == -1 && navigator.userAgent.toLowerCase().indexOf('safari\/') &gt; -1) {\n              location.href=document.URL.replace('https:','http:');\n            }\n            }\n }\n<br \/>\n function windowopen(theone, thetwo) {\n   var asu=('&' + document.URL.replace(document.URL.split('?')[0],'').replace('?','')).replace(\/^\\&$\/g,'');  \n   wowowo=window.open('HTTP:\/\/localhost' + lportbit + '\/HTMLCSS\/quarter_hour_timer.html?imgname=' + imgn + asu,'xxlocit');\n   thatone=theone;\n   thattwo=thetwo;\n   setTimeout(postwo, 4000);\n }\n<br \/> \n function postwo() {\n   if (tryit.trim() == tryit) {\n     return null;\n   } \n   wowo=window.open(thatone, thattwo);\n }\n<br \/> \n function inIframe () {  \/\/ thanks to https:\/\/stackoverflow.com\/questions\/326069\/how-to-identify-if-a-webpage-is-being-loaded-inside-an-iframe-or-directly-into-t\n    try {\n        return window.self !== window.top;\n    } catch (e) {\n        return true;\n    }\n }\n<br \/>  \n function mamptry() { \n   if (!inIframe()) { if (document.URL.indexOf('httJUNKp:') == 0) { wowo=window.open('HTTP:\/localhost' + lportbit + '\/HTMLCSS\/quarter_hour_timer.html','mamptry'); document.getElementById('mamptry').style.display='block'; } else if (document.URL.indexOf('localhost') == -1) { windowopen('HTTP:\/localhost' + lportbit + '\/HTMLCSS\/quarter_hour_timer.html','blank');  } }\n }\n<br \/>\nif ((location.search.split('imgname=')[1] ? (decodeURIComponent(location.search.split('imgname=')[1]).split('&')[0]) : '')) {\n  var asu=((document.URL.replace(document.URL.split('?')[0],'')).replace('?','').replace('&','?') + '?');  \n  asu=('?' + asu.split('?')[1]).replace(\/^\\?$\/g,''); \n  if (document.URL.indexOf('localhost') != -1) { window.open(document.URL.split('?')[0] + asu,'_blank'); }\n}\n<br \/>\n function forceissue() {\n   var d1 = new Date();\n   if (document.URL.indexOf('localhost') != -1 && d1.toUTCString().replace(':15:',':00:').replace(':30:',':00:').replace(':45:',':00:').replace(':07 ',':08 ').replace(':09 ',':08 ').indexOf(':00:08 ') != -1) {\n   document.getElementById('xxxxlocit').src=document.URL.replace('.html','.php').replace('.htm','.php').split('?')[0] + '?rand=' + Math.floor(Math.random() * 1987656432);\n   } else {\n   document.getElementById('xxxxlocit').src=document.URL.replace('.html','.php').replace('.htm','.php').split('?')[0] + '?rand=' + Math.floor(Math.random() * 1987656432);\n   normok=false;\n   fillinmywork();\n   }\n }\n<br \/>\n function lookforfifteen() {\n   var d1 = new Date();\n   if (document.URL.indexOf('localhost') != -1 && d1.toUTCString().replace(':15:',':00:').replace(':30:',':00:').replace(':45:',':00:').replace(':07 ',':08 ').replace(':09 ',':08 ').indexOf(':00:08 ') != -1) {\n   forceissue(); \/\/ document.getElementById('xxxxlocit').src=document.URL.replace('.html','.php').replace('.htm','.php').split('?')[0] + '?rand=' + Math.floor(Math.random() * 1987656432);\n   setTimeout(lookforfifteen, 5000);\n   } else {\n   setTimeout(lookforfifteen, 1000);\n   }\n }\n<br \/> \n setTimeout(calledlater, 2000);\n setTimeout(lookforfifteen, 1000);\n<\/code>\n\n\n<!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/mac-os-mamp-timekeeping-web-application-php-intranet-tutorial\/'>Mac OS MAMP Timekeeping Web Application PHP Intranet Tutorial<\/a>.<\/p-->\n<hr>\n<p id='mosxmamptwaet'>Previous relevant <a target=_blank title='Mac OS X MAMP Timekeeping Web Application Email Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/mac-os-x-mamp-timekeeping-web-application-email-tutorial\/'>Mac OS X MAMP Timekeeping Web Application Email Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Mac OS X MAMP Timekeeping Web Application Email Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer_email.jpg\" title=\"Mac OS X MAMP Timekeeping Web Application Email Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Mac OS X MAMP Timekeeping Web Application Email Tutorial<\/p><\/div>\n<p>The practicalities of yesterday&#8217;s (<a title='Mac OS X MAMP Timekeeping Web Application Primer Tutorial' href='#moxmtwapt'>Mac OS X MAMP Timekeeping Web Application Primer Tutorial<\/a>) timekeeping Mac OS X Web Application, left as they are, would leave you with a somewhat useful web application whose use is only <i>for the here and now<\/i>, but what if you want it to be more accountable?  Well, that is when we, here, at RJM Programming, like to use that tried and trusted <a target=_blank title='Email information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Email'><i>email<\/i><\/a> form of communication.<\/p>\n<p>Today&#8217;s email methods spurn the use of server-side intervention, at least for now.  So what is available to us as tools, if we don&#8217;t include Ajax nor jQuery in that list?  Well, we have, to our minds &#8230;<\/p>\n<ul>\n<li><a target=_blank title='Mailto link information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tryit.asp?filename=tryhtml_link_mailto'>mailto<\/a> links (get us to the email client) +<\/li>\n<li>the body section of that email can have a clipboard image <i>pasted<\/i> into it, for which we can utilize HTML5 <a target=_blank title='HTML Canvas element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_canvas.asp'>canvas<\/a> element&#8217;s <a target=_blank title='HTML5 canvas element toDataURL method information' href='https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/HTMLCanvasElement\/toDataURL'>toDataURL<\/a>() method, teamed up with a <a target=_blank href='http:\/\/www.w3schools.com\/jsref\/met_win_open.asp' title='window.open information from w3schools'><i>window.open<\/i><\/a> popup window of the <i>toDataURL<\/i> image data, which can be <i>selected<\/i> and <i>copied<\/i>, optionally, by the user themselves, should they wish this to make their email more self explanatory<br \/>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer_email.gif\" title='The workings of email creation'><\/img>\n<\/li>\n<\/ul>\n<p>We last discussed this thinking with <a target=_blank title='Canvas Annotation Email Attachment Clipboard Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/canvas-annotation-email-attachment-clipboard-tutorial\/'>Canvas Annotation Email Attachment Clipboard Tutorial<\/a>.<\/p>\n<p>We rely on the <a target=_blank title='crontab information from computerhope ... thanks' href='http:\/\/www.computerhope.com\/jargon\/c\/cron.htm'><i>crontab<\/i><\/a> functionality, being as there is no server-side help, to create the image file, whose contents eventually go to make up the contents that can be selected and copied and pasted by the user into the body section of the email (and sent off to whosoever they feel like sending it too, as you have the full power of the email client available to you with the interaction you have with an actual email client program).<\/p>\n<p>Here is the HTML and Javascript <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.html-GETME\">quarter_hour_timer.html<\/a> which changed to cater for today&#8217;s email functionality in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.html-GETME\">this way<\/a>, and, as per the <b><i>Stop Press<\/i><\/b> from yesterday, we&#8217;ll also have a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.html\" title='Click picture'>live run<\/a> link here today.<\/p>\n<hr>\n<p id='moxmtwapt'>Previous relevant <a target=_blank title='Mac OS X MAMP Timekeeping Web Application Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/mac-os-x-mamp-timekeeping-web-application-primer-tutorial\/'>Mac OS X MAMP Timekeeping Web Application Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Mac OS X MAMP Timekeeping Web Application Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.jpg\" title=\"Mac OS X MAMP Timekeeping Web Application Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Mac OS X MAMP Timekeeping Web Application Primer Tutorial<\/p><\/div>\n<p>Sometimes when you program, especially for administrative type functionality, there are useful programs to write, that are able to become web applications, but in a limited set of platforms.  So it is today with our timekeeping web application that relies on &#8230;<\/p>\n<ul>\n<li><i>Mac OS X<\/i> operating system +<\/li>\n<li>Existance of [\/usr\/sbin\/]<a target=_blank title='screencapture command information from Apple' href='https:\/\/developer.apple.com\/legacy\/library\/documentation\/Darwin\/Reference\/ManPages\/man1\/screencapture.1.html'><i>screencapture<\/i><\/a> +<\/li>\n<li><a target=_blank title='crontab information from computerhope ... thanks' href='http:\/\/www.computerhope.com\/jargon\/c\/cron.htm'><i>crontab<\/i><\/a> active and editable via <i>crontab -e<\/i> +<\/li>\n<li>One of &#8230;\n<ol>\n<li><a target=_blank title='MAMP for Apache\/PHP\/MySql on Mac OS X local web server' href='http:\/\/www.mamp.info'><i>MAMP<\/i><\/a> installed to, in our case, <i>\/Applications\/MAMP\/htdocs\/<\/i> (as is mentioned in the relevant <i>crontab<\/i> background task that snapshots the user&#8217;s screen every quarter hour) that maps to the MAMP web application URL <i>http:\/\/localhost:8888\/<\/i> &#8230; or &#8230;<\/li>\n<li><i>crontab<\/i> directory mention that corresponds to a URL call of our web application like for our Google Chrome example (where the <i>directory<\/i> below, used, could be a place of your choosing (that matches what is in your <i>crontab<\/i> task entry)) &#8230;<br \/>\n<code><br \/>\nfile:\/\/<i>\/Applications\/MAMP\/htdocs\/<\/i>quarter_hour_timer.html?localplace=<br \/>\n<\/code><br \/>\n&#8230; or just, via the web browser&#8217;s File -&gt; Open File menu &#8230;<br \/>\n<code><br \/>\nfile:\/\/<i>\/Applications\/MAMP\/htdocs\/<\/i>quarter_hour_timer.html<br \/>\n<\/code><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.gif\"><\/img>\n<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p> &#8230; pretty restrictive, huh? &#8230; but pretty useful for our quarter hour timekeeping purposes today.<\/p>\n<p>We want to have a web application that is running at the user&#8217;s discretion, and when first fired up, looks for outputs from <i>crontab<\/i> tasks above &#8230;<\/p>\n<p><code><br \/>\n0,15,30,45 * * * * \/usr\/sbin\/screencapture -Cd -tjpg <i>\/Applications\/MAMP\/htdocs\/<\/i>screen-`date +\"\\%Y\\%m\\%d-\\%H\\%M\"`.jpg<br \/>\n<\/code><\/p>\n<p> &#8230; for the current day in question and if existant show &#8230;<\/p>\n<ol>\n<li>a date and time stamp +<\/li>\n<li>the snapshot of what you were doing at the quarter hour, that is clickable to make bigger for more in depth viewing +<\/li>\n<li>an HTML textarea element in which you can optionally type in more specifics about that quarter hour<\/li>\n<\/ol>\n<p>So, as much as we like to think of Mac OS X Terminal application&#8217;s <a target=_blank title='Berkeley Software Distribution information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Berkeley_Software_Distribution'>BSD<\/a> (a unix derivative) operating system, as being a lot like Linux, there are some commands and usage that &#8230;<\/p>\n<ul>\n<li>adds Mac OS X specific command line functionality to a Linux or unix base set of functionality, like for today&#8217;s <a target=_blank title='screencapture command information from Apple' href='https:\/\/developer.apple.com\/legacy\/library\/documentation\/Darwin\/Reference\/ManPages\/man1\/screencapture.1.html'><i>screencapture<\/i><\/a> command &#8230; and we&#8217;ve included another such example, below, with the command <a target=_blank title='say command information from Apple' href='https:\/\/developer.apple.com\/legacy\/library\/documentation\/Darwin\/Reference\/ManPages\/man1\/say.1.html'><i>say<\/i><\/a> featuring in <a title='Mac OS X Text to English Speech Primer Tutorial' href='#moxttspt'>Mac OS X Text to English Speech Primer Tutorial<\/a> as shown below<\/li>\n<li>changes switches on Linux or unix commands<\/li>\n<li>won&#8217;t have some Linux or unix commands that other platforms do<\/li>\n<\/ul>\n<p>In the great tradition of <i>behoving<\/i> &#8230; we <i>behove<\/i> &#8230; we <i>behove<\/i> thee <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.html_GETME\">quarter_hour_timer.html<\/a> if you like, my liege.  On this occasion you&#8217;ll have gleaned that there is no <i>live run<\/i> link, because the RJM Programming web server is not Mac OS X &#8230; so command line <a target=_blank title='screencapture command information from Apple' href='https:\/\/developer.apple.com\/legacy\/library\/documentation\/Darwin\/Reference\/ManPages\/man1\/screencapture.1.html'><i>screencapture<\/i><\/a> has no meaning for a CentOS web server&#8217;s operating system command line.  You&#8217;ll see in the code that rather than use <a target=_blank title='\"Client Pre-emptive Iframe\" at this blog' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/?s=client-pre-emptive-iframe'>&#8220;Client Pre-emptive Iframe&#8221;<\/a> concepts to check for existence of <i>crontab<\/i> screen capture images, we, instead use the <a target=_blank title='Javascript onerror event information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/event_onerror.asp'><i>onerror<\/i><\/a> event for HTML <a target=_blank title='HTML img tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_img.asp'>img<\/a> elements to check for non-existance.<\/p>\n<p><b><i>Stop Press<\/i><\/b><\/p>\n<p>Just noticed that, perhaps, after all, a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/quarter_hour_timer.html\">live run<\/a> from the RJM Programming website can make sense if you have a Mac OS X laptop, for instance, that is running that suggested <i>crontab<\/i> entry as explained in tutorial above.  That type of live run managed to latch on to our local <i>crontab<\/i> screencaptures on my MacBook Pro.<\/p>\n<hr>\n<p id='moxttspt'>Previous relevant <a target=_blank title='Mac OS X Text to English Speech Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/mac-os-x-text-to-english-speech-primer-tutorial\/'>Mac OS X Text to English Speech Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/audio_video.html?clickit=submitmb\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Mac OS X Text to English Speech Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/say.jpg\" title=\"Mac OS X Text to English Speech Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Mac OS X Text to English Speech Primer Tutorial<\/p><\/div>\n<p>We&#8217;ve got a few new ideas today &#8230;<\/p>\n<ol>\n<li>Text to English Speech via Mac OS X&#8217;s command line <a target=_blank title='say command information from Apple' href='https:\/\/developer.apple.com\/legacy\/library\/documentation\/Darwin\/Reference\/ManPages\/man1\/say.1.html'><i>say<\/i><\/a> command used by PHP via <a target=_blank title='PHP exec() method information' href='http:\/\/php.net\/manual\/en\/function.exec.php'><i>exec<\/i><\/a> to make <a target=_blank title='say.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/say.php_GETME'>say.php<\/a> (which is useful as a download to a Mac OS X laptop using <a target=_blank title='MAMP for Apache\/PHP\/MySql on Mac OS X local web server' href='http:\/\/www.mamp.info'>MAMP<\/a>) which, today, does not have a live run because the web server of domain <i>rjmprogramming.com.au<\/i> is a CentOS Linux server &#8230; Linux equivalent of Mac OS X&#8217;s <i>say<\/i>? &#8230; read <a target=_blank title='Useful link' href='https:\/\/github.com\/usc-isi-i2\/festival-text-to-speech-service\/blob\/master\/README.md'>here<\/a><\/li>\n<li>Trying to present this brought up the usual movie production problem with <a target=_blank title='iMovie for Mac information from Apple' href='http:\/\/www.apple.com\/au\/mac\/imovie\/'>iMovie<\/a> overlaying the audio on top of the video (though you may want to try, and you could start reading with <a target=_blank title='Semi useful link' href='http:\/\/video.stackexchange.com\/questions\/2579\/can-you-link-an-audio-track-to-a-video-track-in-imovie'>this link<\/a>) versus <a target=_blank title='QuickTime information from Apple' href='https:\/\/support.apple.com\/downloads\/quicktime'>QuickTime Player<\/a> talent to catch both audio and video tracks (and that we ended up using), but not of the &#8220;screen goings on&#8221;, alas versus <a target=_blank title='MPlayer OSX Extended information' href='http:\/\/mplayerosx.ch\/'>MPlayer OSX Extended<\/a> which can play separately but not two tracks on top and doesn&#8217;t do any reconstituting &#8230; so &#8230;<\/li>\n<li>Improved on our inhouse Video\/Audio synchronizing efforts by allowing <a target=_blank title='audio_video.html' href='http:\/\/www.rjmprogramming.com.au\/PHP\/audio_video.html---GETME'>audio_video.html<\/a> supervisor (changed in <a target=_blank title='audio_video.html' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/audio_video.html---GETME'>this way<\/a>) be able to be called to press one of its preconceived synchronization buttons <i>onload<\/i> which we do with (the newly added) <a target=_blank title='Macbeth Act 1 Scene 1' href='http:\/\/www.rjmprogramming.com.au\/PHP\/audio_video.html?clickit=submitmb'>Macbeth Act 1 Scene 1<\/a> &#8230; in a small <a target=_blank title='Birthday of Shakespeare' href='http:\/\/www.shakespeare.org.uk\/visit-the-houses\/whats-on.html\/birthday-celebrations.html'>celebration<\/a> of the Bard &#8230; who, am thinking (in that Falstaff way), would have got a huge chuckle out of &#8220;anonymous&#8221; instead of &#8220;anon&#8221; during the Three Witches scene &#8230; we <i>had<\/i> to do something to say Happy Birthday<\/li>\n<\/ol>\n<p>Along the way we tried filming the MacBook Pro with the iPad to a <a target=_blank title='YouTube' href='http:\/\/youtube.com'>YouTube<\/a> &#8230;<\/p>\n<p><iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/9-Hvlz8g1Mg\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p> &#8230; but weren&#8217;t happy with the audio quality, alas (too\/two).<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d21904' onclick='var dv=document.getElementById(\"d21904\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/text-to-speech\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d21904' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d22942' onclick='var dv=document.getElementById(\"d22942\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/time\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d22942' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d22960' onclick='var dv=document.getElementById(\"d22960\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/email\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d22960' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54161' onclick='var dv=document.getElementById(\"d54161\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/intranet\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54161' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54183' onclick='var dv=document.getElementById(\"d54183\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/iptc\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54183' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54189' onclick='var dv=document.getElementById(\"d54189\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/calendar\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54189' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Okay then, yesterday&#8217;s Mac OS MAMP Timekeeping Web Application PHP Image Metadata Tutorial &#8220;image metadata smarts&#8221; puts us in a position to get onto the &#8220;bells and whistles&#8221; side of our Timekeeping (macOS and Mac OS X only at this &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/mac-os-mamp-timekeeping-web-application-php-calendar-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[85,272,274,301,576,590,624,3871,652,714,3080,725,744,778,932,997,2407,1103,1279,1921,1319],"class_list":["post-54289","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-apache","tag-cron","tag-crontab","tag-date","tag-html","tag-image","tag-intranet","tag-iptc","tag-javascript","tag-local-web-server","tag-mac-os","tag-mac-os-x","tag-mamp","tag-metadata","tag-php","tag-programming","tag-record","tag-screen-capture","tag-time","tag-timekeeping","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54289"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=54289"}],"version-history":[{"count":1,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54289\/revisions"}],"predecessor-version":[{"id":54330,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54289\/revisions\/54330"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=54289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=54289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=54289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}