SitePen Support
Orbited

SVNsearch Adds Real-time Updates

by Dylan SchiemannApril 17th, 2008

Greg Wilkins mentioned recently that you can now keep track of subversion commits in real-time thanks to Cometd and Dojo 1.1! Thanks to the great work of Eirik Bjørsnøs at SVNSearch, you can now, for example, check out the latest changes to Jetty.

SVNSearch

The code on the client-side for making this happen is relatively straightforward. Include Dojo and dojox.cometd and a few lines to add sounds when a new commit arrives:

<script type="text/javascript" src="/resources/js/dojo-1.1.0/dojo/dojo.js">
</script>
<script type="text/javascript" src="/resources/sound/Sound.js"></script>
var ping = new Sound({swf: "/resources/sound/Sound.swf"});
 
dojo.require("dojox.cometd");
 
dojox.cometd.init("/cometd");
 
function updated(msg) {
    if(!true) {
        ping.load("/resources/sound/Bullet.mp3")
        ping.play();
    }
 
    setTimeout('search("", "", true)', 2500);
    //search("", "", true);
}
dojox.cometd.subscribe("/searches/JETTY", true, updated);
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Free Liberator

Leave a Reply



Copyright 2010 Comet Daily, LLC. All Rights Reserved