[tpm] [OT] Javascript to watch for certain KW from a web page

Antonio Sun antoniosun at lavabit.com
Wed Oct 10 06:51:35 PDT 2012

Hi, thanks a lot for your offer Shaun.

That was actually what I thought the solution to be. Now let's forget what
I said and focus on what I need to accomplish.

Yes, I totally control the page content. The situation is,

I am designing a web portal that can launch back-end server side processes.
The problem is that the process can finish in seconds, or it might
need hours to finish, depending how much work the process has. So my design
is to spawn a sub process, and capture all its outputs to a log text file,
then return immediately to the user, in a web notice page saying, your job
is queued; here is the log url; please check manually if is finished or

But my all my fellow coworkers said they don't want to check
themselves. Instead, they want my web portal to check for them. I couldn't
think of any solution from the server side to capture the end of the sub
process, then informed the already submitted web notice page. Hence, I'm
turning to the javascript front-end for solutions. Because I have zero
knowledge of Javascript, it might not be feasible at all. But I know the
best solution is that if I can have a desktop notification mechanism just
like gmail does, that should solve the problem, because my sub
process control task does know when the sub process ends, and write a
specific ending tag to the end of the log file, which is what I was
planning to watch/search for. Every page of my portal does include a
standard master template (except the log text file), so if I can send a
signal at the end of my sub process and capture that by the master
template, then pop up a javascript window, that will do as well.

Sorry for the lengthy gibberish, hope that you can figure something out
from it.


On Wed, Oct 10, 2012 at 3:01 AM, Shaun Fryer <sfryer at sourcery.ca> wrote:

> Hi Antonio,
> I might be able to help you, but first I need to know a bit more
> detail about what you're trying to do. When you say watch for certain
> keywords from a webpage, what do you mean exactly? If you mean
> searching through a static html document looking for a give word or
> words, that's fairly trivial. However, if you can add javascript to
> the page in question, then you probably control the page, and
> therefore should already know it's content. So question is, why would
> you need front-end code in JavaScript to do it? If you mean doing an
> HTTP request from within a web-page, or even a Cross Origin request,
> in order to receive info from a 3rd-party website, then things could
> become considerably more complicated.
> Cheers,
> --
> Shaun Fryer
> ----------------------------------------------------------
> perl -e 'print chr for map{$_+=22}($ARGV[0])=~/(\d\d)/g' \
>         52959394107588899482799210587992861082757785799222
> ----------------------------------------------------------
> On Tue, Oct 9, 2012 at 5:48 PM, Antonio Sun <antoniosun at lavabit.com>
> wrote:
> > Hi,
> >
> > I know it's kind of OT, but since we have a lot of web experts here, let
> me
> > try my luck here first.
> >
> > I have zero knowledge of Javascript, I'm wondering if you could give me a
> > big favor to show me how to watch for certain keyword from a web page
> using
> > Javascript.
> >
> > Basically, I have a slow updating web page, and I need a client side
> > Javascript to watch for a specific keyword in that page and pop up an
> window
> > if the keyword is found.
> >
> > As I have zero knowledge of Javascript, I hope that your answer is as
> > complete as possible.
> >
> > Thanks a lot in advance
> >
> > Antonio
> >
> >
> > _______________________________________________
> > toronto-pm mailing list
> > toronto-pm at pm.org
> > http://mail.pm.org/mailman/listinfo/toronto-pm
> >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20121010/fccba24d/attachment.html>

More information about the toronto-pm mailing list