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

Shaun Fryer sfryer at sourcery.ca
Fri Oct 12 21:00:47 PDT 2012


If any of you are interested, I have a little Javascript project of my
own on the go, geared towards Perl developers in terms of some general
design patterns. I borrowed some initial starting pointers from
JSAN.org Test.Simple and built a loosely TAP based test framework. It
also implements a basic swiss inheritance system similar to Perl's via
an importer() function and use(qw("the properties you want")) roughly
speaking. Anyway, I'm not widely circulating it yet, because it's
still a bit rough around the edges, but if this kind of thing appeals
to you, please check it out.

https://github.com/sfryer/sunflower
--
Shaun Fryer
647-709-6509
----------------------------------------------------------
perl -e 'print chr for map{$_+=22}($ARGV[0])=~/(\d\d)/g' \
        52959394107588899482799210587992861082757785799222
----------------------------------------------------------


On Fri, Oct 12, 2012 at 9:45 AM, Antonio Sun <antoniosun at lavabit.com> wrote:
> Thanks Shaun.
>
> Yes I did use jQuery eventually. As I have zero knowledge of Javascript, I
> started easy with Mark's code on a static page, once successful, I moved on
> to jQuery.
>
> Thanks for your recommendation. jQuery is really powerful and well
> commented.
> I was able to get my job done with only the knowledge from the following two
> tutorials:
>
> The load() method
> http://www.jquery-tutorial.net/ajax/the-load-method/
>
> Showing progress
> http://www.jquery-tutorial.net/ajax/showing-progress/
>
> Thanks
>
> On Fri, Oct 12, 2012 at 4:38 AM, Shaun Fryer <sfryer at sourcery.ca> wrote:
>>
>> The reason jquery is a good idea, is you probably want to add it as an
>> onclick to a button or something. It's worth it to take the 10 minutes
>> to rtfm, and avoid yourself alot of headache with cross-browser
>> events.
>> --
>> Shaun Fryer
>> 647-709-6509
>> ----------------------------------------------------------
>> perl -e 'print chr for map{$_+=22}($ARGV[0])=~/(\d\d)/g' \
>>         52959394107588899482799210587992861082757785799222
>> ----------------------------------------------------------
>>
>>
>> On Fri, Oct 12, 2012 at 4:31 AM, Shaun Fryer <sfryer at sourcery.ca> wrote:
>> > Or for yet another way, also sans jquery...
>> >
>> > var iframe = document.createElement("iframe");
>> > var o = {display:"none", height:0, width:0};
>> > for (var attr in o) iframe.style[attr] = o[attr]; // append a
>> > timestamp below to bypass cache
>> > var getServerStatus = function () { iframe.src =
>> > "/url/to/your/log/output?" + (new Date ()).getTime() };
>> > iframe.onload = function() {
>> >
>> >   var win = iframe.contentWindow || iframe.contentDocument;
>> >   if (/your regexp/.test(win.document.body.innerHTML))
>> >     alert("your process completed");
>> >   else setTimeout( getServerStatus, 60*1000 ); // ~1 minute
>> >
>> > };
>> > getServerStatus();
>> > document.body.appendChild(iframe);
>> > --
>> > Shaun Fryer
>> > 647-709-6509
>> > ----------------------------------------------------------
>> > perl -e 'print chr for map{$_+=22}($ARGV[0])=~/(\d\d)/g' \
>> >         52959394107588899482799210587992861082757785799222
>> > ----------------------------------------------------------
>> >
>> >
>> > On Thu, Oct 11, 2012 at 11:05 AM, Antonio Sun <antoniosun at lavabit.com>
>> > wrote:
>> >> Thanks a lot Mark,
>> >> That works like a charm. I really appreciate your simplified solution
>> >> sample
>> >> code.
>> >>
>> >> Thanks again everyone for your helps.


More information about the toronto-pm mailing list