views:

154

answers:

2

hi y'all,

I wanted to ask, I have a div that I would want to place RSS feeds from the BBC or CNN. Now that works but I wanted to paginate the feeds that come in, display 5 at a time with the others showing when the links are clicked. I am starting to write the code now but I was hoping I would get either inspiration or have an example I could glean from.

Thanks

A: 

Take a look at SimplePie RSS class and CodeIgniter, also check SimplePie Plugins and Integration and SimplePie CodeIgniter Library, study more and learn it by yourself.

Nathan Campos
A: 

I've used Haughin's Simple CodeIgniter Library. It's very simple to use.

$this->load->library('simplepie');
$this->simplepie->set_feed_url('http://feeds.haughin.com/haughin');
$this->simplepie->set_cache_location(APPPATH.'cache/rss');
$this->simplepie->init();
$this->simplepie->handle_content_type();

$data['rss_items'] = $this->simplepie->get_items();

echo "<li>";
foreach($rss_items as $item) {
    echo "<li>";
    echo "<a href='" .$item->get_link() . "'>";
    echo $item->get_title();
    echo "</a>";
    echo "</li>";
}
echo "</li>";

You can check out the code here.

Thorpe Obazee