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

[REBOL] Re: looking for a function...

From: bo:rebol at: 10-Nov-2000 10:57

Bit by our own list...here it is in plain text! -Bo --Striptags-- REBOL [ Title: "HTML Tag Stripper" Date: 20-Jul-1999 Author: "Bohdan Lechnowsky" Email: [bo--rebol--com] Purpose: { To strip off HTML tags leaving only text behind } ] striptags: func [page /local text end] [ multi-replace: func [ {Replaces multiple items in a file} pg [series!] {The series to replace items in} blk [block!] {A block of search and replace elements} ][foreach [srch rplc] blk [replace/all pg srch rplc]] ;table of tags and more suitable ASCII characters page: multi-replace trim/lines page [ "<TITLE>" "TITLE: " "</TITLE>" " " " " "<TD>" " | " "</TD>" " | " " | | " " | " "<TR>" " " "</TR>" " <TABLE" " <" "</TABLE>" " <P>" " <LI>" " " "<BR>" " &nbsp;" " " ">" ">" "<" "<" "&copy;" "(c)" "&amp;" "&" "&quot;" {"} "</H1>" " </H2>" " </H3>" " </H4>" " </H5>" " </H6>" " <HR" " ---------- <" ] text: copy "" append page "<" append text copy/part page find page "<" while [page: find/tail page ">"] [ if (first page) <> #"<" [ if found? end: find page "<" [ append text copy/part page end ] ] ] return append text " ] --End Striptags-- On 10-Nov-2000/10:19:20-7:00, [bo--rebol--com] wrote:
>Graham, > >Here is one I hacked together over a year ago. It tries to keep some of >the formatting features of the HTML, but only on a very basic level. > >EXAMPLE USAGE: > text: striptags read http://www.rebol.com > >Have fun! > >-Bo > >On 9-Nov-2000/21:23:39, [rishi--picostar--com] wrote: >>someone told me next quarter...but I think he was joking! BTW, next assignment is up... >> >>rishi >> >>Previously, you (Graham Chiu) wrote: >>> Has anyone got a function that strips out all the html from >>> a page leaving just the text behind? >>> >>> -- >>> Graham Chiu >>> -- >>> To unsubscribe from this list, please send an email to >>> [rebol-request--rebol--com] with
unsubscribe" in the
>>> subject, without the quotes. >>> >>> >> >>-- >>To unsubscribe from this list, please send an email to >>[rebol-request--rebol--com] with "unsubscribe" in the >>subject, without the quotes. >> >-- > Bohdan "Bo" Lechnowsky > REBOL Adventure Guide > REBOL Technologies 707-467-8000 (http://www.rebol.com) > The Official Source for REBOL Books (http://www.REBOLpress.com) > >-- Binary/unsupported file stripped by Listar -- >-- Type: application/octet-stream >-- File: striptags.r > >-- >To unsubscribe from this list, please send an email to >[rebol-request--rebol--com] with "unsubscribe" in the >subject, without the quotes. >
-- Bohdan "Bo" Lechnowsky REBOL Adventure Guide REBOL Technologies 707-467-8000 (http://www.rebol.com) The Official Source for REBOL Books (http://www.REBOLpress.com)