First create a python script that keeps track of the log file for changes. If you only need this for testing debugging purposes, then this is excessive use of Django or other web infrastructure. It is very simple to implement the functionality of the Http web server using sockets. Whenever an Http GET request is made, only make the difference with another request. To achieve this, you need to store in memory the status of each incoming request (for example, the number of the last line in the file).
The jQuery part is actually quite simple. Set the timer using the setTimeout function. Something like this will do:
function doUpdate() { $.ajax({type: "GET", url : tailServiceUrl, success: function (data) { if (data.length > 4) {
You can also create callbacks for errors and timeouts to report a problem with the server.
kgiannakakis
source share