21306 Posts in 5736 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2403 Views |
-
SimplePie Thumbnail From RSS?

13 November 2009 at 9:28am
Hi how can I pull thumbnails from an RSS Feed with the simple pie plugin?
everything else works great I looked on the simplepie documentation on it's website.
here is what I tried but it failed...Thanks for any help
-
Re: SimplePie Thumbnail From RSS?

13 November 2009 at 5:33pm
from what i've read, the restfulservice is based on simplepie.
this page should help:you can target the xml nodes through statements like
$value->Title
$value->Link
$value->pubDatehope it helps,
-Chris -
Re: SimplePie Thumbnail From RSS?

14 November 2009 at 4:50am
Fatal error: Call to undefined function curl_init() in \sapphire\api\RestfulService.php on line 96
any ideas?
-
Re: SimplePie Thumbnail From RSS?

14 November 2009 at 4:54am
if you're on wamp, make sure php_curl is turned on in php.ini
-
Re: SimplePie Thumbnail From RSS?

14 November 2009 at 9:47pm
Well that was the issue, but now a new issue. the example give works great with the feed from delicous if I return any other rss feed url I get nada. no errors just no results
-
Re: SimplePie Thumbnail From RSS?

15 November 2009 at 10:56am
ok I almost have it working but, the item is called <photo:thumbnail>
how do I call it? also for somereason it won't let me strip the tags from the description
function RestfulLinks(){
$output = new DataObjectSet();
$feed = new RestfulService("http://feeds.nbcdfw.com/nbcdfw/news/sports");
$feedXML = $feed->request()->getBody();
$result = $feed->getValues($feedXML, 'channel', 'item');
foreach ($result as $key => $value) {$title = new Text('Title');
$title->setValue($value->title);
$desc = new HTMLText('Description');
$desc->setValue(strip_tags($value->description));
$output->push(new ArrayData(array(
'Title' => $title,
'Description' => $desc,
)));
}return $output;
} -
Re: SimplePie Thumbnail From RSS?

17 November 2009 at 6:03am
Right, you're going to have to customize your parsing rules for whatever feed you're ingesting.
Have you tried casting the data into a string first? ie.
$desc = strip_tags((string)$value->description);
Also, you shouldn't have to create a new Text() and HTMLText() for each item before putting it in the DataObjectSet. You can just leave it as a plain old string.
-
Re: SimplePie Thumbnail From RSS?

17 November 2009 at 8:13am
as far as the <photo:thumbnail> node is concerned, i've never tried parsing a namespaced node, but here are some thoughts..
$result is an array, so you may be able to use $value['photo:thumbnail'].you could also try entering Debug::dump($value) to print out all the child nodes of $value.
hope it helps,
-Chris
| 2403 Views | ||
|
Page:
1
|
Go to Top |


