REBOL.org and directly doable scripts?
[1/2] from: petr:krenzelok:trz:cz at: 19-Mar-2007 9:36
Hi,
couldn't there be a shortcut to be able to directly copy the script link
from email and run it in rebol console? Viewable version is fine, as is
downloadable, but that is few extra steps. I thought REBOL scripts are
embeddable into html pages, but I can't run any of my last tries. The
last rebol.org automat posted script link e.g. contains escaped <, >
characters. Does it need to be escaped? I mean - maybe we could put
script once again into the page, to be runnable, into some comment
section where >< chars will not make problems? Or maybe we could
introduce fourt link in addition to View, Download, Run, called Source,
and put plain text version there?
Just a suggestion :-)
Petr
[2/2] from: dhsunanda::gmail::com at: 19-Mar-2007 9:27
Petr
> couldn't there be a shortcut to be able to directly copy the script link
> from email and run it in rebol console? Viewable version is fine, as is
> downloadable, but that is few extra steps.
There *could* be, but there isn't as yet. You could use this function
(or extend it to do lots of useful things). It assumes you have copied
the target URL from the REBOL.org notification email onto the clipboard.
do-ro-script: func [
/local
target
][
target: to-url read clipboard://
replace target "view-script.r?script=" "download-a-script.r?script-name="
do read target
]
> I thought REBOL scripts are
> embeddable into html pages, but I can't run any of my last tries.
That is supposed to work, but doesn't for all scripts. Part of the
reason is that view-scripts.r escapes angle bracket characters....
> The
> last rebol.org automat posted script link e.g. contains escaped <, >
> characters. Does it need to be escaped?
....Sadly, yes. Two reasons:
1. some bad guys could upload REBOL scrips that contain (say) Javascript
that attempts an XSS (cross system scripting) attack on your browser.
2. a script could legitimately contain HTML elements that would be
interpreted by a browser; that could mess up the display of the script.
Sunanda.