PI Comet's stable version released Date: April 9, 2008 Tags: comet , javascript , pi Comments(0)
I fixed base class and reported bugs.You can use pi.comet file or little bigger sized pi library (I'm prepearing a documentation and website for this library).Pi.Comet works with Turbogears as well Date: April 2, 2008 Tags: cherrypy , comet , javascript , pi , turbogears Comments(2)
After a CherryPy test, I developed a real time chat example with pi.comet&Turbogears.Actually, I was going to add this example long time ago but I couldn't find any shared hostings available. Data streaming can not be used at Webfaction, because webfaction hosts turbogears with cgi support. If you have no hosting problems, you can use pi.comet and turbogears with your comet applications.For now, you can download and test it on your localhost.Download Example:turbogears_realtimeChat.tar.gz
Screenshot:
pi.comet's python module is available Date: March 21, 2008 Tags: cherrypy , comet , django , javascript , pi , python Comments(2)
I coded a python module to get cross browser output and a CherryPy example is available too.You can get these files in downloads list.You can use this module with any python web framework but there are some problems.Firstly, Django doesn't support multi-threading.And there is no shared hosting for CherryPy ( Webfaction runs CherryPy with CGI, sys.stdout.flush function doesn't work on that application ) I hope we have got more comet friendly web frameworks in the future.
Creating Comet Applications In 3 Minutes Date: March 16, 2008 Tags: comet , javascript , pi Comments(10)
First version of my pi library has been released.This version contains a comet class and you can make comet requests in your applications by using it.Tutorial: Getting unix time from server(Sample File, Source)
Firstly, create an html file and import pi.js:
<script type="text/javascript" src="pi.js"></script>
Then, send a request to push.php to get unix time from server:
var request = new pi.comet();
request.environment.setUrl("push.php");
request.event.push = function(RESPONSE){
document.title = "UNIX TIME AT SERVER: "+RESPONSE;
};
request.send();
Finally, create an infinite loop at push.php, import pi.pushData function to this file and print the data which will be updated each time;
require_once "pi.pushData.php";
$type = $_GET["cometType"];
$name = $_GET["cometName"];
while(true){
pushData(time(),$type,$name);
ob_flush();
flush();
sleep(1);
}
That's all! You can get more information at pi.comet's wiki page.
