<?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>Huddled Masses &#187; HuddledParser</title>
	<atom:link href="http://huddledmasses.org/tag/huddledparser/feed/" rel="self" type="application/rss+xml" />
	<link>http://huddledmasses.org</link>
	<description>You can do more than breathe for free...</description>
	<lastBuildDate>Fri, 27 Apr 2012 05:42:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<cloud domain='huddledmasses.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>Huddled Parser &#8211; The WordPress Plugin</title>
		<link>http://huddledmasses.org/huddled-parser-the-wordpress-plugin/</link>
		<comments>http://huddledmasses.org/huddled-parser-the-wordpress-plugin/#comments</comments>
		<pubDate>Fri, 12 May 2006 04:28:01 +0000</pubDate>
		<dc:creator>Joel 'Jaykul' Bennett</dc:creator>
				<category><![CDATA[HuddledParser]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://www.huddledmasses.org/jaykul/huddled-parser-the-wordpress-plugin/</guid>
		<description><![CDATA[A long time ago, I wrote Huddled Parser to parse pretty much all versions of news feeds. It works on RSS .92 and 1.0 and 2.0 and ATOM, and even handles feeds with Yahoo&#8217;s media enclosures thumbnails embedded (like flickr feeds). I finally got tired of hacking that into each of my themes when I [...]]]></description>
			<content:encoded><![CDATA[	<p>A long time ago, I wrote <a href="http://www.huddledmasses.org/jaykul/huddledparser2/">Huddled Parser</a> to parse pretty much all versions of news feeds.  It works on <span class="caps">RSS</span> .92 and 1.0 and 2.0 and <span class="caps">ATOM</span>, and even handles feeds with <a href="http://search.yahoo.com/mrss">Yahoo&#8217;s media enclosures</a> thumbnails embedded (like flickr feeds).  I finally got tired of hacking that into each of my themes when I switch them around on the site, so I decided to write up a WordPress plugin.</p>

	<p>Since I&#8217;ve recently been playing with DomTT tooltips for my ubernyms plugin, I figured I&#8217;d go ahead and take the time to add that to the Huddled Parser plugin as well, so you have several options for what to do with the images and descriptions that are in the feed (show them inline, show them in DomTT tooltips, or don&#8217;t show them). I&#8217;ve been careful to make this work with ubernyms, but I had to make a new release of that to keep them from both inserting the DomTT javascript (so, if you also use ubernyms, please go upgrade that to Version: 2.3 before installing this).</p>

	<p>You can <a href="http://www.huddledmasses.org/wp-content/plugins/huddledparser.zip">download it here</a>, and I&#8217;ve included some base <span class="caps">CSS</span> you can modify, and plenty of options for parsing feeds: from limiting the length of the snippets of content, and headlines, to setting the maximum number of items you pull from each feed.  To get the feeds to actually show up on your page, you just add a single line to your template: <code>&#60; ?php get_huddledparser_feeds_list(); ?&#62;</code></p>

	<p>The biggest thing, however, is that this plugin cache&#8217;s everything religiously. The result of that is that you can control how often the feed gets fetched from the server to avoid pounding other people&#8217;s servers, and to avoid too much slow-down on your own site as well. The best part is that not only do the feeds get cached, but the images get cached locally too.</p>

	<h4><strong>Edit</strong> July 23, 2006]</h4>

	<p>Clearly, I&#8217;m a bit of a nincompoop sometimes, I left out a bit in this description, so here are the answers to the most frequent questions.</p>

	<p>You should unpack the whole folder into your WordPress plugins directory, including the huddledparser.php plugin and the css file, especially if you want to use the feed css or domTT tooltips and it&#8217;s css.  </p>

	<p>The two feeds (currently) on my front page are both coming from the plugin and are styled entirely with <span class="caps">CSS</span>.  You should be able to style yours any way you like, and to help you there are two special features: You can pass in a class name that will be added to the list (to the <code>UL</code> tag), like: <code>get_huddledparser_feeds_list( &#34;HPFeeds&#34; );</code> And a sanitized domain (the domain of the feed) will be added as a class on that same <code>ul</code>, so if you had <a href="http://flickr.com/services/feeds/photos_public.gne?id=33103226@N00&#38;format=rss_200">my flickr photos feed</a>, in your feed list, and had passed &#8220;HPFeeds&#8221; as the class,the complete class list rendered would be: <code>HPFeeds flickrcom</code> so you can target each feed with your <span class="caps">CSS</span>, even if you&#8217;re parsing multiple feeds, as I do.</p>]]></content:encoded>
			<wfw:commentRss>http://huddledmasses.org/huddled-parser-the-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HuddledParser 2.0</title>
		<link>http://huddledmasses.org/huddledparser2/</link>
		<comments>http://huddledmasses.org/huddledparser2/#comments</comments>
		<pubDate>Tue, 18 Jan 2005 18:27:12 +0000</pubDate>
		<dc:creator>Joel 'Jaykul' Bennett</dc:creator>
				<category><![CDATA[Huddled]]></category>
		<category><![CDATA[Huddled Masses]]></category>
		<category><![CDATA[HuddledParser]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.huddledmasses.org/2005/01/18/huddleparser-20/</guid>
		<description><![CDATA[A long time ago, on a domain not my own, I wrote a PHP parser that handled pretty much all versions of RSS/RDF xml feeds. I released it for free, and a few people used it. It wasn&#8217;t pretty code, but it was small, and it was easy to use, and it didn&#8217;t care what [...]]]></description>
			<content:encoded><![CDATA[	<p>A long time ago, on a domain not my own, I wrote a <span class="caps">PHP</span> parser that handled pretty much all versions of RSS/<span class="caps">RDF</span> xml feeds.  I released it for free, and a few people used it.  It wasn&#8217;t pretty code, but it was small, and it was easy to use, and it didn&#8217;t care what sort of feeds you threw at it., it just chewed them up and spat out links.  In fact, it didn&#8217;t even care if those feeds validated perfectly.</p>

	<p>Today I&#8217;m releasing the first ever upgrade of that script.</p>

	<p><span id="more-166"></span>HuddledParser is still written in <span class="caps">PHP</span> (tested in <span class="caps">PHP</span> 4.x), but now it is object oriented, and  <img src='http://huddledmasses.org/wordpress/wp-includes/' alt='[new]' class='wp-smiley' />  it handles <span class="caps">ATOM</span> feeds as well.  (tada!) Now, just to be clear:  this is still not a fancy-shmancy feed formatter.  I made it object oriented because it saves me some code and a bunch of nasty global variables.</p>

	<p>HuddledParser doesn&#8217;t try to present <em>all</em> the data that is in a feed; that&#8217;s not it&#8217;s purpose. Rather, it creates a headline summary from a feed by grabbing the title, link and summary for the feed, and for each entry, (regardless of feed format), and putting them into a list for you. You have the option of specifying a maximum number of entries to parse, and even a maximum length for the &#8220;summaries&#8221; so you can cut feeds like LockerGnome&#8217;s full content feeds down to a size that you can feel comfortable putting in a sidebar on your web page.  And you never have to worry about other site&#8217;s feeds breaking your layout, because all the <span class="caps">HTML</span> is stripped from their content (even if they specify a <span class="caps">CDATA</span> section).</p>

	<p>Feel free to <a href="/scripting/HuddledParser2.zip">grab the source</a> and play with it.  Please let me know if you have any problems, or encounter any feeds that it cannot parse.</p>

	<p>Before I go into details on how to use this script, let me say this: there&#8217;s still one thing I&#8217;d like this to do that it doesn&#8217;t do now.  Currently, when you call ParseURL(...) you get text back which corresponds to the selected information.  What I&#8217;d like to do is make it so that you could call ParseURL(...) multiple times, and it would nest all that data inside a list of lists.  Then, when you wanted to output the feeds, you could call .ToHTML(...), or you could enumerate through the nested lists yourself (say, if you wanted to create <span class="caps">DHTML</span> menus or combo-boxes or something).  But that will wait until the next version.</p>

	<p>Basically, it works like this:</p>

	<div class="php code php" style="font-family:monospace;"><br />
<span style="color: #b1b100;">include</span> <span style="color: #0000ff;">&quot;HuddledParser2.php&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$feedParser</span><span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HuddledParser<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.php.net/print"><span style="color: #990000;">print</span></a> &nbsp;<span style="color: #000088;">$feedParser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ParseFeed</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;http://www.HuddledMasses.org/feed/rss2/&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;HMO&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;</div>

	<p>The two required arguments for the HuddledParser constructor are the maximum number of entries to fetch per-feed, and whether or not to show the &#8220;summary&#8221; of the entries (the summary will still be inserted as the &#8220;title&#8221; attribute of each link, but it won&#8217;t clutter your page up).  The two required arguments for the ParseFeed function are the <span class="caps">URL</span> of the feed, and a unique name for that feed (for the cache file).  There are several optional arguments for each:</p>

	<p>HuddledParser( $maxEntries, $showSummary, $cacheFolder, $cacheTime, $titleLimit, $summaryLimit )</p>

	<ul>
		<li><strong>maxEntries</strong>    &#8211; A number. The maximum number of entries to retrieve</li>
		<li><strong>showSummary</strong>   &#8211; A boolean (true or false).  Whether or not to print out the summaries in divs under each entry title.</li>
		<li><strong>cacheFolder</strong>   &#8211; A path.   Defaults to an &#8220;xmlcache/&#8221; subfolder of the folder it&#8217;s called from.  This must be writeable, so we can store our cache files there.</li>
		<li><strong>cacheTime</strong>     &#8211; A number. The number of seconds before we consider our cache &#8220;old&#8221; and refetch the feed.  Defaults to 3600 (one hour).</li>
		<li><strong>titleLimit</strong>    &#8211; A number. The maximum length (in characters) of titles.  Note: we do not cut words off, so this is approximate.  Defaults to -1, no limit.</li>
	</ul>
	<ul>
		<li><strong>summaryLimit</strong>  &#8211; A number. The maximum length (in characters) of summaries.  Note: we do not cut words off, so this is approximate.  Defaults to -1, no limit.</li>
	</ul>

	<p>ParseFeed( $url, $cacheName, $title, $summary, $maxEntries, $cacheTime )</p>

	<ul>
		<li><strong>url</strong>        &#8211; A <span class="caps">URL</span>.       The <span class="caps">URL</span> of the xml feed to parse</li>
		<li><strong>cacheName</strong>  &#8211; A file name. The name of a file to store a cache in, this must be unique to each feed.</li>
		<li><strong>title</strong>      &#8211; Text.        Allows you to override the title of the feed</li>
		<li><strong>summary</strong>    &#8211; Text.        Allows you to override the summary of the feed contents</li>
		<li><strong>maxEntries</strong> &#8211; A number.    Override (for this feed) the maximum number of entries to fetch</li>
	</ul>
	<ul>
		<li><strong>cacheTime</strong>  &#8211; A number.    Override (for this feed) the number of seconds to consider our cache &#8220;fresh&#8221;</li>
	</ul>

	<h3>Edit: May 11, 2006</h3>

	<p>This script is now also <a href="http://www.huddledmasses.org/jaykul/huddled-parser-the-wordpress-plugin/">available as a WordPress plugin</a></p>]]></content:encoded>
			<wfw:commentRss>http://huddledmasses.org/huddledparser2/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

