
I just whipped up a little PHP script that impliments the *nix command tail via AJAX in a browser, using any file available through a URL. This is useful for watching log files, because it will reverse the order of the file, that is, print what is being written to the bottom of the log file to the top of the browser window for easy viewing. The script uses AJAX to push the updates to the file through to the browser every 10 seconds. To use your file, just subsitutute your file ‘s URL for the text.txt URL given into the following URL:
http://www.danzarrella.com/tail.php?file=http://www.danzarrella.com/test.txt
If you liked this post, don't forget to subscribe to my RSS feed or my email newsletter so you never miss the science.







May 10th, 2006 at 6:59 pm
Hello,
I am just thinking about similar script. Would you please share source of tail.php with me for learning purposes?
Regards,
=MrR=
August 8th, 2006 at 9:05 am
[...] A while back I linked to a demo of a script I wrote implementing the unix command tail (Like for watching the data being appended to a file), so I could tail a log file. I finally got around to posting the source code. You’ll need saja the secure ajax for PHP framework and my saja.functions.php file as well as the actual output page, tail.php. As with most of my code its icky and hackish, but it works. For me at least. Posted by Dan Zarrella Filed in AJAX, PHP Related Posts:AJAX Tail ImplementationDoes the 80/20 Rule Apply to Keyword Traffic?The Short Head is not because of Economics and a PHP ngram tokenizerCumulative Percentage Curves of Keyword Niches [...]