<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>The Tlog - a technology blog &#187; Programming</title>
	<atom:link href="http://www.thetlog.net/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thetlog.net</link>
	<description></description>
	<lastBuildDate>Fri, 18 Mar 2011 11:10:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/2.5/pt/</creativeCommons:license>		<item>
		<title>I&#8217;ve never had to scale</title>
		<link>http://www.thetlog.net/2007/09/12/ive-never-had-to-scale/</link>
		<comments>http://www.thetlog.net/2007/09/12/ive-never-had-to-scale/#comments</comments>
		<pubDate>Wed, 12 Sep 2007 13:49:05 +0000</pubDate>
		<dc:creator>Pedro Timóteo</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.thetlog.net/2007/09/12/ive-never-had-to-scale/</guid>
		<description><![CDATA[No, I&#8217;m not talking about my sex life, or anything like that. It&#8217;s just this: I&#8217;ve never had a site in the past that had too much success for its own good, and that, therefore, had scalability problems. Each one of my sites has either used some popular, usually well optimized software (say, WordPress or [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.thetlog.net/2007/09/12/ive-never-had-to-scale/" data-text="I&#8217;ve never had to scale" data-count="" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-vertical"><script>
			<!-- 
			var fbShare = {
				url: "http://www.thetlog.net/2007/09/12/ive-never-had-to-scale/",
				size: "large",
				google_analytics: "true"
			}
			//-->
			</script>
                        <script src="http://widgets.fbshare.me/files/fbshare.js"></script></div></div><p>No, I&#8217;m not talking about my sex life, or anything like that. <img src='http://www.thetlog.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It&#8217;s just this: I&#8217;ve never had a site in the past that had too much success for its own good, and that, therefore, had <em>scalability</em> problems. Each one of my sites has either used some popular, usually well optimized software (say, WordPress or MyBB), or was mostly a bunch of static HTML pages. Neither of which, I believe, have &#8220;scalability &#8220;problems; the Internet connection or the web server itself <small>(due to the number of simultaneous requests, not really related to what the app does)</small> will complain long before &#8220;scalability&#8221; enters into it. And, sorry to say, except for a bunch of occasional Digg / Shoutwire / Stumbleupon / Reddit effects, none of my sites was ever truly &#8220;stressed&#8221;.</p>
<p>That, I hope, is about to change.</p>
<p>For my next project (which is about 75% complete) is a site that <b><i>may</i></b> well have scalability problems. Which is good, because I&#8217;ll learn about them, and how to cope with them.</p>
<p>What&#8217;s that project about? It&#8217;s a surprise. <img src='http://www.thetlog.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Suffice to say that, as far as I know, there&#8217;s only another one out there, and, weeks ago, it had to shut down its &#8220;free&#8221; version because it couldn&#8217;t deal with its success. On its first days it was quick, then soon it changed into <i>&#8220;don&#8217;t wait; we&#8217;ll email you when the report is ready&#8221;</i> mode, and finally the free version went under.</p>
<p>Now, I&#8217;m not a full-blown company, I&#8217;m <i>&#8220;just zis guy, you know&#8221;</i>, and I don&#8217;t believe I&#8217;ll have as much success as that one has / had. But&#8230; there <i><b>is</b></i> a demand; what happened to it is proof of that. And it&#8217;s quite possible that my code won&#8217;t scale.</p>
<p>I kind of hope it doesn&#8217;t. <img src='http://www.thetlog.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<hr/>Copyright &copy; 2012 <strong><a href="http://www.thetlog.net">The Tlog - a technology blog</a></strong> ]]></content:encoded>
			<wfw:commentRss>http://www.thetlog.net/2007/09/12/ive-never-had-to-scale/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>More additions to the PA top Technorati ranks table</title>
		<link>http://www.thetlog.net/2007/05/25/more-additions-to-the-pa-top-technorati-ranks-table/</link>
		<comments>http://www.thetlog.net/2007/05/25/more-additions-to-the-pa-top-technorati-ranks-table/#comments</comments>
		<pubDate>Fri, 25 May 2007 20:23:05 +0000</pubDate>
		<dc:creator>Pedro Timóteo</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Search engine optimization (SEO)]]></category>
		<category><![CDATA[Unix / Linux / *BSD software]]></category>
		<category><![CDATA[alexa]]></category>
		<category><![CDATA[pagerank]]></category>
		<category><![CDATA[planet-atheism]]></category>
		<category><![CDATA[technorati]]></category>

		<guid isPermaLink="false">http://www.thetlog.net/2007/05/25/more-additions-to-the-pa-top-technorati-ranks-table/</guid>
		<description><![CDATA[The top technorati ranks table for Planet Atheism members has been improved again. In addition to showing the Technorati rank, number of incoming links (from Technorati as well), and Google Pagerank, the table now shows Alexa ranks as well. You can now also click on any of the above column titles to sort the table [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.thetlog.net/2007/05/25/more-additions-to-the-pa-top-technorati-ranks-table/" data-text="More additions to the PA top Technorati ranks table" data-count="" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-vertical"><script>
			<!-- 
			var fbShare = {
				url: "http://www.thetlog.net/2007/05/25/more-additions-to-the-pa-top-technorati-ranks-table/",
				size: "large",
				google_analytics: "true"
			}
			//-->
			</script>
                        <script src="http://widgets.fbshare.me/files/fbshare.js"></script></div></div><p>The <b><a href="http://planetatheism.com/technorati/tr-show.php">top technorati ranks table for Planet Atheism members</a></b> has been improved again. <img src='http://www.thetlog.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  In addition to showing the Technorati rank, number of incoming links (from Technorati as well), and Google Pagerank, the table now shows <a href="http://www.alexa.com/">Alexa ranks</a> as well.</p>
<p>You can now also click on any of the above column <b>titles</b> to sort the table by that particular value/rank. Incoming links and Pagerank are &#8220;the more, the merrier&#8221;, while Technorati rank and Alexa rank are &#8220;the lower, the better&#8221;, so sorting takes that into account.</p>
<p>A note of warning: I&#8217;ve mentioned before that you shouldn&#8217;t really take any of these ranks too seriously, and this is especially true for the <i>Alexa</i> ranks. Alexa is a nice idea (it&#8217;s the only one that measures <i>traffic</i> instead of incoming links), but it has the following problems:
<ul>
<li>it only counts hits if the user has installed either the <a href="http://www.alexa.com/site/download?qterm=">Alexa toolbar</a> (for Internet Explorer) or the <a href="http://www.quirk.biz/searchstatus/">SearchStatus Firefox extension</a> <small>(I recommend the latter, since, as everyone knows, MSIE sucks)</small>, and</li>
<li>it often lumps all subdomains for a particular domain together <small>(i.e. doesn&#8217;t distinguish between aaa.domain.com and bbb.domain.com, even though they may be totally unrelated)</small>. It apparently has some hard coded exceptions for <b>some</b> (not all) blogspot.com blogs&#8230; but the values aren&#8217;t really reliable. Still, you can use it to measure the changes in traffic for <b>one</b> site.</li>
</ul>
<p>Incidentally, the application I&#8217;ve coded (and have been improving) to generate this table from a list of blogs is almost ready for public release. <img src='http://www.thetlog.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<hr/>Copyright &copy; 2012 <strong><a href="http://www.thetlog.net">The Tlog - a technology blog</a></strong> ]]></content:encoded>
			<wfw:commentRss>http://www.thetlog.net/2007/05/25/more-additions-to-the-pa-top-technorati-ranks-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adventures with my Technorati ranks &quot;toy&quot;</title>
		<link>http://www.thetlog.net/2007/05/23/adventures-with-my-technorati-ranks-toy/</link>
		<comments>http://www.thetlog.net/2007/05/23/adventures-with-my-technorati-ranks-toy/#comments</comments>
		<pubDate>Wed, 23 May 2007 23:18:10 +0000</pubDate>
		<dc:creator>Pedro Timóteo</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[technorati-ranks]]></category>

		<guid isPermaLink="false">http://www.thetlog.net/2007/05/23/adventures-with-my-technorati-ranks-toy/</guid>
		<description><![CDATA[As I mentioned here before, a couple of days ago I coded a program to take an OPML file and generate a table in which the sites listed on that file appear ordered by Technorati ranks. It also shows the number of incoming links (again, from Technorati), and each site&#8217;s PageRank. (By the way: no, [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.thetlog.net/2007/05/23/adventures-with-my-technorati-ranks-toy/" data-text="Adventures with my Technorati ranks &quot;toy&quot;" data-count="" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-vertical"><script>
			<!-- 
			var fbShare = {
				url: "http://www.thetlog.net/2007/05/23/adventures-with-my-technorati-ranks-toy/",
				size: "large",
				google_analytics: "true"
			}
			//-->
			</script>
                        <script src="http://widgets.fbshare.me/files/fbshare.js"></script></div></div><p>As I mentioned here <a href="http://www.thetlog.net/2007/05/21/my-technorati-ranks-toy/">before</a>, a couple of days ago I coded a program to take an OPML file and generate a <a href="http://planetatheism.com/technorati/tr-show.php">table</a> in which the sites listed on that file appear ordered by <strong><a href="http://www.technorati.com/">Technorati</a> ranks</strong>. It also shows the number of <strong>incoming links</strong> (again, from Technorati), and each site&#8217;s <strong>PageRank</strong>.</p>
<p><small>(By the way: no, this is not ready for release yet. But it will be. Soon.)</small></p>
<p>Initially, the data collecting part of my program started by clearing a table in a MySQL database, which would then be filled with the values it would get from Technorati and Google. However, this had two problems:</p>
<ol>
<li>Technorati allows only a <em>limited number</em> of accesses per day. I discovered it when I was making several tests, and, after about half a dozen or so, it stopped giving me data. The problem, then, was that it had already cleared the table&#8230; so I ended up with an empty one.</li>
<li>From time to time, Technorati gives me &#8220;wrong&#8221; ranks / links for a blog &#8211; values much <em>lower</em> (but not absurd / &#8220;bogus&#8221;, just wrong) than what they should be. It&#8217;s weird, and not reproducible, and usually, by asking TR again, the correct value is then returned.</li>
</ol>
<p>To solve the first problem, obviously, some form of keeping the data from the previous run while getting the new values was in order, so that, if Technorati told me to get stuffed, I would still have the data from the day before.</p>
<p>The second problem was a little more complicated, though, in a way, the solution to the first helped me crack it.</p>
<p>My method was this: when running the script, start by copying the original table to another (let&#8217;s call it <code>temp1</code>) and clearing the original table. Then get the new data to yet another table (<code>temp2</code>). Afterwards, regenerate the original table with data from <code>temp1</code> and <code>temp2</code>, the following way:</p>
<ul>
<li>if an entry (identified by the site&#8217;s URL) exists in only <em>one</em> of the tables, use it.</li>
<li>if an entry exists in <em>both</em>, use the common values (URL, site&#8217;s name), and for the 3 numeric values, choose the <b>best</b> value (from the two tables) for each. &#8220;Best&#8221; means the highest # of incoming links, the highest PageRank, and the lowest Technorati rank.</li>
</ul>
<p>This way, if once in a while Technorati gives it a much worse value than it should (I&#8217;ve never seen it rate a blog <i>better</i> than the reality), it still has a more correct value to use instead.</p>
<p>Sounds fine, doesn&#8217;t it? But there&#8217;s a problem with this method&#8230; which I solved later, but which I&#8217;ll discuss the next post. Until then&#8230; any guesses as to what it was? <img src='http://www.thetlog.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<hr/>Copyright &copy; 2012 <strong><a href="http://www.thetlog.net">The Tlog - a technology blog</a></strong> ]]></content:encoded>
			<wfw:commentRss>http://www.thetlog.net/2007/05/23/adventures-with-my-technorati-ranks-toy/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>My Technorati ranks &quot;toy&quot;</title>
		<link>http://www.thetlog.net/2007/05/21/my-technorati-ranks-toy/</link>
		<comments>http://www.thetlog.net/2007/05/21/my-technorati-ranks-toy/#comments</comments>
		<pubDate>Mon, 21 May 2007 11:26:27 +0000</pubDate>
		<dc:creator>Pedro Timóteo</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Unix / Linux / *BSD software]]></category>
		<category><![CDATA[pagerank]]></category>
		<category><![CDATA[planet-atheism]]></category>
		<category><![CDATA[technorati-ranks]]></category>

		<guid isPermaLink="false">http://www.thetlog.net/2007/05/21/my-technorati-ranks-toy/</guid>
		<description><![CDATA[Inspired by Carlos Andrade&#8216;s own tool, I&#8217;ve just coded a couple of scripts to take an OPML file and show an ordered table of Technorati ranks. Naturally, I used it for my own Planet site, Planet Atheism. Here it is: Technorati Ranks for Planet Atheism members The implementation was ridiculously simple (and there&#8217;s a lot [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.thetlog.net/2007/05/21/my-technorati-ranks-toy/" data-text="My Technorati ranks &quot;toy&quot;" data-count="" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-vertical"><script>
			<!-- 
			var fbShare = {
				url: "http://www.thetlog.net/2007/05/21/my-technorati-ranks-toy/",
				size: "large",
				google_analytics: "true"
			}
			//-->
			</script>
                        <script src="http://widgets.fbshare.me/files/fbshare.js"></script></div></div><p>Inspired by <a href="http://blog.karlus.net/">Carlos Andrade</a>&#8216;s own <a href="http://dev.karlus.net/asteriscoRanks/">tool</a>, I&#8217;ve just coded a couple of scripts to take an OPML file and show an ordered table of <a href="http://www.technorati.com/">Technorati</a> ranks. Naturally, I used it for my own Planet site, <a href="http://planetatheism.com/">Planet Atheism</a>.</p>
<p>Here it is: <a href="http://planetatheism.com/technorati/tr-show.php">Technorati Ranks for Planet Atheism members</a></p>
<p>The implementation was ridiculously simple <small>(and there&#8217;s a lot of room for improvement)</small>, but, other than Carlos&#8217; tool, I didn&#8217;t find any scripts or utilities to do this. And, yes, I searched. Therefore I may release the code soon, as the 2nd project on <a href="http://software.dehumanizer.com/">software.dehumanizer.com</a>, since this can be a fun &#8220;toy&#8221;. <img src='http://www.thetlog.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>[<b>EDIT</b>: added each blog's Google <a href="http://en.wikipedia.org/wiki/PageRank">PageRank</a> to the table. Why not? <img src='http://www.thetlog.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ]</p>
<hr/>Copyright &copy; 2012 <strong><a href="http://www.thetlog.net">The Tlog - a technology blog</a></strong> ]]></content:encoded>
			<wfw:commentRss>http://www.thetlog.net/2007/05/21/my-technorati-ranks-toy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Announcing DailyTasks 0.1</title>
		<link>http://www.thetlog.net/2007/02/09/announcing-dailytasks-01/</link>
		<comments>http://www.thetlog.net/2007/02/09/announcing-dailytasks-01/#comments</comments>
		<pubDate>Fri, 09 Feb 2007 11:37:36 +0000</pubDate>
		<dc:creator>Pedro Timóteo</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Unix / Linux / *BSD software]]></category>
		<category><![CDATA[daily-tasks]]></category>
		<category><![CDATA[DailyTasks]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[task-management]]></category>

		<guid isPermaLink="false">http://www.thetlog.net/2007/02/09/announcing-dailytasks-01/</guid>
		<description><![CDATA[A few minutes ago, I submitted my first piece of software to Freshmeat (it hasn&#8217;t been approved yet; it will probably take a few hours): DailyTasks. It&#8217;s a small utility, written in PHP, with both a command line mode and a web interface, which, surprisingly enough, reminds you of daily tasks. The web page linked [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.thetlog.net/2007/02/09/announcing-dailytasks-01/" data-text="Announcing DailyTasks 0.1" data-count="" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-vertical"><script>
			<!-- 
			var fbShare = {
				url: "http://www.thetlog.net/2007/02/09/announcing-dailytasks-01/",
				size: "large",
				google_analytics: "true"
			}
			//-->
			</script>
                        <script src="http://widgets.fbshare.me/files/fbshare.js"></script></div></div><p>A few minutes ago, I submitted my first piece of software to <a href="http://freshmeat.net/">Freshmeat</a> <small>(it hasn&#8217;t been approved yet; it will probably take a few hours)</small>: <a href="http://software.dehumanizer.com/dailytasks/">DailyTasks</a>. It&#8217;s a small utility, written in PHP, with both a command line mode and a web interface, which, surprisingly enough, reminds you of daily tasks. <img src='http://www.thetlog.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The web page linked above tells the &#8220;story&#8221; in more detail, but, basically, I&#8217;m much too chaotic to use traditional task management programs (every time I tried, I seemed to spend more time updating tasks than actually <i>doing</i> them), but I wanted something to remind me, every day, of doing something &#8212; from <em>&#8220;clean up GMail&#8217;s spam folder&#8221;</em> through <em>&#8220;update a blog&#8221;</em> to <em>&#8220;do the laundry, if necessary&#8221;</em>. <img src='http://www.thetlog.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  There was already a similar program (<a href="http://ftr.berlios.de/">frequent-task-reminder</a>), but it lacked some features that I wanted (such as non-accumulating tasks), and so I wrote my own.</p>
<p>It&#8217;s really basic stuff, with no bells and whistles, and the PHP code would probably scare you, so impressionable young people should avoid looking at it. <img src='http://www.thetlog.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  But maybe &#8212; just maybe &#8212; you&#8217;ll find it useful.</p>
<hr/>Copyright &copy; 2012 <strong><a href="http://www.thetlog.net">The Tlog - a technology blog</a></strong> ]]></content:encoded>
			<wfw:commentRss>http://www.thetlog.net/2007/02/09/announcing-dailytasks-01/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adventures with moonmoon and tidy</title>
		<link>http://www.thetlog.net/2007/02/06/adventures-with-moonmoon-and-tidy/</link>
		<comments>http://www.thetlog.net/2007/02/06/adventures-with-moonmoon-and-tidy/#comments</comments>
		<pubDate>Tue, 06 Feb 2007 12:52:33 +0000</pubDate>
		<dc:creator>Pedro Timóteo</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Systems administration]]></category>
		<category><![CDATA[Unix / Linux / *BSD software]]></category>

		<guid isPermaLink="false">http://www.thetlog.net/2007/02/06/adventures-with-moonmoon-and-tidy/</guid>
		<description><![CDATA[As I&#8217;ve mentioned here before, for Planet Atheism I&#8217;m using moonmoon, mostly because 1) everyone else uses planetplanet, and 2) it&#8217;s in PHP instead of Python, and I know a little PHP. moonmoon is still on version 0.2, however, and, while it removes &#8220;dangerous&#8221; tags from feeds automatically, it doesn&#8217;t (yet?) deal with unclosed tags. [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.thetlog.net/2007/02/06/adventures-with-moonmoon-and-tidy/" data-text="Adventures with moonmoon and tidy" data-count="" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-vertical"><script>
			<!-- 
			var fbShare = {
				url: "http://www.thetlog.net/2007/02/06/adventures-with-moonmoon-and-tidy/",
				size: "large",
				google_analytics: "true"
			}
			//-->
			</script>
                        <script src="http://widgets.fbshare.me/files/fbshare.js"></script></div></div><p>As I&#8217;ve mentioned here before, for <a href="http://planetatheism.com/">Planet Atheism</a> I&#8217;m using <a href="http://moonmoon.org/">moonmoon</a>, mostly because 1) everyone else uses planetplanet, and 2) it&#8217;s in PHP instead of Python, and I know a little PHP. <img src='http://www.thetlog.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>moonmoon is still on version 0.2, however, and, while it removes &#8220;dangerous&#8221; tags from feeds automatically, it doesn&#8217;t (yet?) deal with <b>unclosed</b> tags. As most of PA&#8217;s members are as far from being geeks as possible, they tend to use WYSIWYG editors, and aren&#8217;t really worried about &#8220;validating HTML&#8221;. So, from time to time, a post would make every other post after it show in <b>bold</b> or <i>italic</i>. Annoying, to say the least.</p>
<p>Yesterday, it was even worse: some posts &#8220;spilled over&#8221; to the sidebar. And it wasn&#8217;t just one post causing it, but two, from different blogs, at the same time!</p>
<p>Well, enough was enough.</p>
<p>&#8220;Fixing&#8221; moonmoon (or, more precisely, <a href="http://simplepie.org/">SimplePie</a>) was out of the question; I simply don&#8217;t know enough PHP / XML parsing to do it. But I tried something else: I saved the generated HTML to a file on the site&#8217;s directory, and used <a href="http://tidy.sourceforge.net/">tidy</a> on it. Surprise: this new version was perfect! So, I got the idea of using tidy on the generated HTML every time.</p>
<p>Now, PHP has a <a href="http://php.net/tidy">tidy module</a>, but in PHP5 I would have to compile PHP by hand. Ubuntu doesn&#8217;t have a package for that module, unfortunately, and I really didn&#8217;t want to make an exception from using <code>apt</code> packages on that server. So, I had to find another way.</p>
<p>My solution was to dump all the page into a buffer (using the <code>ob_</code> functions in PHP), save it to a temporary file, use the <code>system</code> command to apply tidy on it, load the altered file, and show it to the browser. It&#8217;s probably not very efficient, but it <i>works</i>&#8230; better than I expected, too. It may be a crude solution, but I&#8217;m proud of it anyway. <img src='http://www.thetlog.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<hr/>Copyright &copy; 2012 <strong><a href="http://www.thetlog.net">The Tlog - a technology blog</a></strong> ]]></content:encoded>
			<wfw:commentRss>http://www.thetlog.net/2007/02/06/adventures-with-moonmoon-and-tidy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

