|
Re: Queries of .asp pages with IDL SOCKET command [message #42462 is a reply to message #42450] |
Wed, 09 February 2005 20:49  |
Dick Jackson
Messages: 347 Registered: August 1998
|
Senior Member |
|
|
"Mark Hadfield" <m.hadfield@niwa.co.nz> wrote in message
news:cue8l0$tdq$1@newsreader.mailgate.org...
> Dick Jackson wrote:
>>
>> If this suits you, you can use the URLread function in
>> external/objbridge/java/examples/urlread.pro:
>>
>> IDL>
>> result=urlread(' http://cas.sdss.org/astro/en/tools/search/x_radial.asp?ra=19 5.0&dec=2.5&radius=3&topnum=10&format=html')
>>
>> Yes, this starts up the IDL-Java bridge, so you must have Java installed.
>> And yes, this will work with IDL VM, as long as the Java class is
>> available!
>> Further, this will even work with 'https' secure web pages. Seems to me
>> that Java's got a lot going for it.
>
> Yes, indeed.
>
> Should this be able to work through a proxy server? It seems that for me
> it doesn't, ie I can read a local page OK, but can't read any external
> pages. This despite my having proxies set up correctly (as far as I can
> tell) in the Java Plug-in control panel.
Sorry I can't help with that, I haven't had to work with those. I hope
someone else can chime in...
Cheers,
--
-Dick
Dick Jackson / dick@d-jackson.com
D-Jackson Software Consulting / http://www.d-jackson.com
Calgary, Alberta, Canada / +1-403-242-7398 / Fax: 241-7392
|
|
|
Re: Queries of .asp pages with IDL SOCKET command [message #42467 is a reply to message #42462] |
Wed, 09 February 2005 16:07  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
Dick Jackson wrote:
>
> If this suits you, you can use the URLread function in
> external/objbridge/java/examples/urlread.pro:
>
> IDL>
> result=urlread(' http://cas.sdss.org/astro/en/tools/search/x_radial.asp?ra=19 5.0&dec=2.5&radius=3&topnum=10&format=html')
>
> Yes, this starts up the IDL-Java bridge, so you must have Java installed.
> And yes, this will work with IDL VM, as long as the Java class is available!
> Further, this will even work with 'https' secure web pages. Seems to me that
> Java's got a lot going for it.
Yes, indeed.
Should this be able to work through a proxy server? It seems that for me
it doesn't, ie I can read a local page OK, but can't read any external
pages. This despite my having proxies set up correctly (as far as I can
tell) in the Java Plug-in control panel.
--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
|
|
|
Re: Queries of .asp pages with IDL SOCKET command [message #42468 is a reply to message #42467] |
Wed, 09 February 2005 14:40  |
Dick Jackson
Messages: 347 Registered: August 1998
|
Senior Member |
|
|
Hi Wayne,
"Wayne Landsman" <landsman@sampa.gsfc.nasa.gov> wrote in message
news:cub6pn$559$1@skates.gsfc.nasa.gov...
>
> I often fetch information from Web sites using the IDL SOCKET command, as
> implemented in webget.pro [...]
>
> IDL>
> print,webget(' http://vizier.u-strasbg.fr/cgi-bin/asu-tsv/?-source=gsc2.2&a mp;-c=m33&-c.rm=10')
>
> [...]
>
> However, although active server pages (.asp) have a very similar
> appearance, a query that I successively type into the Web page, e.g.
>
> http://cas.sdss.org/astro/en/tools/search/x_radial.asp?ra=19 5.0&dec=2.5&radius=3&topnum=10&format=html
>
> will give an error message it I send the same string to webget.pro. I am
> hoping that I just need to add some extra formatting command to make this
> work.
If this suits you, you can use the URLread function in
external/objbridge/java/examples/urlread.pro:
IDL>
result=urlread(' http://cas.sdss.org/astro/en/tools/search/x_radial.asp?ra=19 5.0&dec=2.5&radius=3&topnum=10&format=html')
Yes, this starts up the IDL-Java bridge, so you must have Java installed.
And yes, this will work with IDL VM, as long as the Java class is available!
Further, this will even work with 'https' secure web pages. Seems to me that
Java's got a lot going for it.
Cheers,
--
-Dick
Dick Jackson / dick@d-jackson.com
D-Jackson Software Consulting / http://www.d-jackson.com
Calgary, Alberta, Canada / +1-403-242-7398 / Fax: 241-7392
|
|
|
Re: Queries of .asp pages with IDL SOCKET command [message #42485 is a reply to message #42468] |
Tue, 08 February 2005 16:30  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Wayne Landsman <landsman@sampa.gsfc.nasa.gov> writes:
>
> However, although active server pages (.asp) have a very similar
> appearance, a query that I successively type into the Web page, e.g.
>
> http://cas.sdss.org/astro/en/tools/search/x_radial.asp?ra=19 5.0&dec=2.5&radius=3&topnum=10&format=html
>
> will give an error message it I send the same string to webget.pro. I
> am hoping that I just need to add some extra formatting command to
> make this work.
>
> Thanks, --Wayne Landsman
>
Wayne, I was able to download this page with the Unix command line
tool 'curl' with no problem. I'm including the HTTP protocol headers
below in case they help. It looks like there is a cookie set, but I
don't know if that's your problem.
[10]> curl --verbose ' http://cas.sdss.org/astro/en/tools/search/x_radial.asp?ra=19 5.0&dec=2.5&radius=3&topnum=10&format=html'
* About to connect() to cas.sdss.org port 80
* Connected to skyserver2.fnal.gov (131.225.7.125) port 80
> GET /astro/en/tools/search/x_radial.asp?ra=195.0&dec=2.5& ;radius=3&topnum=10&format=html HTTP/1.1
User-Agent: curl/7.11.1 (i386-redhat-linux-gnu) libcurl/7.11.1 OpenSSL/0.9.7a ipv6 zlib/1.2.1.2
Host: cas.sdss.org
Pragma: no-cache
Accept: */*
< HTTP/1.1 200 OK
< Connection: close
< Date: Wed, 09 Feb 2005 00:23:50 GMT
< Server: Microsoft-IIS/6.0
< X-Powered-By: ASP.NET
< Content-Type: text/HTML
< Set-Cookie: ASPSESSIONIDQCDQRBTA=GEPBOCIAIJCPGNBFMIJCDOKD; path=/
< Cache-control: private
<html><head>
<title>SDSS Query Results</title>
</head><body bgcolor=white>
...
Craig
For reference, here is the output of the Vizier query:
[20]> curl --verbose ' http://vizier.u-strasbg.fr/cgi-bin/asu-tsv/?-source=gsc2.2&a mp;-c=m33&-c.rm=10'
* About to connect() to vizier.u-strasbg.fr port 80
* Connected to vizir.u-strasbg.fr (130.79.128.13) port 80
> GET /cgi-bin/asu-tsv/?-source=gsc2.2&-c=m33&-c.rm=10 HTTP/1.1
User-Agent: curl/7.11.1 (i386-redhat-linux-gnu) libcurl/7.11.1 OpenSSL/0.9.7a ipv6 zlib/1.2.1.2
Host: vizier.u-strasbg.fr
Pragma: no-cache
Accept: */*
< HTTP/1.1 200 OK
< Date: Wed, 09 Feb 2005 00:28:23 GMT
< Server: Apache/1.3.27 (Unix)
< Content-Disposition: inline; filename="asu.tsv"
< Transfer-Encoding: chunked
< Content-Type: text/tab-separated-values
#
# VizieR Astronomical Server: http://vizier.u-strasbg.fr 20 ...
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|