Rebol [
  Author: "Gordon Raboud"
  File: %hide-email-addresses.r
  Date: 3-June-2005
  Title: "Hide E-Mail Addresses by using Javascript"
  Purpose: {This will take a web page and find all the "mailto:aaa@bbb" and
             convert the addresses to variables for use in Javascript.  This
             effectively 'hides' the addressess from webbot e-mail address
             harvesters.
             Note: This script expects the opening tag ()
             and the closing tag () to be on one or at most two lines. }
  Library: [
    Level: 'beginner
    Platform: [all]
    Type: [tool]
    Domain: 'text
    Tested-under: 'W2K
    Support: none
    License: none
  ]
  Version: 1.0
]

QtStr: to-char 34
SearchStr: join ""
      If not CloseTag [
         WebPageText: next WebPageText
         SearchLine: join SearchLine [first WebPageText]
      ]
      SearchLine: join SearchLine ["~~~~"]
      parse/all SearchLine [copy IndentStr some " " copy FirstPart to SearchStr SearchStr copy MTName
         to "@" "@" copy MTDomain to "." "." copy MTExt to QtStr thru ">"
         copy VisibleName to "" "" copy LastPart to "~~~~"
      ]
      FirstPart: join IndentStr [FirstPart]
      Write/append/lines OutFile FirstPart
      print join MTName ["@" MTDomain "." MTExt " - " VisibleName]
      NewMailTo: join IndentStr [""
         ]
      Write/append OutFile NewMailTo
      Write/append/lines OutFile LastPart
   ]
   [
      Write/append/lines OutFile SearchLine
   ]
]