get content rss feed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I try to get the content from the following rss feed
http://www.adafruit.com/blog/feed/

I want to store it in a database in order to use it for a school assignment.
If i look in my browser to the feed then i see content and description,
however if i try to get them with php then description is this:

[description] => SimpleXMLElement Object
        (
        )


and content is gone.


----------
$db = dbConnect();

$xml =  getFileContents("http://www.adafruit.com/blog/feed/";);
$xmlTree = new SimpleXMLElement($xml);

for($i = count($xmlTree->channel->item)-1; $i >= 0; $i--) {
$item = $xmlTree->channel->item[$i];
 echo "<pre>";
print_r($item);
echo "</pre>";
}

dbClose($db);

?>
----------

this is 1 part of the print_r:

SimpleXMLElement Object
(
    [title] => Birth of the ARM: Acorn Archimedes Promo from 1987
    [link] => http://www.adafruit.com/blog/2012/04/28/birth-of-the-arm-acorn-archimedes-promo-from-1987/
    [comments] =>
http://www.adafruit.com/blog/2012/04/28/birth-of-the-arm-acorn-archimedes-promo-from-1987/#comments
    [pubDate] => Sat, 28 Apr 2012 04:01:35 +0000
    [category] => Array
        (
            [0] => SimpleXMLElement Object
                (
                )

            [1] => SimpleXMLElement Object
                (
                )

        )

    [guid] => http://www.adafruit.com/blog/?p=30498
    [description] => SimpleXMLElement Object
        (
        )

)

I guess content is gone cause it's like this:

<content:encoded>

And description is gone cause it's like this:

<![CDATA[

But how can i avoid this problem (i'm quite new)?

bye

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux