Welcome Guest, Not a member yet? Register   Sign In
Retriveing Rss results getting problem
#1

[eluser]MASS MASS[/eluser]
i am calling one function like this

------------code in controller ---------------
$this->load->library('simplepie');
$arr_data['feed'] = new SimplePie();
$arr_data['feed']->set_feed_url('http://images.apple.com/main/rss/hotnews/hotnews.rss');
$arr_data['feed']->set_cache_location('cache');
$arr_data['feed']->init();
$arr_data['feed']->handle_content_type();
-------------end of code in controller ---------------


in view page i am calling like this
------------------

<?php
if ($feed->data)
{
$max = $feed->get_item_quantity(20);
for ($x = 0; $x < $max; $x++)
{
$item = $feed->get_item($x);
echo $item->get_title();
echo htmlentities($item->get_description());

}
}


?&gt;
problem is .............i am getting results with unknown characters......in description content as shown below.........

iTunes customers in the UK can now purchase and download hit television programming from ABC Studios, the Disney Channel, MTV, Nickelodeon, and Paramount Comedy for £1.89 an episode. The programming includes such shows as the Emmy Award-winning series “Lost,” “Desperate Housewives,” “Grey’s Anatomy,” and “Ugly Betty,” as well as locally-produced UK series, including MTV’s “Barrio 19,” Nickelodeon’s “Genie in the House,” and Paramount Comedy’s “Comedy Blue.”


please help me
thx
#2

[eluser]alpar[/eluser]
try setting a meta tag in your view to indicate the browser it should render in UTF-8 charset, like so:

Code:
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;


this usually salves the strange characters problem
#3

[eluser]MASS MASS[/eluser]
Confusednake:

In header i changed from


&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;


to

&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;


Its really great alpar...............Its working fine


Thanks a lot..............
#4

[eluser]whobutsb[/eluser]
Hello All,
I'm running into some issues using SimpleRSS.

Here is the code that I'am using:
Code:
$this->load->library('simplepie');
        $link = 'http://feedproxy.google.com/blogspot/MKuf';
        
        $feed = new SimplePie();
        $feed->set_feed_url($link);
        $feed->enable_cache(false);
        $feed->init();
        $feed->handle_content_type();

        $items = $feed->get_items();
        print_r($feed);
        die;
         foreach($items as $item){
             echo $item->get_title();
         }
        
         die;

When I print $feed I see there is an error: [error] => A feed could not be found at http://feedproxy.google.com/blogspot/MKuf

Which is ridiculous because its the official google blog RSS feed.

If I change the method set_feed_url to force_feed(), the error doesn't show up but when I try print_f $items it comes up as a blank array.

Am I missing something with this library?




Theme © iAndrew 2016 - Forum software by © MyBB