1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.
  2. Better Analytics for WordPress Get It Free

How to display rss feed in my site?

Discussion in 'XML & RSS' started by PinoyIto, Sep 10, 2005.

  1. #1
    I am just wondering how those site like http://www.topix.net/ display feed from diffirent news site. What kind of script they are using? Is there a free script out there?

    Thanks
     
    PinoyIto, Sep 10, 2005 IP
  2. pcdoc

    pcdoc Active Member

    Messages:
    690
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    70
    #2
    pcdoc, Sep 11, 2005 IP
  3. WhatiFind

    WhatiFind offline

    Messages:
    1,790
    Likes Received:
    257
    Best Answers:
    0
    Trophy Points:
    180
    #3
    WhatiFind, Sep 11, 2005 IP
  4. king_cobra

    king_cobra Peon

    Messages:
    373
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    if u r looking for custom coding in php i can help you. see my website. it uses feeds. but let me not stick to my service advertisement.

    feed parsing can be done by php libraries like magpress. or parsing the file directly through file handling routines (bit tough). you can get it done in no time if u know how to.
     
    king_cobra, Sep 11, 2005 IP
  5. hedir

    hedir Peon

    Messages:
    80
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    hedir, Sep 12, 2005 IP
  6. badhairdude

    badhairdude Peon

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    oh nice, i always wanted to try this, I heard it generates more traffic
     
    badhairdude, Sep 16, 2005 IP
  7. mikelbeck

    mikelbeck Peon

    Messages:
    787
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You can do this with Magpie, pretty simple.

    Here's what you can do - keep in mind this is off the top of my head, there may be a mistake or two in here.

    - Download Magpie from http://magpierss.sourceforge.net, unpack it to a directory off your root called "rss".
    - Create a directory off your root called "cache", chmod it to 777.

    Simple PHP code:

    
    <?php
    require_once('rss/rss_fetch.inc'); 
    
    $news_feed = ''; 
    
    error_reporting(E_ERROR); 
    
    $rss = fetch_rss("http://www.url-of-the-rss-feed.com"); 
    $items = array_slice($rss->items, 0); 
    foreach ($items as $item ) 
    { 
        $news_feed .= '<a href="' . $item['link'] . '" target=_blank>' . $item['title'] . '</a><br />' . $item['summary'] . '<br />'; 
    } 
    ?>
    
    Code (markup):
    Sorry for the crappy code. ;-)

    Your rss data will be formatted and placed in the variable "$news_feed". You can do this multiple times for different feeds.

    Also, since Magpie caches the data, you won't be hammering the feed source every time your page is loaded.

    I use a similar method for getting data from a bunch of sources, a random selection of them are displayed on each page on the bottom of this site: www.TheSEOKing.com. Everything that's in the cache is displayed on this page: www.theseoking.com/news.php
     
    mikelbeck, Sep 17, 2005 IP
  8. eiso

    eiso Peon

    Messages:
    583
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #8
    CarP worked very well for me.
     
    eiso, Sep 18, 2005 IP
  9. yulia

    yulia Peon

    Messages:
    87
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Cool... it works for me..

    Thanks for the script :)
     
    yulia, Sep 23, 2005 IP
  10. jim

    jim Well-Known Member

    Messages:
    815
    Likes Received:
    53
    Best Answers:
    0
    Trophy Points:
    103
    #10
    I tried adding a Google news feed to my site, bu there's some problem with it URL. For example http://www.eslgo.com/travel/ works fine with but when I tried changing the url and putting on my MT 2.64 blog, it no longer worked. (the new url was http://news.google.com/news?hl=en&ned=us&ie=UTF-8&q=car+insurance&output=rss)

    So my question is can someone help me get this Google news rss going on my MT 2.64 blog?

    <?php
    $insideitem = false;
    $tag = "";
    $title = "";
    $description = "";
    $link = "";
    function startElement($parser, $name, $attrs) {
     global $insideitem, $tag, $title, $description, $link;
     if ($insideitem) {
      $tag = $name;
     } elseif ($name == "ITEM") {
      $insideitem = true;
     }
    }
    function endElement($parser, $name) {
     global $insideitem, $tag, $title, $description, $link;
     if ($name == "ITEM") {
      printf("<dt><b><a href='%s'>%s</a></b></dt>",
      trim($link),htmlspecialchars(trim($title)));
      printf("<dt>%s</dt><br><br>",htmlspecialchars(trim($description)));
      $title = "";
      $description = "";
      $link = "";
      $insideitem = false;
     }
    }
    function characterData($parser, $data) {
     global $insideitem, $tag, $title, $description, $link;
     if ($insideitem) {
     switch ($tag) {
      case "TITLE":
      $title .= $data;
      break;
      case "DESCRIPTION":
      $description .= $data;
      break;
      case "LINK":
      $link .= $data;
      break;
     }
     }
    }
    $xml_parser = xml_parser_create();
    xml_set_element_handler($xml_parser, "startElement", "endElement");
    xml_set_character_data_handler($xml_parser, "characterData");
    $fp = fopen("http://news.google.com/news?hl=en&ned=us&ie=UTF-8&q=car+insurance&output=rss","r")
     or die("Error reading RSS data.");
    while ($data = fread($fp, 4096))
     xml_parse($xml_parser, $data, feof($fp))
      or die(sprintf("XML error: %s at line %d",
       xml_error_string(xml_get_error_code($xml_parser)),  
       xml_get_current_line_number($xml_parser)));
    fclose($fp);
    xml_parser_free($xml_parser);
    ?>
    Code (markup):
     
    jim, Nov 27, 2005 IP
  11. jawinn

    jawinn Active Member

    Messages:
    1,024
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    88
    #11
    mambo's software works great for me; but it only supports RSS feeds.
     
    jawinn, Nov 28, 2005 IP
  12. leaseman

    leaseman Greenhorn

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #12
    I just discovered Feed Informer and it works great.
     
    leaseman, Oct 8, 2010 IP
  13. palsman

    palsman Active Member

    Messages:
    156
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    95
    #13
    Feed Informer is very great its work fine
     
    palsman, Dec 11, 2010 IP
  14. akram

    akram Peon

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    akram, Jan 25, 2011 IP
  15. findashish

    findashish Member

    Messages:
    105
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    48
    #15
    Hi buddy! Any idea for showing rss content in a static .html webpage ?
     
    findashish, Feb 3, 2011 IP
  16. sms2547

    sms2547 Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    I recommend this website: http:xml-rss.com
    It's free and extremely easy. News from any web. Paste it on your web page or facebook easily.
     
    sms2547, Jan 7, 2012 IP
  17. mpdevelopers

    mpdevelopers Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #17
    there are lot of rss feed generators...but i did try feed2js. which is good.
    so you can try : feed2js.org
     
    mpdevelopers, Feb 1, 2012 IP
  18. manchun.seo

    manchun.seo Greenhorn

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #18
    create Rss file and upload the file from FTP. or create rss feed in feed burner
     
    manchun.seo, Feb 23, 2012 IP