Results 1 to 5 of 5

Thread: gAjax RSS Feeds Displayer (hosted) ..WORD Filtration?

  1. #1
    Join Date
    Mar 2009
    Posts
    10
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default gAjax RSS Feeds Displayer (hosted) ..WORD Filtration?

    1) Script Title: gAjax RSS Feeds Displayer (hosted)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...sdisplayer.htm

    3) Describe problem: How to remove specific word(fwords) from description?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    In the gfeedfetcher.js file, this line places the text to be displayed in the feed catcher on your page:

    Code:
    this.feedcontainer.innerHTML=rssoutput
    If it's just one word you are concerned with, do:

    Code:
    this.feedcontainer.innerHTML=rssoutput.replace(/badword/gm, '****');
    If you have a bunch of words in mind, make up a variable:

    Code:
    // -------------------------------------------------------------------
    // gAjax RSS Feeds Displayer- By Dynamic Drive, available at: http://www.dynamicdrive.com
    // Created: July 17th, 2007 Updated: n/a
    // -------------------------------------------------------------------
    
    var badwords = new RegExp('(badword1)|(badword2)|(badword3)|(badword4)', 'gm');
    
    var gfeedfetcher_loading_image="indicator.gif" //Full URL to "loading" image. No need to config after this line!!
    Place it at the top of the gfeedfetcher.js file as shown.

    Then make that other line we were talking about look like so:

    Code:
    this.feedcontainer.innerHTML=rssoutput.replace(badwords, '****');
    Just make sure none of your bad words could legitimately be contained inside of other words especially HTML markup. If you have such a word in mind, we can deal with it easily enough, though I can't think of any 'bad' words off of the top of my head that would qualify for special treatment in that regard.
    Last edited by jscheuer1; 03-05-2009 at 05:42 PM. Reason: spelling
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    z2z (03-05-2009)

  4. #3
    Join Date
    Mar 2009
    Posts
    10
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    thanks jscheuer1

  5. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It just occurred to me, that sometimes a bad word might be capitalized, even perhaps in violation of the general rules of capitalizing words, so we should use the i (case insensitive) switch as well. If doing a single word:

    Code:
    this.feedcontainer.innerHTML=rssoutput.replace(/badword/gmi, '****');
    If using the variable RegExp constructor:

    Code:
    var badwords = new RegExp('(badword1)|(badword2)|(badword3)|(badword4)', 'gmi');
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. The Following User Says Thank You to jscheuer1 For This Useful Post:

    z2z (03-13-2009)

  7. #5
    Join Date
    Mar 2009
    Posts
    10
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    thanks mate

    Is possible to add http://www.dynamicdrive.com/dynamici...edcollapse.htm

    like example 4 - 5 -6

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •