views:

58

answers:

3

I want to be able to search an html page that is refreshing every 10 seconds for the word "stat". If the word is found I then want to alert the user through a pop up dialog and possibly a repeating sound until the user acknowledges it.

UPDATE:

Sorry the question was a bit ambiguous. I do not know a great deal about this stuff I just do it as a hobby.

OK so here is the deal. I work as Biomedical Electronics Technician for a hospital. We have a work order system that is web based. Nurses can enter a work order into this system. I have a browser window open at all times that refreshes periodically through an add-on for IE so I can always be up to date on the status of the work orders coming in. When a nurse the enters enters a work order they have the option of choosing Stat, High, Medium, or Low for the priority. When a stat work order is placed our response time should be within five minutes theoretically. I want some way to alert myself when a stat work order has been placed so I can respond accordingly. And I know a repeating sound would be annoying, but that might be the best way to get my attention.

Another caveat to this is the work order status can be changed by me, the tech. So when a work order is initially placed the status is Not assigned or something like that. Once I go start on a work order I change the status to In Progress. If I have to order a part I change the status to Hold for Parts, etc. So basically, what I am saying is I don't want to alerted if the status is anything but "Not assigned". If it will help I will get a copy of the source of the page when I get to work tomorrow.

Our IT department seems unwilling to help and the company that made the product is so busy chasing the daily bugs that show up to add new features such as this at this time. If I knew more a Google search might help, but alas I am a bit noobish in the programming realm, however I am 2 years from a C.S. degree so I am not a complete novice.

To answer another question, I do not have access to the page I am just viewing it so any sort of script would need to run on my client machine.

Thanks

A: 

I found this, try it https://addons.mozilla.org/en-US/firefox/addon/3028/

Maybe it can search for STAT on the entire page?

bwawok
Ah yes that might work. Only problem is the intranet at our hospital uses IE. I've tried Firefox before and it simply doesn't work. I'll try again at work to see if anything has changed but I'm pretty sure it will not.
deets
@deets That's interesting. I wonder if they have it explicitly set up so that if the User-Agent header is anything besides IE, it won't serve the pages. There are various ways to fake the User-Agent header (such as the Web Developer Toolbar, although it's a little overkill for what you want) and maybe then you could use Firefox.
MatrixFrog
Often times the internal company websites are hardcoded for IE6 and active X. My old company's internal website was like that..everything ActiveX and non-compliant (depending upon IE bugs) html to get the results they want. Also one of the reasons they're still using IE6 today :-(
Caladain
A: 

Based off your description, it doesn't sound like you have access to the server to change the code of the page itself, correct?

If that's the case, spend some time learning how to use Greasemonkey (or rather Greasemonkey for IE). It allows you to add functionality to a web page from the client (browser) side, regardless of what's on the server.

You'll need to find the elements that hold the "stat" term your after, and have it check periodically those elements periodically. Look into the setTimeout method for that periodicity. The rest you'll have to work out specific to that page.

Chadwick
Correct I do not have access to the server side code. I may try that thanks for the info.
deets
A: 

What you're looking for, since you have python available, is to build a simple, easy to use webscraper.

First link is how i would do it quick and dirty.
http://www.ehow.com/how_4436125_read-web-page-using-python.html
Second link is a bit more robust and nifty with BeautifulSoup
http://www.builderau.com.au/program/python/soa/Build-a-basic-Web-scraper-in-Python/0,2000064084,339281476,00.htm

Basically, read the page (even set the whole loop on a 10 second refresh timer).
Go line by line with a while readline loop.
See if one of your magic words exists with a regular expression
...
profit?

(... meaning do your alert song and dance)
(profit being rejoice!)

Caladain