Parsing a Dynamic RSS File

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
     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.

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_contents() and either using PHP's XML functions to get the
stuff you want or using regular expressions.

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.

Re: Parsing a Dynamic RSS File wrote:
Quoted text here. Click to load it
[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.

Site Timeline