- This topic is empty.
-
AuthorPosts
-
May 16, 2010 at 10:46 pm #29049hoss9009Member
so I’m trying to use the simplepie that chris talked about in screencast #55 http://css-tricks.com/video-screencasts/55-adding-rss-content-with-simplepie/.
I’m getting an error with the last line of code. If I remove the code, the error comes up on the next line of php (now the last line of php code)
Any help would be appreciated.
Code:set_feed_url(array(
‘http://feeds2.feedburner.com/CssTricks’,
));
$feedPolitico->set_item_limit(3);//enable caching
$feedPolitico->enable_cache(true);//provide the caching folder
$feedPolitico->set_cache_location(‘cache’);//set the amount of seconds you want to cache the feed
$feedPolitico->set_cache_duration(1800);//init the process
$feedPolitico->init();//let simplepie handle the content type (atom, RSS…)
$feedPolitico->handle_content_type();//grab the feed
$feedSmashing = new SimplePie();
$feedSmashing->set_feed_url(array(
‘http://smashingmagazine.com’,
));$feedSmashing->set_item_limit(3);
//enable caching
$feedSmashing->enable_cache(true);//provide the caching folder
$feedSmashing->set_cache_location(‘cache’);//set the amount of seconds you want to cache the feed
$feedSmashing->set_cache_duration(1800);//init the process
$feedSmashing->init();//let simplepie handle the content type (atom, RSS…)
$feedSmashing->handle_content_type();//grab the feed
$feedNPR = new SimplePie();
$feedNPR->set_feed_url(array(
‘http://www.npr.org/rss/rss.php?id=1001’,
));$feedNPR->set_item_limit(3);
//enable caching
$feedNPR->enable_cache(true);//provide the caching folder
$feedNPR->set_cache_location(‘cache’);//set the amount of seconds you want to cache the feed
$feedNPR->set_cache_duration(1800);//init the process
$feedNPR->init();//let simplepie handle the content type (atom, RSS…)
$feedNPR->handle_content_type();
?>Politico
error): ?>
error; ?>
get_items() as $item): ?>- get_permalink(); ?>”>get_title(); ?>
get_date(‘j M Y | g:i a T’); ?>
Smashing Magazine
error): ?>
error; ?>
get_items() as $item): ?>- get_permalink(); ?>”>get_title(); ?>
get_date(‘j M Y | g:i a T’); ?>
NPR
error): ?>
error; ?>
get_items() as $item): ?>- get_permalink(); ?>”>get_title(); ?>
get_date(‘j M Y | g:i a T’); ?>
May 17, 2010 at 9:29 am #75865TcooperMemberNever used simplepie before, but the problem with the code you have posted is you aren’t ending your foreach loops (stick endforeach; where you want each to end.) Obviously I don’t know exactly what you are trying to achieve, but shouldn’t the loops be inside the ul? So you have one list with lots of items rather than lots of lists with one item each?
May 17, 2010 at 10:24 am #75873hoss9009MemberNow I’m getting these errors:
Quote:Warning: cache/5b60105eb4ce277db99d436af8b812b9.spc is not writeable in http://website.com/testmu/wp-content/th … plepie.inc on line 1773Warning: cache/570cbd2a6f5e3c8d32b539d47fb9dc41.spc is not writeable in http://website.com/testmu/wp-content/th … plepie.inc on line 1668
Warning: cache/4f00777ba735f7a90601c8c02fadd110.spc is not writeable in http://website.com/testmu/wp-content/th … plepie.inc on line 1773
Is this a permission error?
- get_permalink(); ?>”>get_title(); ?>
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.