Part of the EllisLab Network
   
 
Retriveing Rss results getting problem
Posted: 30 August 2007 03:55 AM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  81
Joined  06-25-2007

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());

          }
      }
     

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

 Signature 

Masssss….........
Please always help to others….at any time

Profile
 
 
Posted: 30 August 2007 05:53 AM   [ Ignore ]   [ # 1 ]  
Lab Assistant
RankRank
Total Posts:  130
Joined  07-17-2007

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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 

this usually salves the strange characters problem

 Signature 

Computers are incredibly fast, accurate and stupid. Human beings are incredibly slow, inaccurate and brilliant. Together they are powerful beyond imagination.

                                    A. Einstein

Profile
 
 
Posted: 31 August 2007 01:23 AM   [ Ignore ]   [ # 2 ]  
Grad Student
Avatar
Rank
Total Posts:  81
Joined  06-25-2007

snake

In header i changed from


<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1”>


to

<meta http-equiv=“Content-Type” content=“text/html; charset=UTF-8”>


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


Thanks a lot…...........

 Signature 

Masssss….........
Please always help to others….at any time

Profile
 
 
Posted: 29 April 2009 12:15 PM   [ Ignore ]   [ # 3 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  154
Joined  12-01-2008

Hello All,
I’m running into some issues using SimpleRSS. 

Here is the code that I’am using:

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

Profile