<?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>gHacks technology news &#187; magpie</title>
	<atom:link href="http://www.ghacks.net/tag/magpie/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ghacks.net</link>
	<description>A technology blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description>
	<lastBuildDate>Tue, 24 Nov 2009 23:31:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Pull feeds into your website and customize them</title>
		<link>http://www.ghacks.net/2008/05/10/pull-feeds-into-your-website-and-customize/</link>
		<comments>http://www.ghacks.net/2008/05/10/pull-feeds-into-your-website-and-customize/#comments</comments>
		<pubDate>Sat, 10 May 2008 13:21:35 +0000</pubDate>
		<dc:creator>Daniel Pataki</dc:creator>
				<category><![CDATA[The Web]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[magpie]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=4082</guid>
		<description><![CDATA[I&#8217;m building my personal page right now, and since I write 2 blogs of my own (with one more coming up) and contribute to 3 other blogs I thought it would be a nice feature to have a list of my most recent posts on my personal page. You could of course always update the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m building my personal page right now, and since I write 2 blogs of my own (with one more coming up) and contribute to 3 other blogs I thought it would be a nice feature to have a list of my most recent posts on my personal page. You could of course always update the list by hand, but how much easier it would be to get it done by a script. It turns out that this is harder to do than it sounds, but a tool I found, called <a title="Magpie rss" href="http://magpierss.sourceforge.net/" target="_blank">Magpie RSS</a> makes the job easy (or easier, rather).</p>
<p>If you want a simple job done quickly then download the tarball file (for Windows users, I know <a title="Archiving utility" href="http://www.tugzip.com/" target="_blank">Tugzip</a> will unpack it for you) and upload the four .inc files and the extlib directory to your server. You then just place some simple php code where you want the list and off you go.</p>
<p>There is one option that I found really useful, namely that it doesn&#8217;t only understand a set number of tags. As long as they are in the following two forms Magpie will understand them.<code> &lt;field_name&gt;value&lt;/field_name&gt;</code> <code>&lt;namespace:field_name&gt;value&lt;/namespace:field_name&gt; </code>This is great if you need some customization, let me show you a quick example of what I needed and did.</p>
<p><span id="more-4082"></span></p>
<p>Since on my upcoming home page I want to showcase my articles, I can&#8217;t just pull feed items from gHacks for example, since this would include Martin&#8217;s posts too. The fact that Magpie understands just about any tag came to my help though, along with a php if statement. The gHacks feed has a creator tag (&lt;dc:creator&gt;&lt;/dc:creator&gt;), which shows the author of the post. All I needed to do was to set Magpie to only show the posts where the creator is &#8220;Daniel&#8221;. Here&#8217;s the code.</p>
<pre>$rss5 = fetch_rss( 'http://feeds.ghacks.net/ghacksnet' );
$items5 = array_slice($rss5-&gt;items, 0, $num_items);

foreach ( $rss5-&gt;items as $item ) {
$creator = ($item['dc']['creator']);
$href = $item['link'];
$title = $item['title'];
$created = $item['created'];
if ( $creator == 'Daniel' )
{echo "&lt;li&gt;&lt;a href=$href&gt;$title&lt;/a&gt; $created&lt;/li&gt;\n";}
}</pre>
<p>I&#8217;m very far from being a php expert, I just used what I found on forums and websites, so please forgive the lack of explanation, I&#8217;d rather not say anything than say something incorrect. My goal is to show you how simple Magpie is, using just a few lines of code, you can create aggregated RSS feeds for yourself without the hassle of third party widgets, which are mediocre at best. You can customize it any way you want, to show you only titles, the full posts, just the categories, etc. Take a look at the <a title="How to use magpie rss" href="http://magpierss.sourceforge.net/links.php#howto" target="_blank">How-to</a> section for some cool examples.</p>

	Tags: <a href="http://www.ghacks.net/tag/magpie/" title="magpie" rel="tag">magpie</a>, <a href="http://www.ghacks.net/tag/rss/" title="rss" rel="tag">rss</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2008/07/17/we-passed-the-10000-rss-subscribers-mark/" title="We passed the 10000 RSS Subscribers Mark (July 17, 2008)">We passed the 10000 RSS Subscribers Mark</a> (16)</li>
	<li><a href="http://www.ghacks.net/2007/02/10/taskable-rss-feeds-for-your-system-tray/" title="Taskable RSS Feeds for your System Tray (February 10, 2007)">Taskable RSS Feeds for your System Tray</a> (0)</li>
	<li><a href="http://www.ghacks.net/2008/08/14/sort-subscriptions-alphabetically-in-google-reader/" title="Sort Subscriptions Alphabetically in Google Reader (August 14, 2008)">Sort Subscriptions Alphabetically in Google Reader</a> (18)</li>
	<li><a href="http://www.ghacks.net/2009/03/30/rss-reader-feeddemon-3-beta-1/" title="RSS Reader FeedDemon 3 Beta 1 (March 30, 2009)">RSS Reader FeedDemon 3 Beta 1</a> (4)</li>
	<li><a href="http://www.ghacks.net/2008/11/18/rss-feed-filter-feedrinse/" title="RSS Feed Filter Feedrinse (November 18, 2008)">RSS Feed Filter Feedrinse</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2008/05/10/pull-feeds-into-your-website-and-customize/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
