[Greasemonkey] Examing http response codes
Matt Katz
snarkhunt at gmail.com
Mon Dec 19 23:22:47 EST 2005
I think this all shows that sometimes it pays to be less tricky.
GM_xmlhttprequest is too high level for this. It automatically forwards on
through to the new url and just returns data from my blog.
But I contacted the guys over at tinyurl.com and they clued me in to an
easier way.
From: Kevin Gilbertson
> Date: Dec 19, 2005 10:15 PM
> Subject: Re: beyond just preview
> To: Matt Katz
>
> This URL shows it: http://tinyurl.com/preview.php?num=7r54z
>
> Probably not perfect for applications as we may change the format, but
> it will do until we get something else up.
>
> - Gilby
> TinyURL.com
>
So I'm going to just parse that page. If there is some hack to catch the
actual 302 interrogation, I'd love to hear it. That's likely to be more
dependable than page parsing. On the other hand, if it takes any work on
the part of the gm developers, it's probably not worth it. Keeping
gm_xmlhttprequest simple is probably more important.
Thanks for the help!
On 12/19/05, Bill Donnelly <donnelly at snowcrest.net> wrote:
>
> Using http://web-sniffer.net/ for http://tinyurl.com/7r54z
> I'm guessing below is what you want back.
>
> If tinyurl never changes, maybe you could just bypass it
> and build your own URL:
>
> http://forwarding.tinyurl.com/redirect.php?num=7r54z
>
> ----------------------------------------
>
> HTTP Request Header
>
> Connect to 216.234.186.14 on port 80 ... ok
>
> GET /7r54z HTTP/1.1[CRLF]
>
> Host: tinyurl.com[CRLF]
> Connection: close[CRLF]
> Accept-Encoding: gzip[CRLF]
> Accept: text/xml,application/xml,application/xhtml+xml,
>
> text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5[CRLF]
> Accept-Language: en-us,en;q=0.5[CRLF]
> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7[CRLF]
> User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US;
> rv:1.8) Gecko/20051111 Firefox/1.5
> Web-Sniffer/1.0.23[CRLF]
> Referer: http://web-sniffer.net/[CRLF]
> [CRLF]
>
> HTTP Response Header
>
> Name Value & Delim
> ------------------
> ------------------------------------------------------------
> HTTP Status Code: HTTP/1.1 302 Found
> Date: Tue, 20 Dec 2005 02:38:17 GMT CRLF
> Server: Apache/1.3.29 (Unix) PHP/4.3.4 mod_perl/1.29
> mod_auth_pam/
> 1.1.1 mod_ssl/2.8.16 OpenSSL/0.9.6l CRLF
> Location:
> http://forwarding.tinyurl.com/redirect.php?num=7r54z CRLF
> Connection: close CRLF
> Transfer-Encoding: chunked CRLF
> Content-Type: text/html; charset=iso-8859-1 CRLF
>
> Content (0.23 KiB)
>
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> <HTML><HEAD>
> <TITLE>302 Found</TITLE>
> </HEAD><BODY>
> <H1>Found</H1>
> The document has moved
> <A HREF="http://forwarding.tinyurl.com/redirect.php?num=7r54z">
> here</A>.<P>
> </BODY></HTML>
>
> -----------------
>
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>
--
My blog is exciting and fast paced like today's world!
http://snarkhunt.blogspot.com
More information about the Greasemonkey
mailing list