Author: pat665 Date: 27-juin-2004
2. 4003-Reading email with POP3
3. 4004-How to get the domain of an url
6. 4002-Drudgereport news one-liner
This is a collection of "good-to-know" information about Rebol in regard to Internet programming. Some are mine, most are from the Rebol-List, books or articles about Rebol.
How do I read a POP account if an "@" is a part of the username like this ?
>username: carlos@revistaeletronica.com.br >pass: "password" >server: mail.revistaeletronica.com.br
I cannot do the following :
>>read pop://carlos@revistaeletrica:password@mail.revistaeletronica.com.br
ANSWER
mailbox: [ scheme: 'pop host: " mail.revistaeletronica.com.br " user: "carlos/revistaeletrica" pass: "password" ] messages: read mailbox
The way you set up user may depend on your service provider, uncertain.
How to get the domain of an url?
ANSWER
finally I will use 'parse to get the domain URL.
>> u: http://www.rebol.net/cookbook/index.html >> parse u [thru "http://" to "/" stop: to end (print copy/part u (index? stop) - 1 )] http://www.rebol.net == true
I need a way of getting the REFERER of a URL in my CGI. Any help?
ANSWER
referer: select system/options/cgi/other-headers "HTTP_REFERER"
Note: use (in a test CGI)
print replace/all mold system/options/cgi newline
to see all the header fields,
How to browse an HTML file?
ANSWER
set-browser-path %explorer.exe browse %index.html
foreach x remove-each x load/markup http://drudgereport.com [ any [ tag? x not find x "..." find x "drudge"] ][ print x ]
or
print remove-each x load/markup http://drudgereport.com [ any [tag? x not find x "..." find x "drudge"] ]
Document generated with Rebol.
Original code from Carl Sassenrat modified by pat665,
REBOL and the REBOL logo are trademarks of REBOL Technologies.