Cgi mode vs Console mode.
[1/8] from: reboler::bol::com::br at: 10-Sep-2003 6:54
Hi Folks!,
Is there any chars that I need to remove inside an URL when I'm using inside
a CGI Script?
Because, when I read this url below inside a rebol console, it works well,
but inside a cgi script, rebol doesn't handle it.
site:
{http://www.scirus.com/sciruslink/?src=sd&url=http%3A%2F%2Fwww.sciencedirect
.com%2Fscience%3F_ob%3DGatewayURL%26_origin%3DScienceSearch%26_method%3Dcita
tionSearch%26_piikey%3DS0740818803000070%26_version%3D1%26_returnURL%3Dhttp%
253A%252F%252Fwww.scirus.com%253Ffrm%253Dsimple%2526dssd%253Don%2526hits%253
D10%2526ranking%253D1%2526query_1%253Dmetadata%26md5%3Dffbd076a34f97c62e0195
3e423163802&}
site: to-url replace/all newline ""
read site
Inside Rebol console it works, but using a cgi doesn't.. What's the mistery?
Any tips?
Thanks in advance,
--DJ
[2/8] from: SunandaDH:aol at: 10-Sep-2003 6:18
DJ:
> site: to-url replace/all newline ""
> read site
>
> Inside Rebol console it works, but using a cgi doesn't.. What's the
mistery?
Is it just a typo?
site: to-url replace/all SITE newline ""
Sunanda.
[3/8] from: reboler:bol at: 10-Sep-2003 7:34
Hi Sunanda,
Sorry, I know that I forgot to put the 'site, but it doesn't work in CGI
mode.
site:
{http://www.scirus.com/sciruslink/?src=sd&url=http%3A%2F%2Fwww.sciencedirect
.com%2Fscience%3F_ob%3DGatewayURL%26_origin%3DScienceSearch%26_method%3Dcita
tionSearch%26_piikey%3DS0740818803000070%26_version%3D1%26_returnURL%3Dhttp%
253A%252F%252Fwww.scirus.com%253Ffrm%253Dsimple%2526dssd%253Don%2526hits%253
D10%2526ranking%253D1%2526query_1%253Dmetadata%26md5%3Dffbd076a34f97c62e0195
3e423163802&}
site: to-url replace/all site newline ""
read site
Using the console it works great!, but using CGI mode..it doesn't.
Any tips?
Thanks in advance.
Regards,
--DJ
[4/8] from: AJMartin:orcon at: 10-Sep-2003 23:11
> Using the console it works great!, but using CGI mode..it doesn't.
Is the CGI script run using a Rebol executable that runs on a different
operating system? :)
Andrew J Martin
ICQ: 26227169
http://www.rebol.it/Valley/
http://valley.orcon.net.nz/
http://Valley.150m.com/
[5/8] from: SunandaDH:aol at: 10-Sep-2003 7:27
DJ:
> Sorry, I know that I forgot to put the 'site, but it doesn't work in CGI
> mode
Strange....
It worked as a cgi for me. I did this:
site:
{http://www.scirus.com/sciruslink/?src=sd&url=http%3A%2F%2Fwww.sciencedirect
.com%2Fscience%3F_ob%3DGatewayURL%26_origin%3DScienceSearch%26_method%3Dcita
tionSearch%26_piikey%3DS0740818803000070%26_version%3D1%26_returnURL%3Dhttp%
253A%252F%252Fwww.scirus.com%253Ffrm%253Dsimple%2526dssd%253Don%2526hits%253
D10%2526ranking%253D1%2526query_1%253Dmetadata%26md5%3Dffbd076a34f97c62e0195
3e423163802&}
site: to-url replace/all site newline ""
print "Content-type: text/html^/"
print read site
quit
and the page rendered fine.
Sunanda.
[6/8] from: reboler:bol at: 10-Sep-2003 10:07
Hi Sunanda and Andrew,
I've tried your script Sunanda, it really worked. I'm running this script on
Windows and OpenBSD.
The problem I can realize is to get the url, because I get a relative link
./sciruslink/?...
and I do a rejoin ["http://www.scirus.com" url]
I receive a message like that:
Title: Information technology courses and their relationship to faculty in
different professional ranks in library and...
Author(s):Xu, H.
Date: Library and Information Science Research, Jul 2003
Abstract: ...hypertext mark-up language/extensible nark-up language),
metadata systems, digital preservation, design and production of
multimedia...Indiana University, and University of Missouri-Columbia),
metadata systems (e.g., University of Washington and University of North...
Url:
http://www.scirus.com/sciruslink/?src=sd&url=http%3A%2F%2Fwww.sciencedirect.
com%2Fscience%3F_ob%3DGatewayURL%26_origin%3DScienceSearch%26_method%3Dcitat
ionSearch%26_piikey%3DS0740818803000070%26_version%3D1%26_returnURL%3Dhttp%2
53A%252F%252Fwww.scirus.com%253Ffrm%253Dsimple%2526dssd%253Don%2526hits%253D
10%2526ranking%253D1%2526query_1%253Dmetadata%26md5%3Dffbd076a34f97c62e01953
e423163802
Source: Elsevier - ScienceDirect
URL LINK After
rejoin:http://www.scirus.com/sciruslink/?src=sd&url=http%3A%2F%2Fwww.science
direct.com%2Fscience%3F_ob%3DGatewayURL%26_origin%3DScienceSearch%26_method%
3DcitationSearch%26_piikey%3DS0740818803000070%26_version%3D1%26_returnURL%3
Dhttp%253A%252F%252Fwww.scirus.com%253Ffrm%253Dsimple%2526dssd%253Don%2526hi
ts%253D10%2526ranking%253D1%2526query_1%253Dmetadata%26md5%3Dffbd076a34f97c6
2e01953e423163802 ** User Error: Error. Target url:
http://www.scirus.com/science?_ob=ArticleURL&_udi=B6W5R-48PD10V-6&_coverDate
%2F30%2F2003&_alid=112366827&_rdoc=1&_fmt=&_orig=search&_qd=1&_cdi=6577&_
sort=d&view=c&_acct=C000050221&_version=1&_urlVersion=0&_userid=10&md5=132c1
bb1ab04c67483ed85a4b2729f5f could not be retrieved. Server response:
HTTP/1.1 404 Not Found ** Near: print read urllink
Passing the final url, it renders real fine. There is a problem with control
chars I think because the url after the rejoin if you query in IE renders
fine.
Any tips?
Thanks in advance,
--DJ
[7/8] from: SunandaDH:aol at: 10-Sep-2003 11:02
DJ:
> Any tips?
Maybe something to do with the rejoin. This works for me, and I think it
parallels the situation you have:
site: "http://www.scirus.com"
url: {/sciruslink/?src=sd&url=http%3A%2F%2Fwww.sciencedirect
.com%2Fscience%3F_ob%3DGatewayURL%26_origin%3DScienceSearch%26_method%3Dcita
tionSearch%26_piikey%3DS0740818803000070%26_version%3D1%26_returnURL%3Dhttp%
253A%252F%252Fwww.scirus.com%253Ffrm%253Dsimple%2526dssd%253Don%2526hits%253
D10%2526ranking%253D1%2526query_1%253Dmetadata%26md5%3Dffbd076a34f97c62e0195
3e423163802&}
full-address: to-url replace/all copy join site url newline ""
print "Content-type: text/html^/"
print read full-address
Note that I've kept site and url as strings until after the replace.
Sunanda.
[8/8] from: antonr:iinet:au at: 11-Sep-2003 1:26
I think you still need to remove newlines after your rejoin.
I tried it and got sensible data back.
IE probably strips out the newline characters automatically
when you paste it into the address bar.
Anton.