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

REBOL and Java integration

 [1/3] from: hopeless:eircom at: 31-Aug-2000 14:27


This is a multi-part message in MIME format. ------=_NextPart_000_0105_01C01357.8F2CBC10 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit 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   ------=_NextPart_000_0105_01C01357.8F2CBC10 Content-Type: text/x-vcard; name="Jamie Lawrence.vcf" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Jamie Lawrence.vcf" BEGIN:VCARD VERSION:2.1 N:Lawrence;Jamie FN:Jamie Lawrence ORG:Broadcom Eireann Research;Telecoms Management TITLE:Researcher NOTE:ICQ #48946912 (nickname: hopeless) TEL;WORK;VOICE:+353 1 6046035 TEL;CELL;VOICE:+353 86 8035183 ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;Kestrel House,=0D=0AClanwilliam Place,;Dublin 2;;;Ireland LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Kestrel House,=0D=0AClanwilliam Place,=0D=0ADublin 2=0D=0AIreland URL: URL:http://www.broadcom.ie EMAIL;PREF;INTERNET:[jle--broadcom--ie] REV:20000405T152807Z END:VCARD ------=_NextPart_000_0105_01C01357.8F2CBC10--

 [2/3] 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
<<quoted lines omitted: 9>>
>  >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

 [3/3] from: hopeless:eircom at: 1-Sep-2000 9:17


Ah, now that's quite an elegant solution - don't know why it didn't occur to me before. It'll be about another month before I need this functionality so I'll let you know how it works out and hopefully post some code up here for other (to laugh at!) Thanks, Jamie ;-)

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted