Jump to content

get content from rss feed


clankill3r

Recommended Posts

I try to get the content from

http://www.adafruit.com/blog/feed/

 

some stuff is like this:

<![CDATA[

Super simple drawdio + glove @ Studio Contrechoc. we experimented with a simplified drawdio, then we combined this bit of electronics with a first glove the cyclist glove. To make this terribly designed monster more fashionable, by-wire.net made another fine glove. We had to find the right kind of small speaker, and we used a [...]

]]>

 

no idea if that matters.

Atm i have this:

 

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

//foreach()
//print_r2($xmlTree);

for($i = count($xmlTree->channel->item)-1; $i >= 0; $i--) {

$item = $xmlTree->channel->item[$i];
print_r2($item);
//print_r2($item->category);

//$category = $item->category;
//print_r2($category);


}

 

it prints stuff like:

SimpleXMLElement Object

(

    [title] => New videos – Customer service, shipping, order status and more…

    [link] => http://www.adafruit.com/blog/2012/04/27/new-videos-customer-service-shipping-order-status-and-more/

    [comments] => http://www.adafruit.com/blog/2012/04/27/new-videos-customer-service-shipping-order-status-and-more/#comments

    [pubDate] => Fri, 27 Apr 2012 17:00:00 +0000

    [category] => SimpleXMLElement Object

        (

        )

 

    [guid] => http://www.adafruit.com/blog/?p=30479

    [description] => SimpleXMLElement Object

        (

        )

 

)

 

category and description are empty, how can i get that content?

 

print_r2 is just this:

 

function print_r2($val){
echo "<pre>";
print_r($val);
echo "</pre>";
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.