if i am able to understand RSS right or no ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • realin
    Contributor
    • Feb 2007
    • 254

    if i am able to understand RSS right or no ?

    hi guys,

    I want to know how can i add RSS to my website ? cause they say without RSS your site is dead :P hehehe

    I read few article online and wat i could jot up is that, we have to make a XML file with the five mandatory fields rss version,channel ,title,link,des cription and link this file anywhere on your webpage from where the users copy the link and feed it to their RSS reader apps or utltilities.

    So it can have any XML file name ? And it can be placed anywhere in the website ? and how do i dynamically make the .xml page, just like we do it in html pages ? is it so ?

    Please let me know if there is some tutorial which teaches to create a RSS file with php, without having to use the third party class file or anything ..

    thanks :)
    Last edited by realin; Oct 21 '07, 03:53 AM. Reason: Email notification
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Realin.

    The key element to making RSS-aware browsers is by using the link tag:

    [code=html]
    <link rel="alternate" type="applicati on/rss+xml" title="Title of the News Feed" href="http://yourdomain.tld/path/to/feed.rss" />
    [/code]

    Comment

    • realin
      Contributor
      • Feb 2007
      • 254

      #3
      Originally posted by pbmods
      Heya, Realin.

      The key element to making RSS-aware browsers is by using the link tag:

      [code=html]
      <link rel="alternate" type="applicati on/rss+xml" title="Title of the News Feed" href="http://yourdomain.tld/path/to/feed.rss" />
      [/code]
      hey pbmods,

      thanks for the reply, you are always the one to reply my twisted question(which are twisted for me but simple for you).

      I am unable to workaround with RSS. Suppose i make a php file in which a complete RSS like file is create but, how do i make it XML ??
      i have got three parts in this whole RSS thing

      1) PHP file, which fetches data from database and makes the feed, it includes <? xml ?> etc etc everything

      2) XML file, which is actually reached by the RSS reader when given a link like.
      [HTML]<a href='rss.xml'> Read RSS</a>
      [/HTML]
      3) the file in which i will put this link(above mentioned)..

      but how do i go with it ? if i create a file with PHp then shall is store it ? that is not the way it is suppose to be i guess ..

      please help thanks :)
      Last edited by realin; Oct 21 '07, 01:37 PM. Reason: Email notification

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        Heya, Realin.

        Check out this article.

        If you generate the RSS feed using PHP, be sure to set the content type:

        [code=php]
        header('Content-Type: application/rss+xml; charset=utf-8');
        [/code]

        Comment

        • realin
          Contributor
          • Feb 2007
          • 254

          #5
          hey thanks for the reply.. i went thru the above mentioned article, but it shows to create a static RSS page.. i got something like i wanted.. here



          i gonna read both of them and if i face some problem.. i will letcha know..
          cheers !!
          u rock :)

          **********EDIT* *************** *******

          one question waht should be the extension of the rss ? is it more likely to be rss or xml ? cause i read somewhere and tehy say the feeds which come from .xml file are more penetrable than other files... is it so ?

          now when i will have a php file geenrating a random feed page for me and in the end i will have this lines, then it sure gonna generate RSS for me

          [PHP]header("Content-type: application/xml; charset='ISO-8859-1'");[/PHP]


          So that means the link for users should click should be something like this

          [HTML]
          <link rel="alternate" type="applicati on/rss+xml" title="Title of the News Feed" href="feed.php" />[/HTML]

          am i right ? but .php seems to be ODD and incorrect

          Comment

          • pbmods
            Recognized Expert Expert
            • Apr 2007
            • 5821

            #6
            Heya, Realin.

            You could give the file a .xml or .rss extension and then add an .htaccess file to the same directory as that file.

            The .htaccess file would have this line in it:
            [code=apache]
            AddType application/x-httpd-php .xml (or .rss, whichever you use)
            [/code]

            Comment

            • realin
              Contributor
              • Feb 2007
              • 254

              #7
              there is a another way in whcih XML files can be parsed as php, is this the right way to do ?

              Last edited by pbmods; Oct 21 '07, 02:51 PM. Reason: Fixed link.

              Comment

              • realin
                Contributor
                • Feb 2007
                • 254

                #8
                Originally posted by pbmods
                Heya, Realin.

                You could give the file a .xml or .rss extension and then add an .htaccess file to the same directory as that file.

                The .htaccess file would have this line in it:
                [code=apache]
                AddType application/x-httpd-php .xml (or .rss, whichever you use)
                [/code]
                hey thanks.. for the above.. i will use that .htacces trick :)

                thanks :)

                Comment

                Working...