Feedburner original item link using SimplePie
I have faced a problem with the rss aggregator script in the way of grabbing feedburner.com blogs rss content with the feedburner original item link.
because the grabbed link was something like : http://feedproxy.google.com/~r/PlusCSS/~3/yje-06jXa-s/ not the feedburner original item link and this type of links makes problems as not redirecting properly especially in mobile view.
so after searching here and there I got a useful way to get the feedburner original item link.
adding ?format=xml to the end of feedburner.com rss link to become http://feeds.feedburner.com/PlusCSS?format=xml
then in the grab code I added this :
$feed = new SimplePie();
$feed->set_useragent('gecko');
$feed->set_feed_url('http://feeds.feedburner.com/PlusCSS?format=xml');
$feed->init();
$feed->handle_content_type();
$array = array_reverse($feed->get_items(0,10));
foreach ($array AS $item) {
$link = $item->get_permalink();
// the condition here
if (strpos($link,'feedproxy') != false) { // if the link contains (feedproxy) then the link is from feedburner.com
$orig = $item->get_item_tags('http://rssnamespace.org/feedburner/ext/1.0','origLink');
$permalink = $orig[0] ['data']
;
} else {
$permalink = $link;
}
// the rest of code
}
That’s the best way to parse feedburner.com feeds with simplepie class.



![Responsive Ajax Contact Form [PHP - JQuery]](http://pluscss.com/wp-content/uploads/2014/05/responsive-ajax-contact-for-150x150.jpg)

![Comments Scripts [the best of codecanyon]](http://pluscss.com/wp-content/uploads/2014/05/157713818605861-150x150.jpg)

