Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End SimplePie problems

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #29049
    hoss9009
    Member

    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): ?>

    Smashing Magazine

    error): ?>

    error; ?>


    get_items() as $item): ?>

    NPR

    error): ?>

    error; ?>


    get_items() as $item): ?>

    #75865
    Tcooper
    Member

    Never 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?

    #75873
    hoss9009
    Member

    Now 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 1773

    Warning: 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?

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.