<?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>RPS &#187; popurls alltop simplepie php</title>
	<atom:link href="http://www.delic.com/blog/tag/popurls-alltop-simplepie-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.delic.com/blog</link>
	<description>The view from here</description>
	<lastBuildDate>Tue, 22 Feb 2011 12:01:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Building your own Alltop or PopURLs*</title>
		<link>http://www.delic.com/blog/2008/04/11/building-your-own-alltop-or-popurls/</link>
		<comments>http://www.delic.com/blog/2008/04/11/building-your-own-alltop-or-popurls/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 13:21:09 +0000</pubDate>
		<dc:creator>rshah21</dc:creator>
				<category><![CDATA[Researching]]></category>
		<category><![CDATA[popurls alltop simplepie php]]></category>

		<guid isPermaLink="false">http://www.delic.com/blog/?p=55</guid>
		<description><![CDATA[For a while, I have been using PopURLs as a quick and dirty way of scanning interesting websites for what&#8217;s new. It is not a RSS reader substitute, but if I have a couple of minutes and just want to see something new, it&#8217;s a good spot to stop. A few weeks ago, with a [...]]]></description>
			<content:encoded><![CDATA[<p>For a while, I have been using <a href="http://www.popurls.com">PopURLs</a> as a quick and dirty way of scanning interesting websites for what&#8217;s new.  It is not a RSS reader substitute, but if I have a couple of minutes and just want to see something new, it&#8217;s a good spot to stop.  A few weeks ago, with a few free cycles, I wondered just how difficult it would be to roll my own.  Nothing as pretty, but something that would give me some exposure to what&#8217;s under the covers.></p>
<p>A couple of days ago, buzz started to build around <a href-"http://www.alltop.com">Alltop</a> which was built by Guy Kawasaki&#8217;s Nononina, also behind the site <a href="http://www.truemors.com">Truemors</a>.  Alltop is a very pretty site with a wide variety of content, but it too is based on the same content (and looking at the page sources, potentially the same code base).</p>
<p>If you want to build your own, I offer you my findings, code and lessons learned<br />
<!-- technorati tags start -->
<p style="text-align:right;font-size:10px;">Technorati Tags: <a href="http://www.technorati.com/tag/php" rel="tag">php</a>, <a href="http://www.technorati.com/tag/popurls" rel="tag">popurls</a>, <a href="http://www.technorati.com/tag/alltop" rel="tag">alltop</a></p>
<p><!-- technorati tags end --><br />
<span id="more-55"></span></p>
<h2>The source code:</h2>
<p>As this is a quick and dirty implementation, I apologize if the code base contains some minor bad practices.  In most cases, I&#8217;ve adhered to standards that should allow you to unzip and deploy, but if something doesn&#8217;t quite work, take a look at the code.  It was intended to be deployed on the URL <a href="http://news.delic.com">news.delic.com</a> so take a look for any part of that string if paths don&#8217;t work.</p>
<p class="alert">Please leave all of the GPL, BSD, CC and other licenses in the code intact, if you publish this.  Any changes I have made to the code are extensions of these licenses. You are free to reuse any code I have written, but if there&#8217;s a license embedded in there, you should leave it there.</p>
<p class="download"><a href="/static/delic_news_source.zip">News aggregation source code</a> (zip format, 490Kb)
</p>
<h2>System components (aka. &#8220;the credits&#8221;) and requirements</h2>
<p>If you are interested in rolling your own version of the <a href="http://news.delic.com" title="Delic News Aggregator">aggregator</a>, I have listed the components below, along with links to some of the relevant installation instructions and documentation</p>
<h3>PHP:</h3>
<ul><strong>PHP core components &#8211; minimum</strong></p>
<li> <a href="http://php.net/" title="http://php.net/"  rel="nofollow">PHP</a> 4.3 or higher (including <acronym title="Hypertext Preprocessor">PHP</acronym> 5)</li>
<li> <acronym title="Hypertext Preprocessor">PHP</acronym>&#8216;s <a href="http://php.net/xml" title="http://php.net/xml"  rel="nofollow">XML extension</a> (enabled by default)</li>
<li> <acronym title="Hypertext Preprocessor">PHP</acronym>&#8216;s <a href="http://php.net/pcre" title="http://php.net/pcre"  rel="nofollow">PCRE extension</a> (enabled by default)</li>
<li> Either <acronym title="Hypertext Preprocessor">PHP</acronym's <a href="http://php.net/mbstring" title="http://php.net/mbstring"  rel="nofollow">multibyte string extension</a> OR <a href="http://php.net/iconv"title="http://php.net/iconv"  rel="nofollow">iconv extension</a>. There is a bug in the current version of SimplePie one or the other.</li>
</ul>
<ul><strong>PHP core components &#8211; recommended</strong></p>
<li> Ability to change file/folder permissions (dependent on how much access your host provides)</li>
<li> Both <acronym title="Hypertext Preprocessor">PHP</acronym>&#8216;s <a href="http://php.net/mbstring" title="http://php.net/mbstring"  rel="nofollow">multibyte string extension</a> AND <a href="http://php.net/iconv" title="http://php.net/iconv"  rel="nofollow">iconv extension</a>.</li>
<li> <acronym title="Hypertext Preprocessor">PHP</acronym>&#8216;s <a href="http://php.net/curl" title="http://php.net/curl"  rel="nofollow">cURL extension</a> (disabled by default)</li>
<li> <acronym title="Hypertext Preprocessor">PHP</acronym>&#8216;s <a href="http://php.net/zlib" title="http://php.net/zlib"  rel="nofollow">Zlib extension</a> (disabled by default)</li>
</ul>
<p class="information">If you are hosted on <A href="http://www.dreamhost.com">Dreamhost</a> and running PHP 5+, you will have all of the minimum and recommended components listed above available to you via the php5 default install.</p>
<ul><strong><a href="http://simplepie.org/" title="SimplePie RSS Aggregator">SimplePie</a></strong></p>
<li>The <acronym title="Hypertext Preprocessor">PHP</acronym> <a href="http://simplepie.org/downloads/" title="SimplePie Download">install</a>for SimplePie.  Installation instructions (if you are rolling your own from scratch) begin <a href="http://simplepie.org/wiki/setup/start" title="SimplePie Install Instructions">here</a></li>
<li>The SimplePie <a href="http://simplepie.org/mint/pepper/orderedlist/downloads/download.php?file=http%3A//simplepie.org/downloads/newsblocks_demo.zip" title="Newsblocks Demo Source">Newsblocks Demo Source</a>.  The documentation for the demo is also <a href="http://simplepie.org/wiki/tutorial/how_to_replicate_popurls" title="Newsblocks Demo Documentation">available</a></li>
</ul>
<h3> Javascript </h3>
<ul>
<li>The SimplePie Newsblocks Demo contains <a href="http://www.prototypejs.org/" title="Prototype Javascript Library">Prototype</a>, <a href="http://script.aculo.us/" title="Script.aculo.us Javascript Library">Script.aculo.us</a>, and <a href="http://www.bennolan.com/behaviour/" title="Behaviour Javascript Library">Behaviour.js</a>, along with <a href="http://www.dustindiaz.com/sweet-titles-finalized/" title="Dustin Diaz's SweetTitles Javascript Library">SweetTitles</a>.  I have replaced SweetTitles with the jQuery based ClueTip (see below) due to some text flicker issues on <a href="http://www.mozilla.com" title="Firefox">Firefox</a>. </li>
<li><a href="http://plugins.learningjquery.com/cluetip/" title="Cluetip - a jQuery based tooltip plugin">Cluetip</a>, which is a<a href="http://jquery.com/" title="jQuery Javascript Library">jQuery</a> based tooltip replacement.  The Cluetip <a href="http://plugins.jquery.com/project/cluetip/" title="Cluetip download">download</a> has all of the jQuery libraries needed (jquery 1.2.2 minimized, dimensions, hoverIntent and cluetip).  Since both prototype and jQuery are being used, you will need to run jQuery in noConflict mode. </li>
</ul>
<h3><acronym title="Cascading Style Sheets">CSS</acronym>/Theme</h3>
<ul>
<li> The theme used for the <a href="http://news.delic.com" title="Delic News Aggregator">aggregator</a> is based on the black style of the <a href="http://www.plaintxt.org/themes/simplr/" title="Simplr WordPress Theme">Simplr</a> theme for <a href="http://wordpress.org/" title="Wordpress blogging system">WordPress</a>, although the <a href="http://news.delic.com" title="Delic News Aggregator">aggregator</a> is not actually running WordPress. The <acronym title="Cascading Style Sheets">CSS</acronym> for the theme has been modified to work with the SimplePie scripts, and can be found <a href="http://news.delic.com/css/styleb.css" title="CSS for news.delic.com">here</a>.</li>
</ul>
<h2>Tips and tricks</h2>
<ol> Some lessons learned in using the SimplePie library:</p>
<li> Setting up feeds in index.php is extremely easy.  For most feeds, the following code will work flawlessly:</br>
<p class="code">&lt;?php echo newsblocks::render (&#8216;http://digg.com/rss/index.xml&#8217;); ?&gt;</p>
<p>The SimplePie <a href="http://simplepie.org/wiki/" title="SimplePie Documentation Wiki">Documentation</a> has all of the options one might need to increase the number of articles pulled from the feed, the cache periods, etc. </li>
<li> If you need to modify the output of the SimplePie parser (for example, to just pull the image out a feed), you need to work in the /php/includes/newsblocks.inc file.  Included in the newsblocks demo file is a function called render_wide which will return any images in the thumbnail enclosure.  If that does not work, you may need to familiarize yourself with the <acronym title="Hypertext Preprocessor">PHP</acronym> function <a href="http://us.php.net/preg_match_all" title="preg_match_all PHP function">preg_match_all</a> and <acronym title="Perl-compatible regular expressions"><a href="http://us.php.net/manual/en/book.pcre.php" title="Perl-compatible regular expressions">PCRE</a></acronym>.</li>
<p>   To get Cluetip to work, there are two necessary steps:</p>
<li> run jQuery in noConflict mode.  In the code below, the class &#8220;ctip&#8221; has been assigned to all links that have associated tips we want to show in Cluetip:
<p class="code">
	&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
     jQuery.noConflict(); </br><br />
     // Put all your code in your document ready area<br />
     jQuery(document).ready(function($){<br />
       // Do jQuery stuff using $ </br><br />
       $(&#8220;a.ctip&#8221;).cluetip({ </br><br />
	    splitTitle: &#8216;|&#8217;, // use the invoking element&#8217;s title attribute to populate the clueTip&#8230;<br />
	                     // &#8230;and split the contents into separate divs where there is a &#8220;|&#8221;<br />
	    showTitle: false // hide the clueTip&#8217;s heading<br />
	  });<br />
     });<br />
   &lt;/script&gt;
</p>
</li>
<li>Modify newsblocks.inc so that the html output for each link for each item in the rss feed contains the &#8220;ctip&#8221; class as well as the &#8220;|&#8221; delimiters for the title and body of the tooltip.  Look for the code:
<p class="code">
      $html .= &#8216;&lt;li class=&#8221;&#8216; . $class . &#8216;&#8221;&gt;&lt;a href=&#8221;&#8216; . $item->get_permalink() . &#8216;&#8221; title=&#8221;&#8216; . newsblocks::cleanup ($item->get_description(), $length) . &#8216;&#8221;&gt;&#8217; . $item->get_title() . &#8216;&lt;/a&gt; &lt;/li&gt;&#8217; . &#8220;\n&#8221;;
      </p>
<p>and change it to:</p>
<p class="code">
       $html .= &#8216;&lt;li class=&#8221;&#8216; . $class . &#8216;&#8221;&gt;&lt;a class=&#8221;ctip&#8221; href=&#8221;&#8216; . $item->get_permalink() . &#8216;&#8221; title=&#8221;|&#8217; . newsblocks::cleanup ($item->get_description(), $length) . &#8216;&#8221;&gt;&#8217; . $item->get_title() . &#8216;&lt;/a&gt; &lt;/li&gt;&#8217; . &#8220;\n&#8221;;
      </p>
</li>
</ol>
<p class="information">* = <a href="http://www.alltop.com">Alltop</a> and <a href="http://www.popurls.com">PopURLs</a> are registered trademarks and/or servicemarks of Nononina and <A href="http://thomasmarban.com/">Thomas Marban</a> respectively.  This site is not affiliated with them in any way.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delic.com/blog/2008/04/11/building-your-own-alltop-or-popurls/feed/</wfw:commentRss>
		<slash:comments>66</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.630 seconds -->

