<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>development tutorial Archives &#8212; Stampede: the strategic design &amp; technology company</title>
	<atom:link href="https://stampede-design.com/blog/tag/development-tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>https://stampede-design.com/blog/tag/development-tutorial/</link>
	<description>We are creating better worlds though thoughtful design and technology. Connect with us!</description>
	<lastBuildDate>Tue, 07 Apr 2026 09:08:19 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.5</generator>

<image>
	<url>https://stampede-design.com/wp-content/uploads/2024/02/cropped-Stampede-Favicon-old-32x32.png</url>
	<title>development tutorial Archives &#8212; Stampede: the strategic design &amp; technology company</title>
	<link>https://stampede-design.com/blog/tag/development-tutorial/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Quickly Fetch Web Feeds with SimplePie</title>
		<link>https://stampede-design.com/blog/quickly-retrieve-web-feeds-with-simplepie/</link>
					<comments>https://stampede-design.com/blog/quickly-retrieve-web-feeds-with-simplepie/#respond</comments>
		
		<dc:creator><![CDATA[Shaiful Borhan]]></dc:creator>
		<pubDate>Sun, 29 Aug 2010 14:57:14 +0000</pubDate>
				<category><![CDATA[Field Notes]]></category>
		<category><![CDATA[development tutorial]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[SimplePie]]></category>
		<category><![CDATA[web feeds]]></category>
		<guid isPermaLink="false">https://stampede-design.com/blog/?p=733</guid>

					<description><![CDATA[<p>Let's say we have a university website running on a CMS and a couple of student blogs running on a blogging tool like WPMU. Then on the university website homepage we need to pull several latest blog teasers from the student blogs. We can accomplish this quite easily with a free PHP class called SimplePie. What the library does is it fetches the blog RSS or Atom feed that we provide and parses it into an easy to use formatted data.</p>
<p>The post <a href="https://stampede-design.com/blog/quickly-retrieve-web-feeds-with-simplepie/">Quickly Fetch Web Feeds with SimplePie</a> appeared first on <a href="https://stampede-design.com">Stampede: the strategic design &amp; technology company</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="lead">Let’s say we have a university website running on a CMS and a couple of student blogs running on a blogging tool like WPMU. Then on the university website homepage we need to pull several latest blog teasers from the student blogs. We can accomplish this quite easily with a free PHP class called <a href="http://simplepie.org/" target="_blank">SimplePie</a>. What the library does is it fetches the blog RSS or Atom feed that we provide and parses it into an easy to use formatted data.</p>
<pre class="brush: php; title: ; notranslate">
require_once('simplepie.inc'); 

$webfeed = &quot;http://mywordpressblog.com/index.php?feed=rss2&quot;;
$feed = new SimplePie();
$feed-&gt;set_feed_url($webfeed);
// $feed-&gt;set_cache_location(&quot;./cache_folder&quot;);	//set your own cache folder; default ./cache
// $feed-&gt;set_cache_duration(1800);	//cache duration in number of minutes; default 3600
$feed-&gt;init();
$feed-&gt;handle_content_type();

echo '&lt;ul&gt;';

foreach ($feed-&gt;get_items(0, 3) as $key =&gt; $item) {
	
  echo '&lt;li&gt;';
  echo '&lt;a href=&quot;'. $item-&gt;get_permalink() .'&quot;&gt;'. $item-&gt;get_title() .'&lt;/a&gt;';
  echo '&lt;/li&gt;';
  // $item-&gt;get_description() to get the teaser
  // $item-&gt;get_date('F jS, Y') to get the date formatted using php date()

}
echo '&lt;/ul&gt;';
</pre>
<p>A thing to note here is the foreach loop in line 13 controls how many items you would like to retrieve from the feed. In the example above, it’s set to read three feed items (stated as 3) starting from the first item (stated as 0).</p>
<p>One of the advantages of using SimplePie is performance. SimplePie is configured to grab and cache the feed so that the server doesn’t have to fetch them every time the webpage is loaded. By default, SimplePie stores its cache in a directory called “cache” with a cache duration of an hour. So it’s advisable to create this directory with a correct permission assigned in advance. These default settings can be overridden very easily.</p>
<p>Besides standalone code, you can also find a handful of <a href="http://simplepie.org/wiki/plugins/" target="_blank">SimplePie plugins</a> that were built for major CMS such as Joomla! or Drupal. With web feeds becoming quite common today, you can use SimplePie in many creative ways for instance to fetch Tweets, Flickr photos or cool products from eBay.</p>
<p>The post <a href="https://stampede-design.com/blog/quickly-retrieve-web-feeds-with-simplepie/">Quickly Fetch Web Feeds with SimplePie</a> appeared first on <a href="https://stampede-design.com">Stampede: the strategic design &amp; technology company</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://stampede-design.com/blog/quickly-retrieve-web-feeds-with-simplepie/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
