help with rss feeds

Discussion in 'PHP' started by jpinheiro, Oct 12, 2009.

  1. #1
    jpinheiro, Oct 12, 2009 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    use simplexml to load the feed, then display based on the titles for each element
     
    JAY6390, Oct 12, 2009 IP
  3. iAreCow

    iAreCow Peon

    Messages:
    85
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #3
    Twitter RSS is a script that reads in your Twitter RSS feed and formats it for the web, so that you can include your recent Twits on your website. It attempts to read the RSS file using the cURL extension (if it's installed) and the fopen() option if not.
    code.kerison.com/twitter/
     
    iAreCow, Oct 12, 2009 IP
  4. jnelson563

    jnelson563 Peon

    Messages:
    72
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Played with simplexml and got it to show
    
    <?php
    
    ###----NUMBER OF TWITTER POSTS TO SHOW----####
    	$numTwits = 5;
    	
    ###----RSS FEED OF THE TWITTER URL--------####	
    	$url = "http://twitter.com/statuses/user_timeline/31471128.rss";
    
    
    $xml = simplexml_load_file($url);
    	$i = 1;
    	
    	
    	?>
    
        <table>
        <?php
    	foreach($xml->channel->item as $items) {
    		echo "<tr><td>".$items->title."</td></tr>";		
    		if($i == $numTwits){
    			break;
    		}else{
    			$i++;
    		}
    	}
    ?>	
    	
    </table>
    
    PHP:
     
    jnelson563, Oct 12, 2009 IP