[REBOL] Changing relative paths to absolute ones.
Hello. I have been monitoring the progress of REBOL since its first release but only now I will start to use it to do something usefull. I created a simple script to read a web page and to send it to an email address (send user@host read http://www.server). The problem is that there are lots of relative references in this page (IMG SRC="/somedir/file.gif") and I need to change all of these references to an absolute path (IMG SRC="http://www.server/ somedir/file.gif"). I think the problem would be solved if I search for all =" and change it to ="http://www.server . How can I do that? Note that I didn't even understood the REBOL syntax yet. :) Thanks. -Bruno
[REBOL] Changing relative paths to absolute ones. Re:
parse page: read http://www.server [ some [thru "SRC=^"" here: (insert here "http://www.server")] to end ] ; not tested -z --- [EMAIL PROTECTED] wrote: Hello. I have been monitoring the progress of REBOL since its first release but only now I will start to use it to do something usefull. I created a simple script to read a web page and to send it to an email address (send user@host read http://www.server). The problem is that there are lots of relative references in this page (IMG SRC="/somedir/file.gif") and I need to change all of these references to an absolute path (IMG SRC="http://www.server/ somedir/file.gif"). I think the problem would be solved if I search for all =" and change it to ="http://www.server . How can I do that? Note that I didn't even understood the REBOL syntax yet. :) Thanks. -Bruno __ Do You Yahoo!? Send instant messages get email alerts with Yahoo! Messenger. http://im.yahoo.com/
[REBOL] Changing relative paths to absolute ones. Re:
The absolute path to your Web directory does not involve the http url. For example, the path to an item in your Web directory may SEEM to be... http://www.domain.dom/item.jpg ...when in fact the real path may be something like... /boot/home/web/domain/item.jpg If you are using a Web hosting service, ask them what the absolute path is to your Web directory. -Ryan Hello. I have been monitoring the progress of REBOL since its first release but only now I will start to use it to do something usefull. I created a simple script to read a web page and to send it to an email address (send user@host read http://www.server). The problem is that there are lots of relative references in this page (IMG SRC="/somedir/file.gif") and I need to change all of these references to an absolute path (IMG SRC="http://www.server/ somedir/file.gif"). I think the problem would be solved if I search for all =" and change it to ="http://www.server . How can I do that? Note that I didn't even understood the REBOL syntax yet. :) Thanks. -Bruno
[REBOL] Changing relative paths to absolute ones. Re:(2)
Em Thursday, July 06 2000, 17:39:01, ([EMAIL PROTECTED]) disse: parse page: read http://www.server [ some [thru "SRC=^"" here: (insert here "http://www.server")] to end ] Thanks for your answer. I tried that and it didn't seem to work, but I'm not even sure if i did the right thing. Here is how my script looks like: REBOL [ Title: "Page Sender" ] header: make system/standard/email [ To: [EMAIL PROTECTED] From: [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Subject: "Teste do NO. via REBOL!" Organization: "Just a Test" X-mailer: [REBOL] MIME-Version: 1.0 Content-Type: "text/html" ] parsepage: read http://www.no.com.br/servlets/ newstorm.notitia.apresentacao.ServletDeSecao [ some [ thru "src=^"" here: (insert here "http://www.no.com.br") ] to end ] send/header [EMAIL PROTECTED] parsepage header Is it correct? -Bruno
[REBOL] Changing relative paths to absolute ones. Re:(2)
Em Thursday, July 06 2000, 17:40:16, ([EMAIL PROTECTED]) disse: The absolute path to your Web directory does not involve the http url. For example, the path to an item in your Web directory may SEEM to be... http://www.domain.dom/item.jpg Note that I'm fetching the page with read http://www.server so all I got is the HTML file. In this file, paths to images are relative, and as I'm sending this page to another people, I have to make than absolute (prefixing http:// www.server to the path). ...when in fact the real path may be something like... /boot/home/web/domain/item.jpg Using BeOS too? ;) If you are using a Web hosting service, ask them what the absolute path is to your Web directory. I am the web hosting server. :) I'm using a ServLet that only generates relative references, so it would be easier to do the conversion in the REBOl script than in the Servlet itself. Thanks anyway. -Bruno
[REBOL] Changing relative paths to absolute ones. Re:(3)
Note that I'm fetching the page with read http://www.server so all I got is the HTML file. In this file, paths to images are relative, and as I'm sending this page to another people, I have to make than absolute (prefixing http:// www.server to the path). Sorry, I responded too quickly. Shortly after I responded I realized what you were really asking. /boot/home/web/domain/item.jpg Using BeOS too? ;) But, of course. 8-)