The feature you desire requires knowledge of basic query and scripting. There isn't a magic code someone can provide that you simply copy/paste and voila it works. How good are you at scripting?
although there isn't magic involved, there are many polling scripts documented throughout the web, including hand coded, pre builts, xml driven flash implementations, widgets, etc. Try a Google search and choose the one that will best suit your needs.