<?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>Eli Bendersky's website &#187; Internet</title>
	<atom:link href="http://eli.thegreenplace.net/category/internet/feed/" rel="self" type="application/rss+xml" />
	<link>http://eli.thegreenplace.net</link>
	<description>Eli Bendersky's personal website</description>
	<lastBuildDate>Fri, 30 Jul 2010 12:30:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>reputation rule changes on stackoverflow</title>
		<link>http://eli.thegreenplace.net/2010/03/19/reputation-rule-changes-on-stackoverflow/</link>
		<comments>http://eli.thegreenplace.net/2010/03/19/reputation-rule-changes-on-stackoverflow/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 15:03:00 +0000</pubDate>
		<dc:creator>eliben</dc:creator>
				<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=2115</guid>
		<description><![CDATA[A few months ago I posted a rant named The surest way to gain lots of reputation on Stack Overflow &#8211; ask questions on SO Meta that got quite popular. I won&#8217;t repeat its contents here &#8211; the link has it all.
Today I was happy to find out that Jeff Atwood took my opinion into [...]


Related posts:<ol><li><a href='http://eli.thegreenplace.net/2008/09/15/stackoverflowcom-what-the-online-programming-needed/' rel='bookmark' title='Permanent Link: stackoverflow.com &#8211; what the online programming community needs ?'>stackoverflow.com &#8211; what the online programming community needs ?</a> <small>I&#8217;ve long been claiming that what makes the Perl community...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>A few months ago I posted a rant named <a class="reference external" href="http://meta.stackoverflow.com/questions/33398/the-surest-way-to-gain-lots-of-rep-on-so-ask-questions">The surest way to gain lots of reputation on Stack Overflow &#8211; ask questions</a> on <a class="reference external" href="http://meta.stackoverflow.com/">SO Meta</a> that got quite popular. I won&#8217;t repeat its contents here &#8211; the link has it all.</p>
<p>Today I was happy to find out that Jeff Atwood took <a class="reference external" href="http://meta.stackoverflow.com/questions/33398/the-surest-way-to-gain-lots-of-reputation-on-stack-overflow-ask-questions/42820#42820">my opinion into account</a> when considering the issue and <a class="reference external" href="http://blog.stackoverflow.com/2010/03/important-reputation-rule-changes/">changed the reputation rules</a> on SO to award only +5 for upvotes on questions, including a full re-calc of reputation for all SO users.</p>
<p>Although this decision is going to cost me hundreds of reputation points as I have quite a few highly-voted questions myself, I&#8217;m very happy about it. IMHO it will lead to a more balanced reputation system on SO, which is also more correct from the viewpoint of potential employers examining the reputation of SO users. SO has become a phenomenon in the past year or so, and I&#8217;m very happy about it. The new reputation rules will make it even better.</p>
<img src="http://eli.thegreenplace.net/?ak_action=api_record_view&id=2115&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://eli.thegreenplace.net/2008/09/15/stackoverflowcom-what-the-online-programming-needed/' rel='bookmark' title='Permanent Link: stackoverflow.com &#8211; what the online programming community needs ?'>stackoverflow.com &#8211; what the online programming community needs ?</a> <small>I&#8217;ve long been claiming that what makes the Perl community...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://eli.thegreenplace.net/2010/03/19/reputation-rule-changes-on-stackoverflow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On the importance of backing up your data</title>
		<link>http://eli.thegreenplace.net/2009/12/12/on-the-importance-of-backing-up-your-data/</link>
		<comments>http://eli.thegreenplace.net/2009/12/12/on-the-importance-of-backing-up-your-data/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 06:10:20 +0000</pubDate>
		<dc:creator>eliben</dc:creator>
				<category><![CDATA[Hardware & Gadgets]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software & Tools]]></category>

		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=2014</guid>
		<description><![CDATA[It seems that Jeff Atwood has experienced a 100% data loss for his blog and the stackoverflow blog.
It&#8217;s starting to come back up slowly since Jeff has succeeded recovering data from web caches and with the help of his readers.
But it&#8217;s a sobering experience, nonetheless. Placing all the Schadenfreude aside (like most of this Proggit [...]


Related posts:<ol><li><a href='http://eli.thegreenplace.net/2003/11/16/poor-mans-backup/' rel='bookmark' title='Permanent Link: poor man&#8217;s backup'>poor man&#8217;s backup</a> <small>At the SW job, all our files are on backed-up...</small></li><li><a href='http://eli.thegreenplace.net/2006/04/12/migrating-to-wordpress/' rel='bookmark' title='Permanent Link: Migrating to Wordpress'>Migrating to Wordpress</a> <small>My blog has just recently migrated from use.perl to Blogger,...</small></li><li><a href='http://eli.thegreenplace.net/2009/08/07/a-live-data-monitor-with-python-pyqt-and-pyserial/' rel='bookmark' title='Permanent Link: A &#8220;live&#8221; data monitor with Python, PyQt and PySerial'>A &#8220;live&#8221; data monitor with Python, PyQt and PySerial</a> <small>The previous couple of posts about the PySerial module for...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>It seems that Jeff Atwood has experienced a 100% data loss for his <a class="reference external" href="http://www.codinghorror.com/blog/">blog</a> and the <a class="reference external" href="http://blog.stackoverflow.com/">stackoverflow blog</a>.</p>
<p>It&#8217;s starting to come back up slowly since Jeff has succeeded recovering data <a class="reference external" href="http://superuser.com/questions/82036/recovering-a-lost-website-with-no-backup">from web caches and with the help of his readers</a>.</p>
<p>But it&#8217;s a sobering experience, nonetheless. Placing all the <a class="reference external" href="http://en.wikipedia.org/wiki/Schadenfreude">Schadenfreude</a> aside (like most of this <a class="reference external" href="http://www.reddit.com/r/programming/">Proggit thread</a>), it makes sense to take a moment of pondering to learn about what went wrong and how you can avoid it for your data. Jeff&#8217;s hosting &#8211; <a class="reference external" href="http://www.crystaltech.com/">CrystalTech</a> probably had a single point of failure for these websites, and losing a single disk wiped everything out. Jeff had backups, but those were kept on the same server.</p>
<p>My hosting for this blog (and other content, like our photos and travel log) is from <a class="reference external" href="http://www.crystaltech.com/">bluehost</a>. I remember questioning their support engineer over a chat about their backup strategies when I just started hosting with them. He told me they have backups, but they are all &quot;on-site&quot; &#8211; in some kind of a basement somewhere in Arizona. So, although there&#8217;s no single disk that can fail, a tornado can probably wipe out my website and many others.</p>
<p>This is why I&#8217;m using bluehost&#8217;s full backup ability to download a backup of my whole website once in a couple of weeks to my PC. Naturally it also gets to my backup external HD, which I update every week. This distributes the danger over different continents, so I feel much safer. The gzipped backup has reached half a gig by now, but it&#8217;s still quick to download over FTP. I&#8217;ve even used it myself one time when I deleted something without purpose. Saved me a day or two waiting for bluehost to bring it up from their backups.</p>
<p>Backups are important! Out data is one of the most important assets we have these days, so it&#8217;s worthwhile to invest in keeping it safe. You can&#8217;t just trust the web-host unless you explicitly pay for a bullet-proof replication service that ensures your data&#8217;s safety. Learning from your mistakes is great, but learning from others&#8217; mistakes is much better! So take a few minutes to review the backup strategy for your important data.</p>
<img src="http://eli.thegreenplace.net/?ak_action=api_record_view&id=2014&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://eli.thegreenplace.net/2003/11/16/poor-mans-backup/' rel='bookmark' title='Permanent Link: poor man&#8217;s backup'>poor man&#8217;s backup</a> <small>At the SW job, all our files are on backed-up...</small></li><li><a href='http://eli.thegreenplace.net/2006/04/12/migrating-to-wordpress/' rel='bookmark' title='Permanent Link: Migrating to Wordpress'>Migrating to Wordpress</a> <small>My blog has just recently migrated from use.perl to Blogger,...</small></li><li><a href='http://eli.thegreenplace.net/2009/08/07/a-live-data-monitor-with-python-pyqt-and-pyserial/' rel='bookmark' title='Permanent Link: A &#8220;live&#8221; data monitor with Python, PyQt and PySerial'>A &#8220;live&#8221; data monitor with Python, PyQt and PySerial</a> <small>The previous couple of posts about the PySerial module for...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://eli.thegreenplace.net/2009/12/12/on-the-importance-of-backing-up-your-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Porting from Turbogears to Django &#8211; a personal experience</title>
		<link>http://eli.thegreenplace.net/2009/10/11/porting-from-turbogears-to-django-a-personal-experience/</link>
		<comments>http://eli.thegreenplace.net/2009/10/11/porting-from-turbogears-to-django-a-personal-experience/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 03:52:27 +0000</pubDate>
		<dc:creator>eliben</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1951</guid>
		<description><![CDATA[
Introduction
About a year ago, I taught myself Turbogears (version 1.0.7 at the time) in order to write a small personal web-application for my own use. Although I have very little web development experience, Turbogears was easy to use, and its power was apparent.
Recently I&#8217;ve decided to make some improvements to my application. However, in the [...]


Related posts:<ol><li><a href='http://eli.thegreenplace.net/2010/02/24/a-simple-canvas-based-javascript-game-with-a-django-back-end/' rel='bookmark' title='Permanent Link: A simple canvas-based Javascript game, with a Django back-end'>A simple canvas-based Javascript game, with a Django back-end</a> <small>A few years ago I&#8217;ve released a clone of the...</small></li><li><a href='http://eli.thegreenplace.net/2008/10/23/deploying-turbogears-applications-on-shared-hosting-bluehost/' rel='bookmark' title='Permanent Link: Deploying TurboGears applications on shared hosting (Bluehost)'>Deploying TurboGears applications on shared hosting (Bluehost)</a> <small>I&#8217;m playing around with web applications now, and my learning...</small></li><li><a href='http://eli.thegreenplace.net/2008/11/28/a-python-replacement-for-php-software/' rel='bookmark' title='Permanent Link: A Python replacement for PHP software ?'>A Python replacement for PHP software ?</a> <small>This blog runs on Wordpress, and I&#8217;m quite happy with...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<div class="section" id="introduction">
<h3>Introduction</h3>
<p>About a year ago, I taught myself Turbogears (version 1.0.7 at the time) in order to write a small personal web-application for my own use. Although I have very little web development experience, Turbogears was easy to use, and its power was apparent.</p>
<p>Recently I&#8217;ve decided to make some improvements to my application. However, in the meantime TG moved on to version 2.0, and because of the many changes it came with, I had two options. Either stick to the old TG version or learn what it takes to use 2.0. Since this is mostly a learning experience, it was a shame to just use an old version. On the other hand, if I need to learn a new approach (for 2.0) anyway, I could learn another framework, while I&#8217;m at it.</p>
<p>This is how I got to Django. I made up my mind to rewrite the application from scratch, and to learn the other large Python framework in the process. This post summarizes some of my (highly subjective!) thoughts about it, and how I see the differences between TG and Django.</p>
</div>
<div class="section" id="components">
<h3>Components</h3>
<p>A big difference between TG and Django is in their basic architecture and philosophy. Django is a monolithic framework with an ORM of their own, a templating engine of their own, and so on. TG ties together several independent packages to do everything.</p>
<p>When I first started checking out the frameworks last year, this is what decided in favor of TG for me. I figured that tying together several well-known and tested packages is a better approach. If I&#8217;ll have to do something other than a web app in the future, I&#8217;ll be able to just reuse this knowledge and, say, use SQLObject (TG&#8217;s ORM in version 1.0.7) for other things. The same with the templating engine and so on. Django just looked like everything depends on everything else.</p>
<p>On the other hand, consider this. TG 1.0.7 had SQLObject for the ORM, Kid for the templating and Cherrypy for the controller (HTTP event handler). TG 2, on the other hand, has SQLAlchemy for the ORM, Genshi for the templating and Pylons for the controller. Now, this isn&#8217;t exactly persistent, and investing in becoming an expert in SQLObject wouldn&#8217;t really pay off, would it?</p>
<p>Django, being monolithic, has stayed much more consistent during its evolution. Of course if you really want, you <em>can</em> use other components with Django &#8211; so if you really dig SQLAlchemy you can replace Django&#8217;s ORM with it. It takes work, but it&#8217;s possible. You can also use Django&#8217;s components outside of Django, if you really want to. It&#8217;s less natural than with TG though.</p>
<p>That said, I have a feeling that Django can be a bit too inflexible when you need to really customize it. It gives you less freedom than TG to against its &quot;way&quot;.</p>
</div>
<div class="section" id="documentation">
<h3>Documentation</h3>
<p>TG has nice documentation, but Django is simply in a league of its own &#8211; not only against TG, but against most Python libraries and frameworks. Besides the excellent online docs, you also have a <a class="reference external" href="http://www.djangobook.com/">complete book</a> for free online. Since it&#8217;s the most popular Python web framework around, there&#8217;s also a lot of unofficial documentation and tutorials floating around the web.</p>
<p>To use TG you should really go through the docs of its components, so you have to look in many places. For Django, it&#8217;s all in a single place, logically linked together.</p>
</div>
<div class="section" id="installation">
<h3>Installation</h3>
<p>Django took much less time to deploy on my Bluehost account. The installation took a couple of minutes and was very well documented. TG was more trouble &#8211; it took a couple of hours to make everything work. I suspect that this is, again, because TG consists of several components that should all be configured to work just right together.</p>
</div>
<div class="section" id="miscellanea">
<h3>Miscellanea</h3>
<ul class="simple">
<li>I really like Django&#8217;s <tt class="docutils literal"><span class="pre">urls.py</span></tt> approach: your URLs are in a separate file from your controller functions. This has several benefits: (1) Things are more decoupled, which is always good &#8211; it helps reusability and maintainability. (2) The <tt class="docutils literal"><span class="pre">urls.py</span></tt> is a good &quot;table of contents&quot; for your website &#8211; it makes it simpler to find out quickly what is where (I&#8217;m talking about the developer, of course, not the user).</li>
<li>Django has a nice automatic admin, which I don&#8217;t recall in TG.</li>
<li>I like Django&#8217;s template language much more than Kid. It has all the required features, is easily extensible through Python code and most importantly, isn&#8217;t XML based like Kid. Template languages are supposed to be aimed at designers and content editors &#8211; not programmers. Thus, using XML for them kinda beats the cause.</li>
<li>Django&#8217;s way is to have several <em>applications</em> in a single <em>project</em>. This isn&#8217;t natural for small applications &#8211; and in TG you don&#8217;t have to do it.</li>
<li>Django&#8217;s settings file is pure Python, which is far better than TG&#8217;s INI file approach (in version 1.0.7 &#8211; maybe it&#8217;s been changed already).</li>
</ul>
</div>
<div class="section" id="conclusion">
<h3>Conclusion</h3>
<p>Both frameworks are very good, in my opinion. Working with Python is a pleasure (especially after you&#8217;ve tried to tweak your Wordpress by writing some f****** PHP code which made your eyes bleed), and the frameworks make web app development a snap.</p>
<p>But there&#8217;s always a favorite, right? And my favorite is Django. I just liked it better &#8211; the documentation, the internal consistency, etc. I think that for me, a developer of small and simple web apps, Django is the best choice &#8211; it lets you get to where you need to go with the least effort. Maybe TG is better for the larger applications, maybe not, I can&#8217;t be really sure.</p>
</div>
<img src="http://eli.thegreenplace.net/?ak_action=api_record_view&id=1951&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://eli.thegreenplace.net/2010/02/24/a-simple-canvas-based-javascript-game-with-a-django-back-end/' rel='bookmark' title='Permanent Link: A simple canvas-based Javascript game, with a Django back-end'>A simple canvas-based Javascript game, with a Django back-end</a> <small>A few years ago I&#8217;ve released a clone of the...</small></li><li><a href='http://eli.thegreenplace.net/2008/10/23/deploying-turbogears-applications-on-shared-hosting-bluehost/' rel='bookmark' title='Permanent Link: Deploying TurboGears applications on shared hosting (Bluehost)'>Deploying TurboGears applications on shared hosting (Bluehost)</a> <small>I&#8217;m playing around with web applications now, and my learning...</small></li><li><a href='http://eli.thegreenplace.net/2008/11/28/a-python-replacement-for-php-software/' rel='bookmark' title='Permanent Link: A Python replacement for PHP software ?'>A Python replacement for PHP software ?</a> <small>This blog runs on Wordpress, and I&#8217;m quite happy with...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://eli.thegreenplace.net/2009/10/11/porting-from-turbogears-to-django-a-personal-experience/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Detexify recognizes hand-written math symbols</title>
		<link>http://eli.thegreenplace.net/2009/07/13/detexify-recognizes-hand-written-math-symbols/</link>
		<comments>http://eli.thegreenplace.net/2009/07/13/detexify-recognizes-hand-written-math-symbols/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 03:31:16 +0000</pubDate>
		<dc:creator>eliben</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1800</guid>
		<description><![CDATA[Does it ever happen to you that you don&#8217;t remember the Latex code for some mathematical symbol? What can you do then except wading through pages of Latex symbols trying to locate the right one? 
Well, no more! Detexify is a great new service that allows you to &#8220;draw&#8221; the symbol you&#8217;re looking for:

&#8230; and [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Does it ever happen to you that you don&#8217;t remember the Latex code for some mathematical symbol? What can you do then except wading through pages of Latex symbols trying to locate the right one? </p>
<p>Well, no more! <a href="http://detexify.kirelabs.org/classify.html">Detexify</a> is a great new service that allows you to &#8220;draw&#8221; the symbol you&#8217;re looking for:</p>
<p><img src="http://eli.thegreenplace.net/wp-content/uploads/2009/07/intg_handwriting.png" alt="intg_handwriting" title="intg_handwriting" width="301" height="366" class="alignnone size-full wp-image-1801" /></p>
<p>&#8230; and it will suggest the Latex code. </p>
<p><img src="http://eli.thegreenplace.net/wp-content/uploads/2009/07/intg_suggestions.png" alt="intg_suggestions" title="intg_suggestions" width="287" height="310" class="alignnone size-full wp-image-1802" /></p>
<p>Detexify is a learning OCR classifier, and can be &#8220;trained&#8221; by users to improve it&#8217;s performance. </p>
<p>Kudos to the <a href="http://kirelabs.org/">creator</a> of Detexify for a great project. It will definitely be useful&#8230;</p>
<img src="http://eli.thegreenplace.net/?ak_action=api_record_view&id=1800&type=feed" alt="" />

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://eli.thegreenplace.net/2009/07/13/detexify-recognizes-hand-written-math-symbols/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A Python replacement for PHP software ?</title>
		<link>http://eli.thegreenplace.net/2008/11/28/a-python-replacement-for-php-software/</link>
		<comments>http://eli.thegreenplace.net/2008/11/28/a-python-replacement-for-php-software/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 14:26:01 +0000</pubDate>
		<dc:creator>eliben</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1150</guid>
		<description><![CDATA[This blog runs on Wordpress, and I&#8217;m quite happy with it. It&#8217;s simple to configure and use, is very well supported and the huge amount of plugins and extensions make every wish come true almost automatically. When we had to open a trave log, I didn&#8217;t think twice before using Wordpress for that too. Regardless [...]


Related posts:<ol><li><a href='http://eli.thegreenplace.net/2009/05/15/a-year-with-python/' rel='bookmark' title='Permanent Link: A year with Python'>A year with Python</a> <small>Almost exactly a year ago I wrote here about giving...</small></li><li><a href='http://eli.thegreenplace.net/2003/08/14/book-review-patterns-of-software-by-richard-gabriel/' rel='bookmark' title='Permanent Link: Book review: &#8220;Patterns of software&#8221; by Richard Gabriel'>Book review: &#8220;Patterns of software&#8221; by Richard Gabriel</a> <small>I got to this book from a post on the...</small></li><li><a href='http://eli.thegreenplace.net/2009/05/22/book-review-rapid-gui-programming-with-python-and-qt-by-mark-summerfield/' rel='bookmark' title='Permanent Link: Book review: &#8220;Rapid GUI Programming with Python and Qt&#8221; by Mark Summerfield'>Book review: &#8220;Rapid GUI Programming with Python and Qt&#8221; by Mark Summerfield</a> <small>Mark Summerfield has a lot of Qt experience, having worked...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>This blog runs on Wordpress, and I&#8217;m quite happy with it. It&#8217;s simple to configure and use, is very well supported and the huge amount of plugins and extensions make every wish come true almost automatically. When we had to open a <a href="http://thegreenplace.net/travel">trave log</a>, I didn&#8217;t think twice before using Wordpress for that too. Regardless of the general theme of this post, I&#8217;m thankful for Wordpress, and do think that its developers and maintainers deserve kudos on creating such a great piece of software, for free.</p>
<p>Wordpress is implemented in PHP, like most popular web applications. In the world of (open-source) web applications, PHP is a 500-ton train sweeping everything else aside. Do you need a CMS ? No problem, have Drupal or Joomla. A photo-album ? There&#8217;s Coppermine (which I&#8217;m also using for <a href="http://thegreenplace.net/photos/">our online photo album</a>). Need a forum ? Everyone knows that phpBB rulez. And some of the big competitors, like punBB and Invision are also written in PHP.</p>
<p>There are literally truckloads of articles online explaining the popularity of PHP, so I won&#8217;t just drop another leaf into it. Rather, I just want to express an opinion that it&#8217;s <em>a damn shame</em> that this is the situation, because PHP is a bad language that encourages bad programming practice, which makes tinkering with large PHP painful.</p>
<p>I&#8217;m a natural tinkerer, and my Wordpress blog is self-customized in several minor ways. I&#8217;ve also customized some of the plugins I use for my special needs. I can&#8217;t describe the disgust and horror I sometimes experience when fixing or changing something in Wordpress&#8217;s PHP code. So much things are global &#8211; the variables, the hooks, the functions. Even after PHP added OOP, most code doesn&#8217;t use it, or only uses it in a very rudimentary way as module-like wrappers. PHP is probably an ideal language for applications to which many sub-competent hackers add code. It has almost no &#8220;accepted style&#8221; and people place no limits on what they do. This is a real shame.</p>
<p>I firmly believe that Python is a superior language to PHP. In all domains except web programming it&#8217;s also much more popular, so I&#8217;m really saddened by the lack of competition to PHP web apps from Python&#8217;s side. There&#8217;s absolutely nothing in Python that makes it less suitable for web applications than PHP &#8211; it&#8217;s simply a matter of custom.</p>
<p>Therefore, I think it would be really great if at least one of the big-gun web apps was written in Python. Maybe a competitor to Wordpress, or a forum software. I, for once, would be delighted to use it once it&#8217;s stable enough. And it shouldn&#8217;t be too hard, either. All it would take is a single dedicated and talented Python hacker, perhaps in a setting like the <a href="http://code.google.com/soc/2008/">Google Summer of Code</a>. Take Wordpress for instance. It weighs less than 30 KLOC of PHP code. Even assuming that PHP-Python translation is 1-to-1, brushing some of the more advanced features aside the Python replacement could easily be written in a summer. At first, it can mimic the Wordpress architecture to make the transition easier. Then, once the project gains users and momentum, the code can be slowly and surely refactored to bring more good Python practices in.</p>
<p>I hope someone will start such an endeavor. Perhaps the Django team could offer it as a GSoC project for a Wordpress replacement using Django (which would surely shave lots of code, as WP itself is written in pure PHP w/o any framework beneath).</p>
<img src="http://eli.thegreenplace.net/?ak_action=api_record_view&id=1150&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://eli.thegreenplace.net/2009/05/15/a-year-with-python/' rel='bookmark' title='Permanent Link: A year with Python'>A year with Python</a> <small>Almost exactly a year ago I wrote here about giving...</small></li><li><a href='http://eli.thegreenplace.net/2003/08/14/book-review-patterns-of-software-by-richard-gabriel/' rel='bookmark' title='Permanent Link: Book review: &#8220;Patterns of software&#8221; by Richard Gabriel'>Book review: &#8220;Patterns of software&#8221; by Richard Gabriel</a> <small>I got to this book from a post on the...</small></li><li><a href='http://eli.thegreenplace.net/2009/05/22/book-review-rapid-gui-programming-with-python-and-qt-by-mark-summerfield/' rel='bookmark' title='Permanent Link: Book review: &#8220;Rapid GUI Programming with Python and Qt&#8221; by Mark Summerfield'>Book review: &#8220;Rapid GUI Programming with Python and Qt&#8221; by Mark Summerfield</a> <small>Mark Summerfield has a lot of Qt experience, having worked...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://eli.thegreenplace.net/2008/11/28/a-python-replacement-for-php-software/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Deploying TurboGears applications on shared hosting (Bluehost)</title>
		<link>http://eli.thegreenplace.net/2008/10/23/deploying-turbogears-applications-on-shared-hosting-bluehost/</link>
		<comments>http://eli.thegreenplace.net/2008/10/23/deploying-turbogears-applications-on-shared-hosting-bluehost/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 18:06:44 +0000</pubDate>
		<dc:creator>eliben</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1073</guid>
		<description><![CDATA[I&#8217;m playing around with web applications now, and my learning path went through an enlightening experience of deploying a Turbogears [1] web application on my Bluehost-hosted domain. It runs via FastCGI on Apache.

Python
I recommend installing the latest stable version of Python (2.5.2 at the moment of writing). Perhaps you&#8217;ll need to install it locally, depending [...]


Related posts:<ol><li><a href='http://eli.thegreenplace.net/2008/10/20/installing-python-25-on-bluehost/' rel='bookmark' title='Permanent Link: Installing Python 2.5 on Bluehost'>Installing Python 2.5 on Bluehost</a> <small>Bluehost is my hosting provider for http://thegreenplace.net I&#8217;m generally quite...</small></li><li><a href='http://eli.thegreenplace.net/2009/10/11/porting-from-turbogears-to-django-a-personal-experience/' rel='bookmark' title='Permanent Link: Porting from Turbogears to Django &#8211; a personal experience'>Porting from Turbogears to Django &#8211; a personal experience</a> <small> Introduction About a year ago, I taught myself Turbogears...</small></li><li><a href='http://eli.thegreenplace.net/2008/07/03/libcollect-collecting-python-distributions/' rel='bookmark' title='Permanent Link: libcollect &#8211; collecting Python distributions'>libcollect &#8211; collecting Python distributions</a> <small>Here&#8217;s an excerpt from the documentation of libcollect: Motivation: Imagine...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m playing around with web applications now, and my learning path went through an enlightening experience of deploying a Turbogears <a class="footnote-reference" href="#id3" id="id1">[1]</a> web application on my Bluehost-hosted domain. It runs via FastCGI on Apache.</p>
<div class="section" id="python">
<h3>Python</h3>
<p>I recommend installing the latest stable version of Python (2.5.2 at the moment of writing). Perhaps you&#8217;ll need to install it locally, depending on your hosting. <a class="reference external" href="http://eli.thegreenplace.net/2008/10/20/installing-python-25-on-bluehost/">Here&#8217;s how I&#8217;ve done it</a> for my Bluehost account. Also, install the latest version of <tt class="docutils literal"><span class="pre">easy_install</span></tt> &#8211; you&#8217;ll need it for Turbogears and other modules.</p>
</div>
<div class="section" id="turbogears">
<h3>Turbogears</h3>
<p>I assume you&#8217;re at least a bit familiar with Turbogears (TG). Install it with <tt class="docutils literal"><span class="pre">easy_install</span></tt>. Also, use <tt class="docutils literal"><span class="pre">easy_install</span></tt> to install <a class="reference external" href="http://trac.saddi.com/flup">flup</a> that bridges between the WSGI server inside TG and the FastCGI module of the Apache webserver running the website.</p>
<p>If you don&#8217;t have a TG application ready, you can use the quickstart application created by <tt class="docutils literal"><span class="pre">tg-admin</span> <span class="pre">quickstart</span></tt>. It&#8217;s best to place the application it self in some path not accessible from the web (i.e. outside your <tt class="docutils literal"><span class="pre">public_html</span></tt> directory if your host offers such a thing).</p>
</div>
<div class="section" id="tg-fastcgi-fcgi">
<h3>tg_fastcgi.fcgi</h3>
<p>Here comes the tricky part. To make your TG application work, you need a FastCGI script to activate it. There are various versions of this script floating around, but you can download and configure the one that worked for me from <a class="reference external" href="http://eli.thegreenplace.net/files/permakeep/tg_fastcgi.fcgi">here</a>. Place it in the directory you want to expose your app from.</p>
<p>Then edit it &#8211; modify the first line to point to your Python installation, and in the user edit section modify <tt class="docutils literal"><span class="pre">code_dir</span></tt> to point to the directory you placed the TG application in, and <tt class="docutils literal"><span class="pre">tg_fastcgi_url</span></tt> to your <tt class="docutils literal"><span class="pre">tg_fastcgi.fcgi</span></tt>. Also, if your application&#8217;s name is not the default <tt class="docutils literal"><span class="pre">wiki20</span></tt>, modify <tt class="docutils literal"><span class="pre">root_class_name</span></tt> and <tt class="docutils literal"><span class="pre">project_module_name</span></tt> accordingly.</p>
<p>Note that this script will load your <tt class="docutils literal"><span class="pre">dev.cfg</span></tt> configuration. You can change it if you&#8217;re using another configuration file.</p>
</div>
<div class="section" id="configuring-apache">
<h3>Configuring Apache</h3>
<p>To make Apache execute your <tt class="docutils literal"><span class="pre">tg_fastcgi.fcgi</span></tt>, create the following <tt class="docutils literal"><span class="pre">.htaccess</span></tt> <a class="footnote-reference" href="#id4" id="id2">[2]</a> in its directory:</p>
<pre class="literal-block">
Options +ExecCGI
AddHandler fcgid-script .py
AddHandler fcgid-script .fcgi

RewriteEngine On
RewriteRule ^(tg_fastcgi.fcgi/.*)$ - [L]
RewriteRule ^(.*)$ /path/to/tg_fastcgi.fcgi/$1 [L]
</pre>
<p>Note that it also contains Apache rewrite rules to make URLs prettier. Modify <tt class="docutils literal"><span class="pre">path/to</span></tt> to reflect your real path.</p>
</div>
<div class="section" id="ready-to-run">
<h3>Ready to run</h3>
<p>If your domain is <tt class="docutils literal"><span class="pre">www.mydomain.com</span></tt> and you&#8217;ve placed the <tt class="docutils literal"><span class="pre">tg_fastcgi.fcgi</span></tt> in directory <tt class="docutils literal"><span class="pre">my_app</span></tt>, you should be able to see your application by accessing <tt class="docutils literal"><span class="pre">www.mydomain.com/my_app/</span></tt>.</p>
</div>
<div class="section" id="problems-i-ran-into">
<h3>Problems I ran into</h3>
<ol class="arabic simple">
<li>Complaints about the version of <tt class="docutils literal"><span class="pre">SQLObject</span></tt>: If you get such complains during the installation or in the logs of the application, install the latest <tt class="docutils literal"><span class="pre">SQLObject</span></tt> with <tt class="docutils literal"><span class="pre">easy_install</span></tt>. This applies to all sub-modules used by TG.</li>
<li>Complaints about <tt class="docutils literal"><span class="pre">access_out</span></tt> and <tt class="docutils literal"><span class="pre">debug_out</span></tt> logging handlers. The handlers are defined in your <tt class="docutils literal"><span class="pre">app.cfg</span></tt> file. Make sure that <tt class="docutils literal"><span class="pre">project_module_name</span></tt> in <tt class="docutils literal"><span class="pre">tg_fastcgi.fcgi</span></tt> is pointing to your config directory, where <tt class="docutils literal"><span class="pre">app.cfg</span></tt> will be found.</li>
<li>Changing the configuration didn&#8217;t affect the application: make sure you kill the FastCGI process to restart the server after each change in the configuration files of the application. <tt class="docutils literal"><span class="pre">pkill</span> <span class="pre">tg_fastcgi.fcgi</span></tt> is a useful command. <tt class="docutils literal"><span class="pre">ps</span> <span class="pre">uax</span> <span class="pre">|</span> <span class="pre">grep</span> <span class="pre">tg_fastcgi</span></tt> is another.</li>
<li>Paths going through <tt class="docutils literal"><span class="pre">tg_fastcgi.fcgi</span></tt> in application URLs: I can access my application with <tt class="docutils literal"><span class="pre">www.mydomain.com/my_app/</span></tt>, but internal links still point to <tt class="docutils literal"><span class="pre">www.mydomain.com/my_app/tg_fastcgi.fcgi/</span></tt>, which works but is less pretty. In many places <tt class="docutils literal"><span class="pre">server.webpath</span></tt> in the configuration file is mentioned as a solution for this problem, but I didn&#8217;t manage to get it working without running into permanent 404 errors when accessing the application.</li>
<li>MochiKit scripts not working. When you enable the MochiKit widget in <tt class="docutils literal"><span class="pre">app.cfg</span></tt>, TG will insert references to <tt class="docutils literal"><span class="pre">/tg_widgets/turbogears/js/MochiKit.js</span></tt> into your pages. But it doesn&#8217;t work for me, somehow. If you&#8217;re struggling, you can always copy <tt class="docutils literal"><span class="pre">MochiKit.js</span></tt> from TG&#8217;s installation into your project&#8217;s directory and point to it directly with a <tt class="docutils literal"><span class="pre">&lt;script</span> <span class="pre">src=&quot;&quot;&gt;</span></tt> tag.</li>
</ol>
<div align="center" class="align-center"><img alt="http://eli.thegreenplace.net/wp-content/uploads/hline.jpg" class="align-center" src="http://eli.thegreenplace.net/wp-content/uploads/hline.jpg" style="width: 320px; height: 5px;" /></div>
<table class="docutils footnote" frame="void" id="id3" rules="none">
<colgroup>
<col class="label" />
<col /></colgroup>
<tbody valign="top">
<tr>
<td class="label"><a class="fn-backref" href="#id1">[1]</a></td>
<td>As much as I&#8217;d like to write about why I chose Turbogears and my experience learning it, I&#8217;ll have to leave it for another post.</td>
</tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id4" rules="none">
<colgroup>
<col class="label" />
<col /></colgroup>
<tbody valign="top">
<tr>
<td class="label"><a class="fn-backref" href="#id2">[2]</a></td>
<td>For some reason, many guides recommend setting <tt class="docutils literal"><span class="pre">chmod</span> <span class="pre">755</span></tt> on <tt class="docutils literal"><span class="pre">.htaccess</span></tt>. It works fine with <tt class="docutils literal"><span class="pre">644</span></tt> for me, and it seems like a safer option.</td>
</tr>
</tbody>
</table>
</div>
<img src="http://eli.thegreenplace.net/?ak_action=api_record_view&id=1073&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://eli.thegreenplace.net/2008/10/20/installing-python-25-on-bluehost/' rel='bookmark' title='Permanent Link: Installing Python 2.5 on Bluehost'>Installing Python 2.5 on Bluehost</a> <small>Bluehost is my hosting provider for http://thegreenplace.net I&#8217;m generally quite...</small></li><li><a href='http://eli.thegreenplace.net/2009/10/11/porting-from-turbogears-to-django-a-personal-experience/' rel='bookmark' title='Permanent Link: Porting from Turbogears to Django &#8211; a personal experience'>Porting from Turbogears to Django &#8211; a personal experience</a> <small> Introduction About a year ago, I taught myself Turbogears...</small></li><li><a href='http://eli.thegreenplace.net/2008/07/03/libcollect-collecting-python-distributions/' rel='bookmark' title='Permanent Link: libcollect &#8211; collecting Python distributions'>libcollect &#8211; collecting Python distributions</a> <small>Here&#8217;s an excerpt from the documentation of libcollect: Motivation: Imagine...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://eli.thegreenplace.net/2008/10/23/deploying-turbogears-applications-on-shared-hosting-bluehost/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing Python 2.5 on Bluehost</title>
		<link>http://eli.thegreenplace.net/2008/10/20/installing-python-25-on-bluehost/</link>
		<comments>http://eli.thegreenplace.net/2008/10/20/installing-python-25-on-bluehost/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 15:52:52 +0000</pubDate>
		<dc:creator>eliben</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1068</guid>
		<description><![CDATA[Bluehost is my hosting provider for http://thegreenplace.net
I&#8217;m generally quite happy with them &#8211; the service is stable and the support is responsive. A small annoyance is the old version of Python they have installed by default &#8211; 2.3.4. This is quite an old version and many libraries have already dropped support for it.
Luckily, installing a [...]


Related posts:<ol><li><a href='http://eli.thegreenplace.net/2008/10/23/deploying-turbogears-applications-on-shared-hosting-bluehost/' rel='bookmark' title='Permanent Link: Deploying TurboGears applications on shared hosting (Bluehost)'>Deploying TurboGears applications on shared hosting (Bluehost)</a> <small>I&#8217;m playing around with web applications now, and my learning...</small></li><li><a href='http://eli.thegreenplace.net/2008/06/27/creating-python-extension-modules-in-c/' rel='bookmark' title='Permanent Link: Creating Python extension modules in C'>Creating Python extension modules in C</a> <small>I&#8217;ve successfully created a C extension for Python, basically following...</small></li><li><a href='http://eli.thegreenplace.net/2007/08/08/setting-up-an-initialization-file-for-clisp-on-windows/' rel='bookmark' title='Permanent Link: Setting up an initialization file for CLISP on Windows'>Setting up an initialization file for CLISP on Windows</a> <small>CLISP, like other CL implementations, loads an initialization file on...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Bluehost is my hosting provider for <a class="reference external" href="http://thegreenplace.net">http://thegreenplace.net</a></p>
<p>I&#8217;m generally quite happy with them &#8211; the service is stable and the support is responsive. A small annoyance is the old version of Python they have installed by default &#8211; 2.3.4. This is quite an old version and many libraries have already dropped support for it.</p>
<p>Luckily, installing a local version of Python is very easy. Here are the few simple steps required to install the latest and greatest Python and run your CGI scripts with it (I&#8217;m installing version 2.5.2 in this example).</p>
<p>Access your account with SSH and in the home directory execute:</p>
<pre class="literal-block">
wget http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tgz
tar xvzf Python-2.5.2.tgz
</pre>
<p>This downloads and unzips the Python 2.5.2 source distribution. Now install Python locally to your home directory, executing:</p>
<pre class="literal-block">
cd Python-2.5.2
./configure -prefix=/home/username/python252 --enable-unicode=ucs4
make
make install
</pre>
<p>Replace <tt class="docutils literal"><span class="pre">username/python252</span></tt> with your username on the host&#8217;s server and the target directory you want to install into. This operation will take a couple of minutes, depending on your server&#8217;s speed. It fully configures, compiles and installs Python from sources.</p>
<p>The next step is making the Python you&#8217;ve just installed the default Python in your shell. Open <tt class="docutils literal"><span class="pre">~/.bashrc</span></tt> <a class="footnote-reference" href="#id2" id="id1">[1]</a> and add this line at the end:</p>
<pre class="literal-block">
export PATH=/home/username/python252/bin:$PATH
</pre>
<p>Save and close the file. New <tt class="docutils literal"><span class="pre">bash</span></tt> shells will now have Python 2.5.2 respond to <tt class="docutils literal"><span class="pre">python</span></tt>. To make it happen in the current shell, type <tt class="docutils literal"><span class="pre">bash</span></tt>, and then <tt class="docutils literal"><span class="pre">python</span> <span class="pre">-V</span></tt> to see the new version.</p>
<p>Now, it is important to modify all your Python scripts (including CGI ones) to be executed with your private Python. Modify the shebang line at the top of the scripts to point to it:</p>
<pre class="literal-block">
#!/home/username/python252/bin/python
</pre>
<p>That&#8217;s about it ! Your Python CGI scripts will now run with Python 2.5.2</p>
<p>Since you&#8217;ve made Python 2.5.2 the default in your shell, you can now easily install new Python modules into its <tt class="docutils literal"><span class="pre">site-packages</span></tt> and use them in your scripts. Simply download the modules with <tt class="docutils literal"><span class="pre">wget</span></tt> and install them with <tt class="docutils literal"><span class="pre">python</span> <span class="pre">setup.py</span> <span class="pre">install</span></tt>. <tt class="docutils literal"><span class="pre">easy_install</span></tt> will work too, once you install it.</p>
<p>P.S. I expect this method, perhaps with minor modifications, to work for other providers as well, and not only Bluehost.</p>
<div align="center" class="align-center"><img alt="http://eli.thegreenplace.net/wp-content/uploads/hline.jpg" class="align-center" src="http://eli.thegreenplace.net/wp-content/uploads/hline.jpg" style="width: 320px; height: 5px;" /></div>
<table class="docutils footnote" frame="void" id="id2" rules="none">
<colgroup>
<col class="label" />
<col /></colgroup>
<tbody valign="top">
<tr>
<td class="label"><a class="fn-backref" href="#id1">[1]</a></td>
<td>Assuming <tt class="docutils literal"><span class="pre">bash</span></tt> is your shell. For other shells, adapt the example accordingly.</td>
</tr>
</tbody>
</table>
<img src="http://eli.thegreenplace.net/?ak_action=api_record_view&id=1068&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://eli.thegreenplace.net/2008/10/23/deploying-turbogears-applications-on-shared-hosting-bluehost/' rel='bookmark' title='Permanent Link: Deploying TurboGears applications on shared hosting (Bluehost)'>Deploying TurboGears applications on shared hosting (Bluehost)</a> <small>I&#8217;m playing around with web applications now, and my learning...</small></li><li><a href='http://eli.thegreenplace.net/2008/06/27/creating-python-extension-modules-in-c/' rel='bookmark' title='Permanent Link: Creating Python extension modules in C'>Creating Python extension modules in C</a> <small>I&#8217;ve successfully created a C extension for Python, basically following...</small></li><li><a href='http://eli.thegreenplace.net/2007/08/08/setting-up-an-initialization-file-for-clisp-on-windows/' rel='bookmark' title='Permanent Link: Setting up an initialization file for CLISP on Windows'>Setting up an initialization file for CLISP on Windows</a> <small>CLISP, like other CL implementations, loads an initialization file on...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://eli.thegreenplace.net/2008/10/20/installing-python-25-on-bluehost/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Google search rank</title>
		<link>http://eli.thegreenplace.net/2008/09/13/google-search-rank/</link>
		<comments>http://eli.thegreenplace.net/2008/09/13/google-search-rank/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 11:20:13 +0000</pubDate>
		<dc:creator>eliben</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/09/13/google-search-rank/</guid>
		<description><![CDATA[How high on Google search does a website rank for a specific search query ?
The Perl script I&#8217;ve previously written to answer this question has stopped working, because Google changed the layout of their result HTML [1].
Instead of fixing the Perl script, I&#8217;ve decided to rewrite it in Python, and at the same time check [...]


Related posts:<ol><li><a href='http://eli.thegreenplace.net/2007/08/31/how-high-on-a-google-search-does-your-website-rank/' rel='bookmark' title='Permanent Link: How high on a google search does your website rank ?'>How high on a google search does your website rank ?</a> <small>Update 13.09.2008: The script described here no longer works. See:...</small></li><li><a href='http://eli.thegreenplace.net/2008/03/14/search-keywords-in-firefox/' rel='bookmark' title='Permanent Link: Search keywords in FireFox'>Search keywords in FireFox</a> <small>Firefox allows to conveniently add &#8220;keywords&#8221; to search boxes, to...</small></li><li><a href='http://eli.thegreenplace.net/2004/09/17/google-adsense-anecdote-on-perl6-compiler-list/' rel='bookmark' title='Permanent Link: google AdSense anecdote on perl6 compiler list'>google AdSense anecdote on perl6 compiler list</a> <small>Google AdSense is a good idea. A really really good...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>How high on Google search does a website rank for a specific search query ?</p>
<p>The Perl script I&#8217;ve <a class="reference external" href="http://eli.thegreenplace.net/2007/08/31/how-high-on-a-google-search-does-your-website-rank/">previously written</a> to answer this question has stopped working, because Google changed the layout of their result HTML <a class="footnote-reference" href="#id3" id="id1">[1]</a>.</p>
<p>Instead of fixing the Perl script, I&#8217;ve decided to rewrite it in Python, and at the same time check what other options I have to complete this task.<br />
It turns out that in the time that has passed since my previous research on this topic, Google have added an option to use their <a class="reference external" href="http://code.google.com/apis/ajaxsearch/">AJAX Search API</a> with external <a class="reference external" href="http://code.google.com/apis/ajaxsearch/documentation/#fonje">HTTP requests</a>. Just build a GET request and the results will be resulted as a JSON string. Undoubtedly, this is more convenient than screen scraping.</p>
<p>However, this approach is still limited &#8211; because the API won&#8217;t ever return more than 32 results (and even for that, 4 separate requests have to be issued) <a class="footnote-reference" href="#id4" id="id2">[2]</a>. To get more results, one still has to use screen scraping.</p>
<p>Anyway, I&#8217;ve coded both approaches as Python modules. The first one, <a class="reference external" href="http://eli.thegreenplace.net/files/prog_code/google_api_search.py">google_api_search</a> uses the Google search API to find results. The second, <a class="reference external" href="http://eli.thegreenplace.net/files/prog_code/google_web_search.py">google_web_search</a> issues normal HTTP search requests to Google with <tt class="docutils literal"><span class="pre">mechanize</span></tt>, and processes the results with <tt class="docutils literal"><span class="pre">BeautifulSoup</span></tt>. I&#8217;ve also whipped a simple CGI interface to these modules: <a class="reference external" href="http://eli.thegreenplace.net/scripts/google_search_rank.py">google_search_rank</a>.</p>
<div align="center" class="align-center"><img alt="http://eli.thegreenplace.net/wp-content/uploads/hline.jpg" class="align-center" src="http://eli.thegreenplace.net/wp-content/uploads/hline.jpg" style="width: 320px; height: 5px;" /></div>
<table class="docutils footnote" frame="void" id="id3" rules="none">
<colgroup>
<col class="label" />
<col /></colgroup>
<tbody valign="top">
<tr>
<td class="label"><a class="fn-backref" href="#id1">[1]</a></td>
<td>This is the main disadvantage of &quot;screen scraping&quot; methods &#8211; a high sensitivity to the layout of the HTML code.</td>
</tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id4" rules="none">
<colgroup>
<col class="label" />
<col /></colgroup>
<tbody valign="top">
<tr>
<td class="label"><a class="fn-backref" href="#id2">[2]</a></td>
<td>There is room for optimism, however. When Google first made this option available, they limited the amount of results to 8. Due to many requests, they&#8217;ve increased it to 32, and perhaps they will increase it even more in the future.</td>
</tr>
</tbody>
</table>
<img src="http://eli.thegreenplace.net/?ak_action=api_record_view&id=991&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://eli.thegreenplace.net/2007/08/31/how-high-on-a-google-search-does-your-website-rank/' rel='bookmark' title='Permanent Link: How high on a google search does your website rank ?'>How high on a google search does your website rank ?</a> <small>Update 13.09.2008: The script described here no longer works. See:...</small></li><li><a href='http://eli.thegreenplace.net/2008/03/14/search-keywords-in-firefox/' rel='bookmark' title='Permanent Link: Search keywords in FireFox'>Search keywords in FireFox</a> <small>Firefox allows to conveniently add &#8220;keywords&#8221; to search boxes, to...</small></li><li><a href='http://eli.thegreenplace.net/2004/09/17/google-adsense-anecdote-on-perl6-compiler-list/' rel='bookmark' title='Permanent Link: google AdSense anecdote on perl6 compiler list'>google AdSense anecdote on perl6 compiler list</a> <small>Google AdSense is a good idea. A really really good...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://eli.thegreenplace.net/2008/09/13/google-search-rank/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>rant about mailing lists</title>
		<link>http://eli.thegreenplace.net/2008/08/02/rant-about-mailing-lists/</link>
		<comments>http://eli.thegreenplace.net/2008/08/02/rant-about-mailing-lists/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 05:12:32 +0000</pubDate>
		<dc:creator>eliben</dc:creator>
				<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/08/02/rant-about-mailing-lists/</guid>
		<description><![CDATA[This post is a rant. Take it with a grain of salt.
Executive summary: I don&#8217;t like mailing lists. I think they&#8217;re a thing of the past, and these days using a web interface like a forum or a Google Group makes much more sense. So, it makes me angry that a lot of groups I&#8217;m [...]


Related posts:<ol><li><a href='http://eli.thegreenplace.net/2003/11/20/spam/' rel='bookmark' title='Permanent Link: spam'>spam</a> <small>All the messages in my mailbox today were Spam. This...</small></li><li><a href='http://eli.thegreenplace.net/2007/08/20/rant-about-common-lisp-and-implementations/' rel='bookmark' title='Permanent Link: Rant about Common Lisp and implementations'>Rant about Common Lisp and implementations</a> <small>In time I became very frustrated with my educational path...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p><em>This post is a rant. Take it with a grain of salt.</em></p>
<p>Executive summary: I don&#8217;t like mailing lists. I think they&#8217;re a thing of the past, and these days using a web interface like a forum or a Google Group makes much more sense. So, it makes me angry that a lot of groups I&#8217;m interested in lately hold their discussions in mailing lists.</p>
<p>Mailing lists used to be popular some years ago. Sure, when web access was via a modem and you only connected for an hour a day, it was convenient to download all the mail to your PC and read it offline. </p>
<p>But today, with fast, permanent web connections for almost everyone, I think mailing lists are an anachronism. Forums and places like <a href="http://groups.google.com/">Google Groups</a> are much better &#8211; they present all the information with full archives in a single place, you don&#8217;t have to fill your mailbox with all the list&#8217;s messages, and it&#8217;s easy to post and view discussions in hierarchical threads.</p>
<p>With a mailing list that delivers dozens of mails per day, you have to have an inbox full of mailing list correspondence, have no good search possibilities and can&#8217;t see thread hierarchies &#8211; everything is flat. So why is it good, why many groups still prefer this discussion method ?</p>
<p>Specifically, I fume about Python. Although its main mailing list is reflected to <a href="http://groups.google.com/group/comp.lang.python/topics">comp.lang.python</a>, most of the libraries and topical discussion groups use mailing lists, to which you have to subscribe. So let me get this straight. I&#8217;m interested in distutils, py2exe, matplotlib, wxPython and several other libraries. Does it really mean I have to subscribe to a gazillion mailing lists, just to go and ask a question / search for answers in one of them, once in a blue moon ? What other option to I have if I want to be able to post ?</p>
<p>Sure, there are sites like <a href="http://www.nabble.com/">Nabble</a> and <a href="http://gmane.org/">Gmane</a>, that reflect mailing lists to hierarchical forums bi-directionally, and they are great. I personally use Nabble for most of my participation in Python-related lists. </p>
<p>But some mailing lists haven&#8217;t registered with such services, so all that&#8217;s left is using the mailing list itself. In particular, I&#8217;m fuming about <a href="http://listas.aditel.org/listinfo/python-es">python-es</a>, a mailing list for Python in the Spanish language, which isn&#8217;t connected to Nabble and is already registered in Gmane as read-only. Argh, this is annoying.</p>
<img src="http://eli.thegreenplace.net/?ak_action=api_record_view&id=970&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://eli.thegreenplace.net/2003/11/20/spam/' rel='bookmark' title='Permanent Link: spam'>spam</a> <small>All the messages in my mailbox today were Spam. This...</small></li><li><a href='http://eli.thegreenplace.net/2007/08/20/rant-about-common-lisp-and-implementations/' rel='bookmark' title='Permanent Link: Rant about Common Lisp and implementations'>Rant about Common Lisp and implementations</a> <small>In time I became very frustrated with my educational path...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://eli.thegreenplace.net/2008/08/02/rant-about-mailing-lists/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Search keywords in FireFox</title>
		<link>http://eli.thegreenplace.net/2008/03/14/search-keywords-in-firefox/</link>
		<comments>http://eli.thegreenplace.net/2008/03/14/search-keywords-in-firefox/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 17:19:22 +0000</pubDate>
		<dc:creator>eliben</dc:creator>
				<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/03/14/search-keywords-in-firefox/</guid>
		<description><![CDATA[Firefox allows to conveniently add &#8220;keywords&#8221; to search boxes, to allow fast searching from its address bar.
For example, go to Google, right-click on the search box and select &#8220;Add a keyword for this search&#8221;. Give it a name and a keyword, for example &#8220;g&#8221;. 
Now, you&#8217;ll be able to just type &#8220;g whatever&#8221; at the [...]


Related posts:<ol><li><a href='http://eli.thegreenplace.net/2004/10/24/firefox/' rel='bookmark' title='Permanent Link: firefox'>firefox</a> <small>After a few weeks of playing around, I decided to...</small></li><li><a href='http://eli.thegreenplace.net/2007/08/31/how-high-on-a-google-search-does-your-website-rank/' rel='bookmark' title='Permanent Link: How high on a google search does your website rank ?'>How high on a google search does your website rank ?</a> <small>Update 13.09.2008: The script described here no longer works. See:...</small></li><li><a href='http://eli.thegreenplace.net/2009/01/19/great-firefox-productivity-tip/' rel='bookmark' title='Permanent Link: Great Firefox productivity tip'>Great Firefox productivity tip</a> <small>One of my heaviest uses of the mouse is browsing...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Firefox allows to conveniently add &#8220;keywords&#8221; to search boxes, to allow fast searching from its address bar.</p>
<p>For example, go to Google, right-click on the search box and select &#8220;Add a keyword for this search&#8221;. Give it a name and a keyword, for example &#8220;g&#8221;. </p>
<p>Now, you&#8217;ll be able to just type &#8220;g whatever&#8221; at the address bar and Firefox will execute a Google search on &#8220;whatever&#8221; and show you the result. Combined with the Alt-D hotkey that places the keyboard cursor in the address bar, this is a nice productivity boon.</p>
<p>So far I&#8217;ve added keywords for Google, Wikipedia, Babylon (translations), and my own website (sometimes I look for stuff I&#8217;ve written on before). </p>
<p>Thanks to <a href="http://ban-dana.livejournal.com/45934.html#cutid1">Misha</a> for the tip.</p>
<img src="http://eli.thegreenplace.net/?ak_action=api_record_view&id=909&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://eli.thegreenplace.net/2004/10/24/firefox/' rel='bookmark' title='Permanent Link: firefox'>firefox</a> <small>After a few weeks of playing around, I decided to...</small></li><li><a href='http://eli.thegreenplace.net/2007/08/31/how-high-on-a-google-search-does-your-website-rank/' rel='bookmark' title='Permanent Link: How high on a google search does your website rank ?'>How high on a google search does your website rank ?</a> <small>Update 13.09.2008: The script described here no longer works. See:...</small></li><li><a href='http://eli.thegreenplace.net/2009/01/19/great-firefox-productivity-tip/' rel='bookmark' title='Permanent Link: Great Firefox productivity tip'>Great Firefox productivity tip</a> <small>One of my heaviest uses of the mouse is browsing...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://eli.thegreenplace.net/2008/03/14/search-keywords-in-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
