Dynamic RSS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jez

    Dynamic RSS

    Does anyone have any experience of creating dynamic RSS feeds from a
    database using PHP?

    There's loads of information about RSS, but not much on RSS/PHP.

    I'm sure it can't be too difficult, but I'm struggling to create a
    file that's usable.

    Thanks!

    Jez
  • André Næss

    #2
    Re: Dynamic RSS

    Jez:
    [color=blue]
    > Does anyone have any experience of creating dynamic RSS feeds from a
    > database using PHP?
    >
    > There's loads of information about RSS, but not much on RSS/PHP.
    >
    > I'm sure it can't be too difficult, but I'm struggling to create a
    > file that's usable.[/color]

    I've never looked at RSS, but AFAIK it's just XML, so all you need to do is
    generate XML, which is text, which means that

    echo "<xml>$hell o</xml>";

    is about as complicated as it gets.

    André Næss

    Comment

    • furry

      #3
      Re: Dynamic RSS

      It never ceases to amaze me that people don't do a simple google search
      for what they're looking for before posting a message in a newsgroup.

      If you type "php rss feed class" into google, you're first entry will be:

      Geeklog, the open source content management system designed with security in mind.




      "Jez" <jez.hailwood@b tinternet.com> wrote in message
      news:ad15f8ee.0 311060511.86159 3d@posting.goog le.com...
      Does anyone have any experience of creating dynamic RSS feeds from a
      database using PHP?

      There's loads of information about RSS, but not much on RSS/PHP.

      I'm sure it can't be too difficult, but I'm struggling to create a
      file that's usable.

      Thanks!

      Jez


      Comment

      • Fred

        #4
        Re: Dynamic RSS

        >> Does anyone have any experience of creating dynamic RSS feeds from a[color=blue][color=green]
        >> database using PHP?
        >>
        >> There's loads of information about RSS, but not much on RSS/PHP.
        >>
        >> I'm sure it can't be too difficult, but I'm struggling to create a
        >> file that's usable.[/color]
        >
        >I've never looked at RSS, but AFAIK it's just XML, so all you need to do is
        >generate XML, which is text, which means that[/color]

        Don't know if this will help but there is an article about how to create an RSS
        Feed at http://www.softwaremarketingresource.com/article18.html
        Fred

        Comment

        • Hastur Batato

          #5
          Re: Dynamic RSS

          furry (48.983% quality rating):[color=blue]
          >
          > If you type "php rss feed class" into google, you're first entry will be:
          >
          > cvs.geeklog.net/chora/co.php/geeklog-1.3/system/classes/rss.feed.class. php[/color]

          ew.

          Just do it directly, without objects, like God intended.

          /joe
          --
          In the phatcave, Ryan Chaves types on the news server. Matt Magnasco fails
          to impress City Cafe and looks for support from git.test and David Wada,
          and then falls off the back of a UPS truck near Eric Adams? Bwooce likes to
          chat with git.talk.phatjo e for a case and a smelly, gi-n... [tape runs out]

          Comment

          • Jez

            #6
            Re: Dynamic RSS

            André Næss <andrena.spamre allysucks@ifi.u io.no> wrote in message news:<bodk1o$r8 t$2@maud.ifi.ui o.no>...[color=blue]
            > Jez:
            >[color=green]
            > > Does anyone have any experience of creating dynamic RSS feeds from a
            > > database using PHP?
            > >
            > > There's loads of information about RSS, but not much on RSS/PHP.
            > >
            > > I'm sure it can't be too difficult, but I'm struggling to create a
            > > file that's usable.[/color]
            >
            > I've never looked at RSS, but AFAIK it's just XML, so all you need to do is
            > generate XML, which is text, which means that
            >
            > echo "<xml>$hell o</xml>";
            >
            > is about as complicated as it gets.
            >
            > André Næss[/color]

            My problem seems to be that a file with the .php extension won't
            validate as RSS. An identical file with the .xml extension works
            perfectly, but obviously that means I can't use php!

            When looking through google (and I did do a fairly extensive search) I
            found that people were using PHP to create an XML file on their server
            via a cron job, but I can't understand why it's not possible to use
            the php file as the feed because the output 'should' be valid xml ...
            or perhaps not? Maybe it's something to do with headers?

            I must be missing something here and any help would be gratefully
            received!

            Thanks!

            Jez

            PS. Afraid I haven't got my head round classes yet.

            Comment

            • Jez

              #7
              Re: Dynamic RSS

              André Næss <andrena.spamre allysucks@ifi.u io.no> wrote in message news:<bodk1o$r8 t$2@maud.ifi.ui o.no>...[color=blue]
              > Jez:
              >[color=green]
              > > Does anyone have any experience of creating dynamic RSS feeds from a
              > > database using PHP?
              > >
              > > There's loads of information about RSS, but not much on RSS/PHP.
              > >
              > > I'm sure it can't be too difficult, but I'm struggling to create a
              > > file that's usable.[/color]
              >
              > I've never looked at RSS, but AFAIK it's just XML, so all you need to do is
              > generate XML, which is text, which means that
              >
              > echo "<xml>$hell o</xml>";
              >
              > is about as complicated as it gets.
              >
              > André Næss[/color]

              Hmmmm, could be something to do with the fact that php doesn't like the ?>
              in <?xml version="1.0" ?>

              Maybe?

              Comment

              • Hastur Batato

                #8
                Re: Dynamic RSS

                Raekwon, speaking through Jez, wrote:[color=blue]
                >
                > Hmmmm, could be something to do with the fact that php doesn't like the ?>
                > in <?xml version="1.0" ?>[/color]

                My very bare-bones RSS script (which is a .php file) starts like this:

                <?php

                include("common .php");

                header("Content-Type: text/xml");

                echo "<?xml version=\"1.0\" ?>\n";
                echo "<!-- RSS generation done by phat_joe -->\n";
                echo "<rss version=\"0.91\ ">\n";
                echo "\t<channel>\n" ;

                It has no parsing problems, and I haven't had problems accessing it as
                an RSS feed.

                To the original poster, are you using the proper Content-Type?

                /joe
                --
                The Scag is ordinary.

                Comment

                • Hastur Batato

                  #9
                  Re: Dynamic RSS

                  Hastur Batato, obviously a huge fan of John Linnell, wrote:[color=blue]
                  >
                  > To the original poster, are you using the proper Content-Type?[/color]

                  Wait, I was replying to the original poster already :)

                  /joe
                  --
                  In the phatmobile, /home/pr0n is nauseous and priceless. Tim Faircloth
                  demolishes the fiber line. The memory is ghetto.

                  Comment

                  • vKp

                    #10
                    Re: Dynamic RSS

                    Jez wrote:[color=blue]
                    > André Næss <andrena.spamre allysucks@ifi.u io.no> wrote in message news:<bodk1o$r8 t$2@maud.ifi.ui o.no>...
                    >[color=green]
                    >>Jez:
                    >>
                    >>[color=darkred]
                    >>>Does anyone have any experience of creating dynamic RSS feeds from a
                    >>>database using PHP?
                    >>>
                    >>>There's loads of information about RSS, but not much on RSS/PHP.
                    >>>
                    >>>I'm sure it can't be too difficult, but I'm struggling to create a
                    >>>file that's usable.[/color]
                    >>
                    >>I've never looked at RSS, but AFAIK it's just XML, so all you need to do is
                    >>generate XML, which is text, which means that
                    >>
                    >>echo "<xml>$hell o</xml>";
                    >>
                    >>is about as complicated as it gets.
                    >>
                    >>André Næss[/color]
                    >
                    >
                    > Hmmmm, could be something to do with the fact that php doesn't like the ?>
                    > in <?xml version="1.0" ?>
                    >
                    > Maybe?[/color]

                    Yeah, escape that:

                    <?php echo "<?xml version=\"1.0\" encoding=\"utf-8\"?".">"; ?>

                    Also, be sure to set the content-type to application/rss+xml

                    Comment

                    • Manuel Lemos

                      #11
                      Re: Dynamic RSS

                      Hello,

                      On 11/06/2003 11:11 AM, Jez wrote:[color=blue]
                      > Does anyone have any experience of creating dynamic RSS feeds from a
                      > database using PHP?[/color]

                      You may want to try this class that does exactly what you need:



                      --

                      Regards,
                      Manuel Lemos

                      Free ready to use OOP components written in PHP


                      Comment

                      • Jez

                        #12
                        Re: Dynamic RSS

                        vKp <asso101@hotmai l.com> wrote in message news:<boeafd$o4 $1@newsg1.svr.p ol.co.uk>...[color=blue]
                        > Jez wrote:[color=green]
                        > > André Næss <andrena.spamre allysucks@ifi.u io.no> wrote in message news:<bodk1o$r8 t$2@maud.ifi.ui o.no>...
                        > >[color=darkred]
                        > >>Jez:
                        > >>
                        > >>
                        > >>>Does anyone have any experience of creating dynamic RSS feeds from a
                        > >>>database using PHP?
                        > >>>
                        > >>>There's loads of information about RSS, but not much on RSS/PHP.
                        > >>>
                        > >>>I'm sure it can't be too difficult, but I'm struggling to create a
                        > >>>file that's usable.
                        > >>
                        > >>I've never looked at RSS, but AFAIK it's just XML, so all you need to do is
                        > >>generate XML, which is text, which means that
                        > >>
                        > >>echo "<xml>$hell o</xml>";
                        > >>
                        > >>is about as complicated as it gets.
                        > >>
                        > >>André Næss[/color]
                        > >
                        > >
                        > > Hmmmm, could be something to do with the fact that php doesn't like the ?>
                        > > in <?xml version="1.0" ?>
                        > >
                        > > Maybe?[/color]
                        >
                        > Yeah, escape that:
                        >
                        > <?php echo "<?xml version=\"1.0\" encoding=\"utf-8\"?".">"; ?>
                        >
                        > Also, be sure to set the content-type to application/rss+xml[/color]

                        Nice one! Breaking up the ? and > has solved it!

                        Thanks everyone for your help.

                        Jez

                        Comment

                        Working...