Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: Firefox keep alive extension?

On Fri, 10 Feb 2006 16:59:28 +0000, Roy Schestowitz staggered into the
Black Sun and said:
> __/ [The Natural Philosopher] on Friday 10 February 2006 11:26 \__
>> one of which is keeping a fairly close watch - every half hour or so
>> - on a web site that displays more or less real time stock prices.
> "Real time", you say? There is a lag with most of them...

The free ones are delayed at least 15 minutes.  The pay ones can be much
faster.

>> The trouble is that the site I use, they log me out after ten minutes
>> of inactivity.  What I really really need - is some kind of firefox
>> extension, that I could in principle say 'see where I am, watch what
>> I do and record it, and keep doing it every 5 minutes till I tell you
>> to stop'
> Such a thing would be worryingly insecure. You want a kind of a macro
> robot, which I believe you will have a hard time finding.

?  What's worryingly insecure about that?  Lots of people have wanted
that sort of thing since GUIs were invented.  There are even X
extensions designed to make this easier, like Xtrap and Xrecord and
Xtest.

>> To be restricted to one URL, and one URL alone, strictly...  In
>> essence a robotic click on one part of the screen is all I need.
>> Surely someone else has written one? Yet extensive searches revealed
>> none...

Wrong keywords.  If all you need to do is move the mouse to a specific
point and issue a button 1 up/down event, xmacroplay will do that.  Put
that in a loop with "while true ; do xmacroscript.sh ; sleep 300 ; done"
, bingo.  xmacroscript could contain this:

#!/bin/bash
echo -e "MotionNotify X Y\nButtonPress 1\nButtonRelease 1" | xmacroplay
:0
# end of script

...replace X and Y with the X,Y coords of whatever it is you want to
click.  The main problem is that these coords are absolute, which can
cause a lot of pain unless you always position your Firefox in the same
place.  xmacroplay can also do keypress/key release events, which can be
really handy sometimes.  http://xmacro.sourceforge.net/ .

Note that if you use virtual desktops, you'll have to switch to the
virtual desktop containing your Firefox before doing that xmacroplay.
This is sort of outside the scope of the question, but see the bits
about DCOP and look at the output of "dcop kwin KWinInterface" for some
info on how to do that in KDE.

> At first I thought that what you need is a page refresher with the
> ability to grab page content and aggregate it.

That's not what he asked for, though.

> To actually manoeuvre the mouse and keyboard triggers, perhaps you
> would need some morbid box with a broken kernel. Then again, I might
> be wrong altogether.

Er... Xtest doesn't require any kernel bits at all.  Then again, a
Firefox extension probably can't call external programs.

If you were using Konqueror instead of Firefox, you could probably do it
using DCOP, which may be a bit more elegant.  Sort of like so:

(assumes you have the site loaded in a Konq process called
'konqueror-8173')

dcop konqueror-8173 konqueror-mainwindow#1 reload

...does "refresh" on window #1 of that process.  Firefox is of course
not scriptable with DCOP.  DCOP is a nice idea, but from my fiddling
around with kdcop, many KDE apps don't expose all their functions to the
DCOP interface, which limits its utility.  Ah well, HTH anyway,

-- 
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin /    mail: TRAP + SPAN don't belong
http://www.brainbench.com     /    "He is a rhythmic movement of the
-----------------------------/      penguins, is Tux." --MegaHAL

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index