[Greasemonkey] eHarmony_showpics -- was: Arrgghh!!! it runs asynch!!!

chris feldmann cfeldmann at gmail.com
Thu Jun 29 02:52:10 EDT 2006


On 6/29/06, Tom Emerson <osnut at pacbell.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> chris feldmann wrote:
> > On 6/28/06, Tom Emerson <osnut at pacbell.net> wrote:
> >> Now that I've scratched my own itch -- who else would like a copy of the
> >> final script?
> >>
> >
> > I would indeed like to see the finished script.
>
> OK, I got two votes to see it -- I've posted it on userscripts:
>
> http://userscripts.org/scripts/source/4364.user.js
>
> have fun!

Great, thanks. The reason I wanted to see it is because I thought from
an earlier post that you might be getting ready to do this:

                   var refText = responseDetails.responseText;
                   var imgURI  =
refText.match(/(http:\/\/photos.eharmony.com[^"]+)/g);
                   var Height  =
refText.match(/http:\/\/photos.eharmony.com\/.+height="([0-9]+)"/)[1];
                   var Width   =
refText.match(/http:\/\/photos.eharmony.com\/.+width="([0-9]+)"/)[1];
                   var id2     = refText.match(/<input type="hidden" nam

There's an easier way. Or maybe there is. Now that the pic is under
your control, why get the dimensions from the originating page? One
might be interested in displaying an image in its actual dimensions,
because having the browser resize it can introduce some unneccessary
artifacts, but in my experience user-supplied pix in sites such as
dating sites are regularly mangled to fit a certain size, and not
necessarily resized server-side. I'd say just set the width and height
to what are convenient to you, within reason, instead of reparsing the
page to get the width and height they coerced it into. That's probably
standard anyway, so just read the source of one example, and use those
numbers.

Tiny speed advantage. Great efficiency and elegance advantage for the
anal such as me.


More information about the Greasemonkey mailing list