Results 1 to 4 of 4

Thread: Display multiple RSS feeds based on a keyword using gAjax RSS v2

  1. #1
    Join Date
    Nov 2012
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Display multiple RSS feeds based on a keyword using gAjax RSS v2

    1) Script Title: gAjax RSS Feeds Displayer v2.0 (hosted)

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

    3) Describe problem:

    Is there a way to display multiple feeds items based on a unique keyword?

    An example for my tennis site; say I would like to create a page displaying only news items about 'John McEnroe'; using multiple RSS feeds. My keyword would be 'mcenroe'.

    Is this possible using gAjax RSS Feeds Displayer v2.0?

    Thank you for any help offered.

  2. #2
    Join Date
    Aug 2004
    Posts
    9,910
    Thanks
    3
    Thanked 969 Times in 957 Posts
    Blog Entries
    15

    Default

    Possibly, though it depends on what you mean exactly. Are you talking about filtering the entries so only ones with a certain keyword in their title or body show up, or do you mean searching and discovering RSS entries to show based on a keyword?
    DD Admin

  3. #3
    Join Date
    Feb 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin View Post
    Possibly, though it depends on what you mean exactly. Are you talking about filtering the entries so only ones with a certain keyword in their title or body show up, or do you mean searching and discovering RSS entries to show based on a keyword?
    Would it be possible to filter and display entries based on category or pubDate?
    Thanks

  4. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    2,025
    Thanks
    16
    Thanked 315 Times in 313 Posts
    Blog Entries
    13

    Default

    PHP5 has a native XML function that allows you to parse XML feeds as HTML, so if your web server run PHP5, you can use this script to filter by pubDate;
    PHP Code:
    $feed_file 'http://www.mywebsite.com/path/to/my-rss-feed.xml'// URL of RSS
    $cache_file 'temp/my-rss-feed.rss'// path to cache file
    $cache_time 3600*24// 24 hours (set to 0 for no cache)
    $date_filter '2013-03-21'// Date filter YYYY-MM-DD

    $timedif = @(time() - filemtime($cache_file)); 
    if (
    file_exists($cache_file) && $timedif $cache_time) {
        
    $string file_get_contents($cache_file);
        } else {
        
    $string file_get_contents($feed_file);
        if (
    $f = @fopen($cache_file'w')) {
            
    fwrite ($f$stringstrlen($string));
            
    fclose($f);
            }
        }
    $xml simplexml_load_string($string);
    foreach (
    $xml->channel->item as $val) {
        
    $date date('Y-m-d'strtotime($val->pubDate));
        if (
    $date == $date_filter) {    
                echo 
    '<p><b>'.$val->title.'</b><br/>'.$val->pubDate.' : '.$val->description.'</p>';
            }
        } 
    (Adapted from http://www.finalwebsites.com/snippets.php?id=49 )
    Last edited by Beverleyh; 03-06-2013 at 06:43 PM. Reason: formatting
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

Similar Threads

  1. Replies: 0
    Last Post: 09-05-2011, 10:18 AM
  2. gAjax RSS Feeds Displayer (multiple pages customization)
    By ddken in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 08-19-2008, 11:52 AM
  3. gAjax RSS Feeds Displayer - can't display multiple feeds
    By nsbrown in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 06-06-2008, 09:40 AM
  4. gAjax RSS Feeds Displayer (multiple feeds)
    By RvdH in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 05-29-2008, 12:46 AM
  5. gAjax RSS Feeds Displayer - display images
    By plimfec in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 11-27-2007, 01:45 PM

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
  •