PDA

View Full Version : HTML Output from Text Search



PatrickK64
11-13-2008, 12:28 AM
Greetings,

I'm a hack novice at Javascript, so I'm hoping that I can get some help.

I need to build a script that will:
1. Read a remote HTML file as text.
2. Search the text string for two key words.
3. Output a separate string of text if the two key words are found.
4. Output no text if the two key words are not found.

example:
Read http://http://ahps2.wrh.noaa.gov/ahps2/ahps_warnings.php?wfo=sew
Search for the words "flood" and "pierce" (case-insensitive.
If both of these words exist in the HTML text, then output "<img src=...>".
If not, don't output "<img src=...>".

This output string will be embedded into PHP-generated code.
(I could do this with PHP, except that my host doesn't allow fopen(), etc.)

Thanks a lot.

-Pat