Re: grep twice or a better way....

This WebDNA talk-list message is from

2007


It keeps the original formatting.
numero = 69477
interpreted = N
texte = This will work, but if someone creates a small list or adds other small paragraph type formating at the beginning of their blog removing all the html causes some weird looking summaries. I'll probably go with this kinda scenario and advise users to NOT embed a video at the beginning of their blog..... Seems like the easiest way to deal with it. Probably me over thinking how they'll be adding things to a blog I guess. Everytime I think I cover all possible weird occurences they do something that I never ever thought anyone would do LOL thanks for the input.... --- Olin Lagon wrote: > You could remove the html ONLY from cases that > include the youtube code. > Something like > > [if "[url][blogtext][/url]"^"[url] [then] > [getchars start=1&end=150] > [removeHTML][blogtext][/removeHTML] > [/getchars] > [/then] > [else] > [getchars start=1&end=150][grep > ...][blogtext][/grep][/getchars] > [/else] > [/if] > > -----Original Message----- > From: WebDNA Talk > [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf > Of > Lester > Sent: Sunday, November 11, 2007 3:36 PM > To: WebDNA Talk > Subject: Re: grep twice or a better way.... > > hmmmmm. > I'll see if that works in a bit... > so simple it just might LOL > > Except in some cases people use some additional > formating, which hasn't been > a problem in the summaries, but the images/videos > always would be... so > removing everything may be too much. But it's a way > I never thought of.... > > lester > > > > > > --- Dan Strong wrote: > > > maybe > > > > [getchars start=1&end=150] > > [removeHTML][blogtext][/removeHTML] > > [/getchars] > > > > ? > > > > > > On Sun, 11 Nov 2007 10:56:20 -0800 (PST) > > Lester wrote: > > > I have a page where short summaries of posted > > articles > > > are shown. > > > > > > Currently some folks embed youtube videos as the > > first > > > item in their posts. > > > > > > They were doing this with images, but that I was > > able > > > to deal with. > > > > > > images: > > > I use the following grep within my code to strip > > out > > > any instance of having an image appear in this > summary..... > > > > > > [getchars start=1&end=150][grep > > > > > > search=]*)&replace=][blogtext][/grep][/getchars] > > > > > > > > > embed a video: > > > If they did embed a youtube video (via tinymce > > editor) > > > this would be an example of the code I'm trying > to strip out of > > > these summary pages: > > > > > > > > > > > classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" > > > > > > codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca > b#version=6,0,40,0" > > > width="425" height="355"> > > value="425" /> > > /> > > > > > value="http://www.youtube.com/v/4NoQwyqDyXI&rel=1" > > > /> > > width="425" height="355" > > > > > > src="http://www.youtube.com/v/4NoQwyqDyXI&rel=1"> > > > > > > > > > > > > Since I'm pulling just the first 150 characters > > for > > > the summary I'm having grief even if I try this: > > > > > > [getchars start=1&end=150][grep > > > > > > search=]*)>&replace=][blogtext][/grep][/getchars] > > > > > > The above code does enough to NOT show the video > > in > > > the summary pages, buts it leaves remnants of > the entire embed > > > string. > > > > > > > > > > > > Any other ways I could maybe strip out all image > > or > > > embed code as I pull the text for these summary > > pages? > > > > > > > > > thanks > > > > > > > > > Lester > > > > > > > > > > __________________________________________________ > > > Do You Yahoo!? > > > Tired of spam? Yahoo! Mail has the best spam > > protection around > > > http://mail.yahoo.com > > > > > > > > > ------------------------------------------------------------- > > > This message is sent to you because you are > > subscribed to > > > the mailing list > > . > > > To unsubscribe, E-mail to: > > > > > To switch to the DIGEST mode, E-mail to > > > > > Web Archive of this list is at: > > http://webdna.smithmicro.com/ > > > > > > > ------------------------------------------------------------- > > This message is sent to you because you are > subscribed to > > the mailing list > > . > > To unsubscribe, E-mail to: > > > > To switch to the DIGEST mode, E-mail to > > > > Web Archive of this list is at: > > http://webdna.smithmicro.com/ > > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com > > ------------------------------------------------------------- > This message is sent to you because you are > subscribed to > the mailing list > . > To unsubscribe, E-mail to: > > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: > http://webdna.smithmicro.com/ > > > ------------------------------------------------------------- > This message is sent to you because you are > subscribed to > the mailing list > . > To unsubscribe, E-mail to: > > To switch to the DIGEST mode, E-mail to > > === message truncated === ____________________________________________________________________________________ Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. http://overview.mail.yahoo.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: grep twice or a better way.... ( Donovan Brooke 2007)
  2. Re: grep twice or a better way.... ( Lester 2007)
  3. Re: grep twice or a better way.... ( "Olin Lagon" 2007)
  4. Re: grep twice or a better way.... ( Lester 2007)
  5. Re: grep twice or a better way.... ( "Dan Strong" 2007)
  6. grep twice or a better way.... ( Lester 2007)
This will work, but if someone creates a small list or adds other small paragraph type formating at the beginning of their blog removing all the html causes some weird looking summaries. I'll probably go with this kinda scenario and advise users to NOT embed a video at the beginning of their blog..... Seems like the easiest way to deal with it. Probably me over thinking how they'll be adding things to a blog I guess. Everytime I think I cover all possible weird occurences they do something that I never ever thought anyone would do LOL thanks for the input.... --- Olin Lagon wrote: > You could remove the html ONLY from cases that > include the youtube code. > Something like > > [if "[url][blogtext][/url]"^"[url] [then] > [getchars start=1&end=150] > [removehtml][blogtext][/removeHTML] > [/getchars] > [/then] > [else] > [getchars start=1&end=150][grep > ...][blogtext][/grep][/getchars] > [/else] > [/if] > > -----Original Message----- > From: WebDNA Talk > [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf > Of > Lester > Sent: Sunday, November 11, 2007 3:36 PM > To: WebDNA Talk > Subject: Re: grep twice or a better way.... > > hmmmmm. > I'll see if that works in a bit... > so simple it just might LOL > > Except in some cases people use some additional > formating, which hasn't been > a problem in the summaries, but the images/videos > always would be... so > removing everything may be too much. But it's a way > I never thought of.... > > lester > > > > > > --- Dan Strong wrote: > > > maybe > > > > [getchars start=1&end=150] > > [removehtml][blogtext][/removeHTML] > > [/getchars] > > > > ? > > > > > > On Sun, 11 Nov 2007 10:56:20 -0800 (PST) > > Lester wrote: > > > I have a page where short summaries of posted > > articles > > > are shown. > > > > > > Currently some folks embed youtube videos as the > > first > > > item in their posts. > > > > > > They were doing this with images, but that I was > > able > > > to deal with. > > > > > > images: > > > I use the following grep within my code to strip > > out > > > any instance of having an image appear in this > summary..... > > > > > > [getchars start=1&end=150][grep > > > > > > search=]*)&replace=][blogtext][/grep][/getchars] > > > > > > > > > embed a video: > > > If they did embed a youtube video (via tinymce > > editor) > > > this would be an example of the code I'm trying > to strip out of > > > these summary pages: > > > > > > > > > > > classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" > > > > > > codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca > b#version=6,0,40,0" > > > width="425" height="355"> > > value="425" /> > > /> > > > > > value="http://www.youtube.com/v/4NoQwyqDyXI&rel=1" > > > /> > > width="425" height="355" > > > > > > src="http://www.youtube.com/v/4NoQwyqDyXI&rel=1"> > > > > > > > > > > > > Since I'm pulling just the first 150 characters > > for > > > the summary I'm having grief even if I try this: > > > > > > [getchars start=1&end=150][grep > > > > > > search=]*)>&replace=][blogtext][/grep][/getchars] > > > > > > The above code does enough to NOT show the video > > in > > > the summary pages, buts it leaves remnants of > the entire embed > > > string. > > > > > > > > > > > > Any other ways I could maybe strip out all image > > or > > > embed code as I pull the text for these summary > > pages? > > > > > > > > > thanks > > > > > > > > > Lester > > > > > > > > > > __________________________________________________ > > > Do You Yahoo!? > > > Tired of spam? Yahoo! Mail has the best spam > > protection around > > > http://mail.yahoo.com > > > > > > > > > ------------------------------------------------------------- > > > This message is sent to you because you are > > subscribed to > > > the mailing list > > . > > > To unsubscribe, E-mail to: > > > > > To switch to the DIGEST mode, E-mail to > > > > > Web Archive of this list is at: > > http://webdna.smithmicro.com/ > > > > > > > ------------------------------------------------------------- > > This message is sent to you because you are > subscribed to > > the mailing list > > . > > To unsubscribe, E-mail to: > > > > To switch to the DIGEST mode, E-mail to > > > > Web Archive of this list is at: > > http://webdna.smithmicro.com/ > > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com > > ------------------------------------------------------------- > This message is sent to you because you are > subscribed to > the mailing list > . > To unsubscribe, E-mail to: > > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: > http://webdna.smithmicro.com/ > > > ------------------------------------------------------------- > This message is sent to you because you are > subscribed to > the mailing list > . > To unsubscribe, E-mail to: > > To switch to the DIGEST mode, E-mail to > > === message truncated === ____________________________________________________________________________________ Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. http://overview.mail.yahoo.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Lester

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

The Archives? (1999) [WebDNA] Nginx (2010) Just a thought (1998) Mac: LModelDirector bug fix (1997) OSX Webcatalog Install (2001) BGcolor (1997) WCS Newbie question (1997) 2.1 Stuff (1998) tax rate off by 1 cent (1997) can webcat determine an image's pixel dimensions? (2000) [getchars] questions (1997) rotating thumbnails (1997) WebCat2b15MacPlugin - showing [math] (1997) syntax question, not in online refernce (1997) Unable to append (2001) Google Charts (2008) Problem with [CART] number (1998) Progress !! WAS: Trouble with formula.db (1997) Authenticate (2000) [Fwd: Rotating Banners ... (was LinkExchange)] (1997)