[eluser]Rubiz'[/eluser]
Hello all!
I'm using SimplePie in an app and I really loved that!
My app has 2 boxes to feed in the same page: 1 for commom rss feed, and other for podcast feeds. Both with multiple and different feeds.
I need to clear results of the first feed... the first feed news are listed in the second feed box, it shouldn't happen... they are mixing as if I have called only one time the method. I have called twice, with different params.
How can I clear results?
Code for news feed:
Code:
<?
//SimplePie
$this->simplepie->set_feed_url(array('http://www.stf.jus.br/portal/RSS/noticiaRss.asp?codigo=1','http://www.stj.gov.br/portal_stj/rss/index.wsp','feed://www.nytimes.com/services/xml/rss/nyt/GlobalHome.xml','http://www.agu.gov.br/RSS','http://portal2.tcu.gov.br/portal/pls/portal/TCU_CUSTOM.RSS_TCU_NOTICIAS','feed://jus.uol.com.br/revista/feed'));
$this->simplepie->set_item_limit(3);
$this->simplepie->enable_cache(false);
$this->simplepie->enable_order_by_date(true);
$this->simplepie->init();
$this->simplepie->handle_content_type();
$feeds = $this->simplepie->get_items();
?>
<h3>Notícias</h3>
<ul>
<? for( $i=0; $i<3; $i++ ): ?>
<li><a >get_permalink()?>" target="_self"><strong><?=$feeds[$i]->get_title()?></strong> <br /><?=word_limiter($feeds[$i]->get_content(),19)?> [mais]</a></li>
<? endfor; ?>
</ul>
<a class="see-all" href="<?=base_url()?>index.php/noticias" title="ver todas" target="_self">ver todas</a>
Code for podcast feed:
Code:
<h3>PODCAST</h3>
<?
//SimplePie
$feeds = '';
$this->simplepie->set_feed_url(array('http://imagens.globoradio.globo.com/cbn/podcast/comentaristas/lucia-hippolito.xml',
'http://imagens.globoradio.globo.com/cbn/podcast/comentaristas/arnaldo-jabor.xml',
'http://imagens.globoradio.globo.com/cbn/podcast/comentaristas/miriam-leitao.xml',
'http://imagens.globoradio.globo.com/cbn/podcast/colunas/cbn-direitos-do-consumidor.xml',
'feed://rss.uolnews.uol.com.br/podcast/fernandorodrigues.xml',
'feed://rss.uolnews.uol.com.br/podcast/bbcbrasil.xml'));
$this->simplepie->set_item_limit(1);
$this->simplepie->enable_cache(false);
$this->simplepie->enable_order_by_date(true);
$this->simplepie->init();
$this->simplepie->handle_content_type();
$feeds = $this->simplepie->get_items();
?>
<ul>
<? for ( $i=0; $i < 3; $i++ ): ?>
<? $item = $feeds[$i]; ?>
<li><p><strong><?=$item->get_author()->get_name()?></strong><br />
<?=$item->get_content()?></p>
<div class="podcast-wrapper">
<div id="id_temp_<?=$i?>">
</div>
</div>
</li>
[removed]
var flashvars = {
txt_url_feed: "<?=$item->get_permalink()?>",
txt_itunes: "<?=$item->get_feed()->subscribe_itunes()?>"
};
swfobject.embedSWF("<?=base_url()?>_SWF/copy.swf", "id_temp_<?=$i?>", "250", "15", "9.0.0","expressInstall.swf", flashvars);
[removed]
<? endfor; ?>
</ul>
<a class="see-all" href="<?=base_url()?>index.php/podcast" title="ver todas" target="_self">ver todas</a>