Parsing a Dynamic RSS File

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • joeyjwc@gmail.com

    #1

    Parsing a Dynamic RSS File

    Hi,
    I'm a bit new to PHP, so please bare with me. I've been studying
    it for a couple of months now and really like it. On the main page of
    my website, I would like to include a small box that lists the title of
    the latest blog entry (as well as making that a link to the entry) to
    my WordPress blog. I was thinking about parsing the RSS for this, but
    I'm not sure how to parse a dynamic RSS feed. Or is there some simpler
    way of doing it and I'm trying to overprogram?

    Thank you for your comments.

    -Joey C.

  • milahu

    #2
    Re: Parsing a Dynamic RSS File

    Is your weblog installed on the same domain?
    Then you could simply get the data directly from the database.

    Else you would have to parse the RSS feed by getting its content via
    file_get_conten ts() and either using PHP's XML functions to get the
    stuff you want or using regular expressions.

    Comment

    • joeyjwc@gmail.com

      #3
      Re: Parsing a Dynamic RSS File

      :D I feel so stupid now!!! Of course... Why not just get it directly
      from the database?

      Boy, I really am not thinking lately. Anyways, even though I'm pretty
      new to PHP, I took a little time to learn how to integrate the database
      into my main page so now it shows the title and a link to the article
      on my main page. Thanks so much.

      Comment

      • void * clvrmnky()

        #4
        Re: Parsing a Dynamic RSS File

        joeyjwc@gmail.c om wrote:[color=blue]
        > :D I feel so stupid now!!! Of course... Why not just get it directly
        > from the database?
        >
        > Boy, I really am not thinking lately. Anyways, even though I'm pretty
        > new to PHP, I took a little time to learn how to integrate the database
        > into my main page so now it shows the title and a link to the article
        > on my main page. Thanks so much.
        >[/color]
        [N.B.: Please quote the context when replying. Various nodes may not
        have all previous replies in a thread.]

        One reason to use RSS is that you can take the same functions you write
        here to also grab RSS feeds from remote sites. Take a look at the
        Magpie RSS parser for PHP, or XML_Parser. IF you want a real simple,
        XML-free library, try PHP-RSS.

        Google "RSS PHP" and all the top hits are appropriate.

        Comment

        Working...