Results 1 to 13 of 13
  1. #1
    Join Date
    Dec 2004
    Location
    United Arab Emirates
    Posts
    113

    RSS Feeds HOW-TO??

    Hello,

    Can anyone explain to me how RSS feeds such as these http://www.caip.rutgers.edu/~taher/dbnet-rss.xml can be generated?? The original website mumineen.org doesnt provide such feeds and these are generated externally. I would be grateful if anyone can help.

    PS. I am a novice on this.
    [URL=http://www.ekhwan.com/]Ekhwan Web Solutions - Brotherhood Beyond Boundries.
    Affordable online solutions and applications for your business.

  2. #2
    Join Date
    Mar 2004
    Location
    USA
    Posts
    4,345

    Arrow

    Quote Originally Posted by Ekhwan
    Hello,

    Can anyone explain to me how RSS feeds such as these http://www.caip.rutgers.edu/~taher/dbnet-rss.xml can be generated?? The original website mumineen.org doesnt provide such feeds and these are generated externally. I would be grateful if anyone can help.

    PS. I am a novice on this.
    At first, I just copied google's style of xml (since I wanted it for a news website) and just implemented it...

    a day ago, I read that you have to have xml combiled with PHP and then use its library to generate it, I didnt go through that..

    I just outputed the XML header and just the text...

    Peace,
    Testing 1.. Testing 1..2.. Testing 1..2..3...

  3. #3
    Join Date
    Nov 2005
    Location
    Maidstone, Kent
    Posts
    94
    header u want to output is:
    header('Content-type: text/xml');

    Then just use php to output the xml code
    TME Solutions - eCommerce Web Designers - Visit our Web Design Portfolio

  4. #4
    Join Date
    Dec 2004
    Location
    United Arab Emirates
    Posts
    113
    As I said I am a novice, please explain how to fetch rss feeds or xml feeds from this site http://mumineen.org so that I can display it on my own domain same as here http://www.caip.rutgers.edu/~taher/dbnet-rss.xml

    I cannot understand your response kindly explain.

    Thanks a lot.
    [URL=http://www.ekhwan.com/]Ekhwan Web Solutions - Brotherhood Beyond Boundries.
    Affordable online solutions and applications for your business.

  5. #5
    Join Date
    Nov 2005
    Location
    Maidstone, Kent
    Posts
    94
    To read an RSS feed I would suggest getting the PEAR class XML_RSS http://pear.php.net/package/XML_RSS/redirected
    TME Solutions - eCommerce Web Designers - Visit our Web Design Portfolio

  6. #6
    Join Date
    Jan 2006
    Posts
    34
    I also want to know RSS, do you have some tutorials about it?

  7. #7
    Join Date
    Dec 2004
    Location
    United Arab Emirates
    Posts
    113
    I guess you are not getting my question. I do not want to know about or need an RSS reader or parser. Rather I want to know how to create RSS feeds that can be rendered in a RSS reader.

    Here is the xml file I want to create or publish an RSS feed for. http://akhbar.mumineen.org/headlines.xml
    [URL=http://www.ekhwan.com/]Ekhwan Web Solutions - Brotherhood Beyond Boundries.
    Affordable online solutions and applications for your business.

  8. #8

    Outputting an RSS Feed

    To do this, you must first fetch the source XML file and capture its contents into a variable. You can do this by using the fopen() function. Once you have the contents of the XML file, you need to output the contents in the RSS feed format. To do this, you can either transform the XML file using XSLT, or you can parse the source XML using the DOM XML functions and output the resulting data structure in RSS format. As said earlier, you will also need to send the appropriate header using the header function:

    <? header('Content-type: text/xml') ?>

  9. #9
    I too would like to learn more about this - I have heard great things in terms of SEO and RSS feeds...I'm not too savvy on the subject and woule love to hear any suggestions on great and perhaps free or affordable readers that I can add to my sites that you may have used in the past.....

    Is it really a good idea to add an RSS feed to your site from SEO point of view?

  10. #10
    Join Date
    Apr 2006
    Location
    Ireland
    Posts
    15
    i have a php script which automatically generates an xml file based on the fields in a mysql database. I will post up a link to the completed file later this evening when i'm infront of my pc. If i forget send me a PM (i'm only new here...and my ability to send pm's is disabled, how do i enable them)

    Cormac

  11. #11
    Join Date
    Dec 2005
    Location
    Nescopeck, PA
    Posts
    3
    Any chance of getting a peek at that php file Cormac. Perhaps you are still subscribed to this.

    Mark

  12. #12
    Join Date
    Apr 2006
    Location
    Ireland
    Posts
    15
    i did indeed subscribe...
    call this file rss.php or whatever, chmod it to 777 as it generates a xml file called rss.xml . The file queries the database for the fields 'title', 'user', 'description', 'message' from the table mynews where RSS='YES'. It then outputs the values in the db to the xml file. For RSS files you need to follow a strict formatting style which i'm sure you are aware off.

    PHP Code:
    <?

    $host 
    "localhost";
    $user "********";
    $pass "********";
    $database "********";

    $linkID mysql_connect($host$user$pass) or die("Could not connect to host.");
    mysql_select_db($database$linkID) or die("Could not find database.");

    $query "SELECT  id, title, user, link, content, message FROM mynews WHERE RSS='yes' ORDER BY id DESC";
    $result mysql_query($query$linkID) or die("Data not found.");
    $num mysql_num_rows($result);
    if (
    $num != 2) {


    $filefopen('rss.xml' 'w');
    $xml_output "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
    $xml_output .= "<rss version=\"2.0\">\n";
    $xml_output .= "<channel>\n";
    for (
    $x 0$x mysql_num_rows($result) ; $x++){
    $row mysql_fetch_assoc($result);
    $xml_output .= "\t<item>\n";
    $xml_output .= "\t\t<title>" $row['title'] . "</title>\n";
    $xml_output .= "\t\t<author>" $row['user'] . "</author>\n";
    $xml_output .= "\t\t<link>" $row['link'] . "</link>\n";
    $xml_output .= "\t\t<category>" $row['content'] . "</category>\n";
    $xml_output .= "\t\t<description>" $row['message'] . "</description>\n";


    //Escaping illegal charcters
    // $row ['description'] = str_replace("&", "&", $row['text']);
    //$row ['description'] = str_replace("<", "&lt", $row['text']);
    //$row ['description'] = str_replace(">", "&gt", $row['text']);
    //$row ['description'] = str_replace("\"", "&quote", $row['text']);

    $xml_output .= "\t</item>\n";

    }
    $xml_output .= "</channel>";
    $xml_output .= "</rss>";

    fputs($file$xml_output);
    fclose($file);
    echo 
    "<a href= rss.xml>MY RSS FEED</a>";

    }
    else {
    echo 
    "No Records found";
    }


    ?>
    Thats about it, if you have any probelms just reply, i'm subscribed to this topic. A friend emailed me a script he wrote which works a bit better than the one above. With the script above you need to click on the link MY RSS FEED to run the query which generates the rss file but with my friends it automatically generates the rss file which is handier.

    Cormac
    Last edited by Cormac Moylan; 04-29-2006 at 07:31 AM.

  13. #13
    Join Date
    Apr 2006
    Location
    Ireland
    Posts
    15
    Quote Originally Posted by STORMPAYUSER

    Is it really a good idea to add an RSS feed to your site from SEO point of view?
    yes it is. If you have a rss feed for your content you will get picked up more frequently by search bots and the like as your content is becoming more dynamic.

    If you have rss content on your site from another site you will also improve your SEO as you will have fresh content on your site from other sites. I would recommend magpieRSS as the tool to setup RSS feeds to your site. Its a fantastic application

Posting Permissions

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