Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] REBOL and Java integration Re:

From: rebol::techscribe::com at: 31-Aug-2000 16:42

Hi Jamie, an option would be to use Java's socket (under MS Windows Winsock) functions and connect to a function server written in REBOL (which could be as small as four or five lines of code). Send a character sequence consisting of the REBOL functions you want to invoke including filenames or urls you want them invoked on, and then have REBOL do the resulting string. I.e. if 1. Java sends REBOL the character sequence parse-webpage/get-title read http://www.rebol.com/ 2. the function parse-webpage is defined in REBOL as
>> source parse-webpage
parse-webpage: func [string /get-title][ if get-title [ parse string [ thru <title> copy title to </title> (page-title: title)] ] ] return title ] 3. the REBOL server uses do to evaluate this incoming string
>> result: do submitted-script
4. and returns the result using a REBOL port, 5. then your Java app will get a character sequence consisting of {REBOL Technologies: Internet Platform for Business Relationship Management} REBOL becomes kind of a background script evaluator. Hope this helps. At 02:27 PM 8/31/00 +0100, you wrote:
>I'm a REBOL newbie so forgive me for breaking any unwritten rules. > >For me, REBOL has massive advantages over any other language particularly >for web-mining tasks such as scaping information out of web pages. The >trouble is I need this information in Java not REBOL (massive existing >source base etc). > >So my question is, how do I allow Java to make use of REBOL scripts to >retrieve information, perform tasks etc? Ideally it would be more than >simply invoking the REBOL interpreter with a pre-written script and dumping >the information into a file, although this does have possibilities. > >Any ideas, projects in the pipeline? > > Jamie > >  > >Attachment Converted: "c:\eudora\attach\Jamie Lawrence.vcf" >
;- Elan [ : - ) ] author of REBOL: THE OFFICIAL GUIDE REBOL Press: The Official Source for REBOL Books http://www.REBOLpress.com visit me at http://www.TechScribe.com