SVNsearch Adds Real-time Updates
by Dylan SchiemannApril 17th, 2008Greg 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.
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);










