1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP Rss Script

Discussion in 'PHP' started by webxprt, Sep 4, 2011.

  1. #1
    anyone know of an open source php Rss Script ?

    or any code that one could use in a php script to pull rss feeds?
     
    webxprt, Sep 4, 2011 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    Try zRSS One line in your script and you have an RSS feed at that point.
     
    Rukbat, Sep 4, 2011 IP
  3. webxprt

    webxprt Guest

    Messages:
    63
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the link, it does seem to be free, i don't see any mention of it being open source, that may work for now, thanks.
     
    webxprt, Sep 4, 2011 IP
  4. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #4
    If you look at the file you'll see that it's plain old Javascript, as open as can be.
     
    Rukbat, Sep 4, 2011 IP
  5. webxprt

    webxprt Guest

    Messages:
    63
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Just JQuery, I was looking for something using php that I can adapt and extend further, but thanks.
     
    webxprt, Sep 4, 2011 IP
  6. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #6
    You can use cURL, but you'll still get the same RSS feeds. Your end can't change the feed end.
     
    Rukbat, Sep 4, 2011 IP
  7. MayurGondaliya

    MayurGondaliya Well-Known Member

    Messages:
    1,233
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    170
    #7
    simplepie is the easiest tool to work with RSS. Download the simplepie class and use the below code.

    
    $feed = new SimplePie();	
    $feed->set_feed_url($rssurl);
    $feed->init();
    $feed->handle_content_type();
    
    $max = $feed->get_item_quantity();
    		for ($x = 0; $x < $max; $x++):
    			$item = $feed->get_item($x);
    	
    	 		$title = $item->get_title(); 
    	
    			$content =  $item->get_description(); 
    			$content = str_replace("'","`",$content);
    			$url = $item->get_permalink(); 
    			$date = $item->get_date('j F Y | g:i a');
    			
    			// process that data
    	
    	 endfor;
    
    Code (markup):
     
    MayurGondaliya, Sep 4, 2011 IP
    webxprt likes this.