<?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>Paolo Ardoino - ideas, programming, web and more... &#187; Web</title>
	<atom:link href="http://ardoino.com/category/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://ardoino.com</link>
	<description>Homo quisque faber ipse fortunae suae</description>
	<lastBuildDate>Tue, 27 Oct 2009 22:42:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>php-google-backup v1.0 released : backup Google Apps data (docs) with PHP and Zend GData</title>
		<link>http://ardoino.com/238-php-google-backup-gdocs-zend-gdata/</link>
		<comments>http://ardoino.com/238-php-google-backup-gdocs-zend-gdata/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 17:02:04 +0000</pubDate>
		<dc:creator>Paolo Ardoino</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://ardoino.com/?p=238</guid>
		<description><![CDATA[In these days I was setting up my new backup system (based on Netgear WGT634U with a pair of USB hard disk as external storage) and I needed a command line script to backup all my Google Apps data.
My priority was to backup GMail and Google Docs (Documents) data. For emails I found a very [...]]]></description>
			<content:encoded><![CDATA[<p>In these days I was setting up my new backup system (based on Netgear WGT634U with a pair of USB hard disk as external storage) and I needed a command line script to backup all my Google Apps data.<br />
My priority was to backup GMail and Google Docs (Documents) data. For emails I found a very useful tool called <a href="http://pyropus.ca/software/getmail/">getmail4</a> but I had not the same luck for documents so I wrote a very simple php command line script based on Zend Framework GData API.<br />
Now I release first version of <a href="http://ardoino.com/php-google-backup/"> php-google-backup</a> only with this feature but I&#8217;m planning to extend it to GMail, Google Calendar and Google Reader.<br />
<a href="http://ardoino.com/php-google-backup/">Get the script!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ardoino.com/238-php-google-backup-gdocs-zend-gdata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chemical Molecular Editor</title>
		<link>http://ardoino.com/210-chemical-molecular-editor/</link>
		<comments>http://ardoino.com/210-chemical-molecular-editor/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 19:19:21 +0000</pubDate>
		<dc:creator>Paolo Ardoino</dc:creator>
				<category><![CDATA[Ajax/Javascript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Web2.0]]></category>

		<guid isPermaLink="false">http://ardoino.com/?p=210</guid>
		<description><![CDATA[I and my girlfriend Claudia have developed a cool Javascript Chemical Molecular Editor ( WebCME ) based on the Dojo framework.
It is in constant bugfixing and feature enhancement, but we are proud to announce that a first usable version of this tool is available.

Current features list:
    * adding elements ( with automatic [...]]]></description>
			<content:encoded><![CDATA[<p>I and my girlfriend Claudia have developed a cool <a href='http://pc.ardoino.com/pj-kem-molecular-editor/'>Javascript Chemical Molecular Editor ( WebCME )</a> based on the Dojo framework.<br />
It is in constant bugfixing and feature enhancement, but we are proud to announce that a first usable version of this tool is available.</p>
<div style='float: right'><img src="http://ardoino.com/wp-content/uploads/2009/02/moledit1-150x150.jpg" alt="moledit1" title="moledit1" width="150" height="150" class="alignright size-thumbnail wp-image-211" /></div>
<p><strong>Current features list:</strong><br />
    * adding elements ( with automatic elements’ balancement )<br />
    * adding bonds ( single, double, triple, wedges, … )<br />
    * adding text ( useful for notes, … )<br />
    * lot of prepackaged structures ( amino acids, cycles, … )<br />
    * selected points rotation<br />
    * importing 2D .mol format files<br />
    * exporting .png images<br />
    * integrated periodic table</p>
<p><strong>Next features list:</strong><br />
    * quick buttons<br />
    * code refactoring<br />
    * exporting in .mol, .png format files<br />
    * arrows</p>
<p>Enjoy it, and help us to improve!</p>
]]></content:encoded>
			<wfw:commentRss>http://ardoino.com/210-chemical-molecular-editor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WBus v0.1 released</title>
		<link>http://ardoino.com/118-wbus-v01-released/</link>
		<comments>http://ardoino.com/118-wbus-v01-released/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 09:34:03 +0000</pubDate>
		<dc:creator>Paolo Ardoino</dc:creator>
				<category><![CDATA[Ajax/Javascript]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://ardoino.com/?p=118</guid>
		<description><![CDATA[
WBus stands for Web Bus and it is a simple all purpose method to get two or more clients (browsers) communicating using a web page as the communication channel.


]]></description>
			<content:encoded><![CDATA[<div style='float:right'><a href="http://ardoino.com/wp-content/uploads/2008/07/wbus_screen_1.jpg"><img src="http://ardoino.com/wp-content/uploads/2008/07/wbus_screen_1-150x150.jpg" alt="" title="WBus screenshot 1" width="150" height="150" class="alignright size-thumbnail wp-image-127" /></a></div>
<p><a href='http://ardoino.com/web-wbus/'><strong>WBus</strong></a> stands for Web Bus and it is a simple all purpose method to get two or more clients (browsers) communicating using a web page as the communication channel.<br />
<br />
<center><a href="http://ardoino.com/web-wbus/"><img src="http://ardoino.com/wp-content/uploads/2008/07/logo-wbus-300x135.png" alt="" title="WBUs logo" width="300" height="135" class="alignnone size-medium wp-image-79" /></a></center></p>
]]></content:encoded>
			<wfw:commentRss>http://ardoino.com/118-wbus-v01-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WarWide: innovative strategic war (multiplayer) browsergame</title>
		<link>http://ardoino.com/3-warwide-innovative-strategic-war-multiplayer-browsergame/</link>
		<comments>http://ardoino.com/3-warwide-innovative-strategic-war-multiplayer-browsergame/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 07:00:42 +0000</pubDate>
		<dc:creator>Paolo Ardoino</dc:creator>
				<category><![CDATA[Ajax/Javascript]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web2.0]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[browsergame]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[warwide]]></category>

		<guid isPermaLink="false">http://ardoino.com/?p=3</guid>
		<description><![CDATA[WarWide is a free strategic war multiplayer browsergame set in the real world with thousands opposing players, each of them fighting as the emperor of a group of cities and having, as primary goal, the growth of his Empire conquering enemy lands.]]></description>
			<content:encoded><![CDATA[<p><center><a href='http://www.warwide.com' target='_blank'><img src="http://ardoino.com/wp-content/uploads/2008/06/warwide_banner_eng.png" alt="" title="WarWide banner" width="468" height="60" class="aligncenter size-full wp-image-50" /></a></center></p>
<p>These months I have been kept busy with the development, testing and debugging of the new version of <a href="http://www.involutive.com" title="Involutive" target="_blank">Involutive</a>&#8217;s browsergame: <a href="http://www.warwide.com" title="WarWide strategic war multiplayer browsergame" target="_blank">WarWide</a>.<br/><br />
<u>Note</u>: It is available only for Italian people, but in a few months and English version will come to the light!<br/><br />
WarWide is a free strategic war multiplayer browsergame set in the <strong>real world</strong> with thousands opposing players, each of them fighting as the emperor of a group of (truly existing) cities and having, as primary goal, the growth of his Empire conquering enemy lands and establishing alliances with governors of nearby territories.<br/></p>
<div style='float:right;'><a target='_blank' href='http://ardoino.com/wp-content/uploads/2008/06/ww_screen_8.png'><img src="http://ardoino.com/wp-content/uploads/2008/06/ww_screen_8-150x150.png" alt="" title="WarWide interactive map : Rome ( Italy ) coasts" width="150" height="150" class="alignnone size-thumbnail wp-image-47" /></a><br/><a  target='_blank' href='http://ardoino.com/wp-content/uploads/2008/06/ww_screen_7.png'><img src="http://ardoino.com/wp-content/uploads/2008/06/ww_screen_7-150x150.png" alt="" title="WarWide military recruitment panel" width="150" height="150" class="alignnone size-thumbnail wp-image-46" /></a><br/><a target='_blank' href='http://ardoino.com/wp-content/uploads/2008/06/ww_screen_4.png'><img src="http://ardoino.com/wp-content/uploads/2008/06/ww_screen_4-150x150.png" alt="" title="WarWide technology panel" width="150" height="150" class="alignnone size-thumbnail wp-image-49" /></a></div>
<p><center><a target='_blank' href="http://www.warwide.com/screenshots.html">Watch SCREENSHOT gallery</a>!<br/><br />
<a target='_blank' href='http://ardoino.com/wp-content/uploads/2008/06/ww_screen_2.png'><img src="http://ardoino.com/wp-content/uploads/2008/06/ww_screen_2-300x187.png" alt="" title="WarWide interactive map : Corsica and Sardinia" width="300" height="187" class="alignnone size-medium wp-image-48" /></a></center><br />
One of the most interesting and innovative features, that distinguish WarWide between other browsergames, it&#8217;s the interactive (Google maps like) map of our Earth, perfectly integrated in the game: players could interact with it, move armies, fleets and resources, fight for every piece of land or sea, wait in ambushes enemies and help allies.<br/>Each action within the map has a good precision level (up to about five hundred meters) due to our improved algorithms and this gives an improved playability&#8230; cruise the Bosporus or the strait between Corsica and Sardinia (in the screenshot above)<br/><br/></p>
<p>Lots of buildings, technologies and military units are available to give lots of variants and huge longevity to the game.<br/><br />
<strong>Each feature of the game is built to be more faithful to realty as possible.</strong><br/><br/></p>
<p>From previous version lots of chances have been done:</p>
<ul>
<li>Completely rewritten game engine</li>
<li>Completely rewritten game interface, now using JQuery</li>
<li>Ships and sailing navigation (previous version had only land military units)</li>
<li>Paths and areas visualization on the interactive map</li>
<li>Inventory items that gives bonus to armies and players</li>
<li>Army tasks stack to improve strategic operations</li>
<li>Improved speed of geographic algorithms</li>
</ul>
<p><br/><br />
Technical details:
<ul>
<li>Operative System: Gentoo Linux ( 2.6.x )</li>
<li>Game engine: PHP 5 (game engine), C (geographical algorithms)</li>
<li>User interface: HTML, Javascript and Ajax</li>
<li>Database: MySQL</li>
<li>Map interface : <a target='_blank' href='http://www.openlayers.org'>Openlayers</a></li>
</ul>
<p><strong>Enjoy it!</strong><br/><br />
P.S: I would thank the whole <a target='_blank' href='http://forum.warwide.it'>italian WarWide community</a> for their good job in debugging and hinting.</p>
]]></content:encoded>
			<wfw:commentRss>http://ardoino.com/3-warwide-innovative-strategic-war-multiplayer-browsergame/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Online social (and unaware) CAPTCHA cracking</title>
		<link>http://ardoino.com/41-online-social-and-unaware-captcha-cracking/</link>
		<comments>http://ardoino.com/41-online-social-and-unaware-captcha-cracking/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 07:00:27 +0000</pubDate>
		<dc:creator>Paolo Ardoino</dc:creator>
				<category><![CDATA[Crypto/Security]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[cracking]]></category>
		<category><![CDATA[distributed]]></category>
		<category><![CDATA[social]]></category>

		<guid isPermaLink="false">http://ardoino.com/41-online-social-and-unaware-captcha-cracking/</guid>
		<description><![CDATA[Online social (and unaware) CAPTCHA cracking ]]></description>
			<content:encoded><![CDATA[<p><strong>Note</strong>: remember that this is only an idea and I&#8217;m not responsible of its use.</p>
<p>Yesterday I was talking with my friend <a href="http://scola.netsons.org" title="Davide Scola blog" target="_blank">Davide</a> about the announce of Yahoo&#8217;s and Google&#8217;s CAPTCHAs cracked and another funny and foolish idea, something similar to <a href="http://ardoino.com/32-javascript-online-password-cracking/" title="Javascript online massive social password cracking ? " target="_blank">Javascript online massive social password cracking</a>, came into my mind.</p>
<p>Articles report that breaking algorithms have a success rate from 10% to 35%,with an average of 1 crack for 5 attempts&#8230; too slow!</p>
<p>There should be a method to improve the success rate and here I would like to discuss a nice scenario that I hope nobody would implement ;-) </p>
<p>
<strong>Base idea</strong>:</p>
<p><a href="http://ardoino.com/wp-content/uploads/2008/03/captcha-crack.jpeg" title="Captcha cracking procedure"><img src="http://ardoino.com/wp-content/uploads/2008/03/captcha-crack.jpeg" alt="Captcha cracking procedure" align="right" width="250" /></a>  There are three base components to get this idea working:
<ul>
<li><em>spam-bots</em> : bots used to spam blogs, forums and websites.
<ul>
<li>they submit CAPTCHA decoding requests to a server (named <em>capster</em>)</li>
</ul>
</li>
<li><em>capster</em> is divided in :
<ul>
<li>a server that handles CAPTCHA decoding requests&#8217; queue (named <em>cpqueue</em>)</li>
<li>a <em>website</em> of social interest ( :-) explained later )</li>
</ul>
</li>
<li><em>unaware users</em> : clients of the website
<ul>
<li>they decodes CAPTCHAs displayed in website&#8217;s pages</li>
</ul>
</li>
</ul>
<p>The success of this approach depends on the topic of the website&#8230; We need something that could never become boring&#8230; Yes, I know you&#8217;re thinking about it! Yeah! Sex!!</p>
<p>So let be <em>pornography</em> the topic of the website.</p>
<p>As explained in the diagram, <em>spam-bots </em>send CAPTCHA decoding requests to <em>cpqueue </em>(part of <em>capster</em>) which forwards them to the <em>website</em> and here <em>unaware users</em> resolve them.</p>
<p>Every 5-6 photos or 2 videos the <em>unaware user </em>have to enter the code of a CAPTCHA displayed on a page to continue browsing. An horde of sizzling surfers will be happy to decode CAPTCHAs to quickly proceed to the next step of strip tease :-D</p>
<p>Probably the wish to see something more will obfuscate the consciousness of what they&#8217;re doing!</p>
<p>With a bit of luck we can obtain a success rate of 100% ;-) </p>
<p>I heard that there&#8217;s some Virus which implement a similar approach using popup strip teases, but malware has always to fight to survive on a computer so there&#8217;s the constant risk that the cracking farm will decline day by day and then.. arent&#8217; we in the Web(2/3/4).0 era or not ?
<p>&nbsp;</p>
<p>Thanks to:<br />
<a href="http://scola.netsons.org" title="Davide Scola's blog">Davide Scola</a> that gave me some hints<br />
<a href="http://www.motocarota.com" title="Motocarota's blog">Motocarota</a> that gives a better look to my thoughts</p>
]]></content:encoded>
			<wfw:commentRss>http://ardoino.com/41-online-social-and-unaware-captcha-cracking/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Javascript online massive social password cracking ?</title>
		<link>http://ardoino.com/32-javascript-online-password-cracking/</link>
		<comments>http://ardoino.com/32-javascript-online-password-cracking/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 07:00:12 +0000</pubDate>
		<dc:creator>Paolo Ardoino</dc:creator>
				<category><![CDATA[Ajax/Javascript]]></category>
		<category><![CDATA[Crypto/Security]]></category>
		<category><![CDATA[3des]]></category>
		<category><![CDATA[cracking]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[des]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[john the ripper]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://ardoino.com/32-javascript-online-password-cracking/</guid>
		<description><![CDATA[
In these days I was using John the Ripper ( the most famous password cracking software tool ) to test robustness of a set of passwords &#8230; of mine ;-)
While my new wonderful Sony Vaio TZ was overheating and fans seemed to get my laptop flying I had this unhealthy thought: what about a javascript [...]]]></description>
			<content:encoded><![CDATA[<p><script src="/pub/3rdparty/des.js"></script><br />
In these days I was using <a href="http://www.openwall.com/john/" title="John the Ripper password cracker" target="_blank">John the Ripper</a> ( the most famous password cracking software tool ) to test robustness of a set of passwords &#8230; of mine ;-)</p>
<p>While my new wonderful Sony Vaio TZ was overheating and fans seemed to get my laptop flying I had this <strong>unhealthy</strong> thought: what about a<strong> javascript online massive social password cracking</strong> ? ( first definition was only <em>javascript password cracking</em> but I needed to add some cooler keyword to gain more audience :-D )</p>
<p>Yes, I know there&#8217;s a very useful tool called <a href="http://ktulu.com.ar/blog/software/djohn/" title="DJohn: Distributed John the Ripper" target="_blank">djohn</a> , but I haven&#8217;t a cluster ( only two laptops ) nor a botnet. So&#8230; how could I setup a network of computers to distribute cracking task ?</p>
<p>Social networks seem to be very popular today and people have a lot of computer idle to waste !! :-) However this article will not focus on the philosophical or social facet but only on the technical feasibility study of a Javascript DES cypher implementation and its performance running on modern browsers ( Mozilla Firefox, Opera and Konqueror )</p>
<p>A simple first implementation came in my mind:</p>
<ul>
<li>DES and Triple DES encrypted password cracking</li>
<li>Brute force/incremental method : all possible character combinations as passwords</li>
<li>Password&#8217;s space divided in work packets by a web server that coordinates the effort among the clients ( browsers )</li>
</ul>
<p>Other cracking methods, such as wordlist, are very much faster than brute force, but more complex, than password&#8217;s space subdivision, to coordinate via AJAX.<br />
I had a quick look to JTR source to understand its cracking procedure, so I decided to port its Triple DES cipher implementation to javascript. Writing this article I found this <a href="http://www.tero.co.uk/des/code.php" title="Javascript Triple DES cipher" target="_blank">one</a> that seems to be a bit faster than mine.</p>
<p>Had you ever benchmarked John The Ripper on  your machine? Here are results of the 3DES on my Sony Vaio TZ ( Intel Core 2 &#8211; ULV U7600 1.20ghz ) :</p>
<p><em>~# john &#8211;test </em></p>
<p><em>Benchmarking: Traditional DES [128/128 BS SSE2]&#8230; DONE<br />
Many salts:     1019K c/s real, 1019K c/s virtual<br />
Only one salt:  815539 c/s real, 839032 c/s virtual</em></p>
<p>Wow! 1019K cracks per second!!</p>
<p>How many days do we need, at most, to crack a weak 8 bytes ASCII password with a brute force attack? ( Note: read about <a href="http://en.wikipedia.org/wiki/Password_strength" title="Wikipedia: password strength" target="_blank">password strength</a> )</p>
<ul>
<li>assuming to know that it is 8 byte ASCII password</li>
<li>64^8 : are the <a href="http://en.wikipedia.org/wiki/Combinatorics#Permutations_with_repetitions" title="Wikipedia : permutations with repetitions" target="_blank">permutations with repetitions</a></li>
<li>64^8 / ( 1019 * 10^3 ) = 276226669 secs = 3197 days needed to cover all the key space</li>
</ul>
<p>Having a wide set of computers, a lan with some good machine, the cracking time will fly down quickly.</p>
<p>Ok, these are the results of a C compiled Triple DES. An xyssl library based solution gave me a proof of the validity of JTR results.</p>
<p>Clearly we all know that interpreted languages are slower than compiled ones&#8230; so I was expecting that an interpreted implementation of the algorithm could be 30, 50, 100 times slower &#8230;</p>
<p>No!  it&#8217;s from 2000 to 4000 times slower !!!</p>
<p>Here are my browsers&#8217; tests ( on Gentoo with an Intel Core 2 &#8211; ULV U7600 1.20ghz ) :</p>
<ul>
<li>Mozilla Firefox 2.0.12 : ~250 cracks per second</li>
<li>Mozilla Firefox 3.0 beta3 : ~250 cracks per second ( &#8230; I was expecting better results than 2.0 version &#8230; )</li>
<li>Konqueror 4.0 : ~500 cracks per second ( I love it !! )</li>
<li>Opera 9.25 : ~370 cracks per second</li>
<li>Safar 3 : results should be similar to Konqueror, because both use Webkit</li>
<li>Internet Explorer : data unavailable</li>
</ul>
<p><a href="javascript:void(0);" onclick="des_test();">Test Javascript 3DES performances on your browser</a> and please comment this post to report them (including your hardware, CPU at least)</p>
<p>Then I tested mcrypt PHP implementation ( with the code below ) and results weren&#8217;t better : ~1000 cracks per second.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$ts_start</span> <span style="color: #339933;">=</span> <span style="color: #990000;">gettimeofday</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>while<span style="color: #009900;">&#40;</span>1<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$ts_end</span> <span style="color: #339933;">=</span> <span style="color: #990000;">gettimeofday</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ts_end</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;sec&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$ts_start</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;sec&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> 1<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$ts_end</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;usec&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$ts_start</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;usec&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
  <span style="color: #339933;">@</span><span style="color: #990000;">mcrypt_encrypt</span><span style="color: #009900;">&#40;</span>MCRYPT_3DES<span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;cialfklweflkwnelfkw&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Prova&quot;</span><span style="color: #339933;">,</span> MCRYPT_MODE_ECB<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$cnt</span><span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Cracks per second: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$cnt</span><span style="color: #339933;">++;</span></pre></div></div>

<p>Another test to compare web browser is a simple addition. The C compiled version performs up to 100000000 additions per second and here are results of the Javascript implementation on browsers :</p>
<ul>
<li>Firefox 2.0.12 : ~33000 additions per second</li>
<li>Firefox 3.0 beta3 : ~96000 additions per second ( fortunately, here it&#8217;s faster than 2.0.x )</li>
<li>Konqueror 4.0 : ~130000 additions per second</li>
<li>Opera 9.25 : 153000 ( good! )</li>
</ul>
<p>Conclusion&#8230;</p>
<p>Performances of Javascript engines are still not good enough and I think this could be a very hard limit to Web2.0 that should be overtaken as soon as possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://ardoino.com/32-javascript-online-password-cracking/feed/</wfw:commentRss>
		<slash:comments>45</slash:comments>
		</item>
		<item>
		<title>Be Quick Or Be Dead: browsergame spell caster powered by dojo gfx and SVG/VML rendering</title>
		<link>http://ardoino.com/17-game-be-quick-or-be-dead/</link>
		<comments>http://ardoino.com/17-game-be-quick-or-be-dead/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 14:28:37 +0000</pubDate>
		<dc:creator>Paolo Ardoino</dc:creator>
				<category><![CDATA[Ajax/Javascript]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[2d]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[browsergame]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[rendering]]></category>
		<category><![CDATA[svg]]></category>
		<category><![CDATA[vml]]></category>

		<guid isPermaLink="false">http://ardoino.com/17-game-be-quick-or-be-dead/</guid>
		<description><![CDATA[
Url: http://ardoino.com/game-be-quick-or-be-dead/
Play now!!
The plot is based on comics written by Motocarota : a powerful wizard has to kill much kobolds as possible casting fireballs against them.
To shot fireballs to enemies you have to write its name in the textbox below the game area and press enter&#8230; a nice way to test your typewriting ability, isn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://ardoino.com/17-game-be-quick-or-be-dead/be-quick-or-be-dead/" target="_blank" rel="attachment wp-att-18" title="Be Quick Or Be Dead"><img src="http://ardoino.com/wp-content/uploads/2008/02/bequickorbedead.thumbnail.png" alt="Be Quick Or Be Dead" align="right" /></a></p>
<p><strong>Url:</strong> <a href="http://ardoino.com/game-be-quick-or-be-dead/" target="_blank">http://ardoino.com/game-be-quick-or-be-dead/</a><br />
<a href="http://ardoino.com/game-be-quick-or-be-dead/" title="Be Quick Or Be Dead: browsergame spell caster powered by dojo gfx and SVG/VML rendering" target="_blank"><strong>Play now!!</strong></a><br/><br />
The plot is based on comics written by <a href="http://www.motocarota.com" title="Motocarota blog" target="_blank">Motocarota</a> : a powerful wizard has to kill much kobolds as possible casting fireballs against them.</p>
<p>To shot fireballs to enemies you have to write its name in the textbox below the game area and press enter&#8230; a nice way to test your typewriting ability, isn&#8217;t it?.<br />
<span id="more-17"></span></p>
<p>I used only few hours to create the game. At the beginning I opted to use 2D CANVAS tag as rendering system (supported by Mozilla Firefox, Opera and Safari) and explorer-canvas for VML, Vector Markup Language (supported by Internet Explorer).</p>
<p>In a few minutes, bored by IE7 incomptaibility with standards, I decided to try Dojo that should have a wide crossbrowser compatibility, dojo.gfx library included. This framework supports Canvas, SVG and VML giving simple API for 2D drawing.<br />
<img src="http://ardoino.com/wp-content/uploads/2008/02/bqobd_wizardthumbnail.jpg" alt="Be Quick Or Be Dead Wizard" align="right" /></p>
<p>In a few time I had the game engine and once obtained spirtes Be Quick or Be Dead was complete.</p>
<p>The only disavantage of Dojo usage in BQOBD development was the first time loading slowness, but Firefox cache has worked fine for next page accesses.</p>
<p>Creation and drawing on the 2D surface is very simple :</p>
<ul>
<li>ctx = dojox.gfx.createSurface creates a 2D surface</li>
<li>images, text, rectangles, … are objects that can be drawed on that surface (i.e. img = ctx.createImage(); )</li>
<li> shapes could be modified on the fly by setShape method (i.e. img.setShape(newShape); )</li>
</ul>
<p><a href="http://ardoino.com/game-be-quick-or-be-dead/" title="Be Quick Or Be Dead: browsergame spell caster powered by dojo gfx and SVG/VML rendering" target="_blank"><strong>Play now!!</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ardoino.com/17-game-be-quick-or-be-dead/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP and Wget sitemap generator for search engines</title>
		<link>http://ardoino.com/15-google-php-wget-sitemap-generator/</link>
		<comments>http://ardoino.com/15-google-php-wget-sitemap-generator/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 15:00:29 +0000</pubDate>
		<dc:creator>Paolo Ardoino</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[search engine]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[sitemap]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://ardoino.com/15-google-php-wget-sitemap-generator/</guid>
		<description><![CDATA[Sitemaps are of primary importance in Search Engine Optimization ( SEO for friends :) )
PHP Wget Sitemap Generator class takes advantage of wget to get a local mirror of the target site and then generates the url list for the sitemap via local directory listing.
Wget is highly configurable so read the man page of best [...]]]></description>
			<content:encoded><![CDATA[<p>Sitemaps are of primary importance in Search Engine Optimization ( SEO for friends :) )</p>
<p>PHP Wget Sitemap Generator class takes advantage of wget to get a local mirror of the target site and then generates the url list for the sitemap via local directory listing.<br />
<a href="http://www.gnu.org/software/wget/" title="GNU Wget" target="_blank">Wget</a> is highly configurable so read the man page of best options to use (replace <em>exec</em> function argument).</p>
<p>The code:<br />
<span id="more-15"></span></p>
<p><strong>Version</strong>: 0.2</p>
<p><span style="color: #000000; font-weight: bold;">&lt;?php</span></p>
<p><span style="color: #666666; font-style: italic;">// PHP Wget Sitemap generator v0.2</span><br />
<span style="color: #666666; font-style: italic;">// (c) 2008 by Paolo Ardoino &lt; paolo.ardoino@gmail.com &gt;</span></p>
<p><span style="color: #000000; font-weight: bold;">class</span> PHPWgetSitemap <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$opts</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;sitemap_file&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;sitemap.xml&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;website_url&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$siteamp</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></p>
<p>&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;PHP Wget Sitemap generator v0.2<span style="color: #000099; font-weight: bold;">\t</span>(c) 2008 by Paolo Ardoino &lt; paolo.ardoino@gmail.com &gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span></p>
<p>&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> setSitemapFile<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sitemap_file</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">opts</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;sitemap_file&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$sitemap_file</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span></p>
<p>&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> setWebsiteUrl<span style="color: #009900;">&#40;</span><span style="color: #000088;">$website_url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">opts</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;website_url&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$website_url</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span></p>
<p>&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> mirror<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">opts</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;website_url&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Wget: fetching &#8216;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">opts</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;website_url&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&#8217; website<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/exec"><span style="color: #990000;">exec</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;wget -m &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">opts</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;website_url&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; 2&gt; wget.log&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span></p>
<p>&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> generate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">opts</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;website_url&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$website_dir</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">opts</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;website_url&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> 7<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$website_dir</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;PHPWgetSitemap: scanning &#8216;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$website_dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&#8217; for sitemap generation<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sitemap</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_scan<span style="color: #009900;">&#40;</span><span style="color: #000088;">$website_dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ssave</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span></p>
<p>&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> _scan<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$sitemap</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$FILES_EXCLUDE</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;.&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;..&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;index.php&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;index.html&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;index.htm&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/is_dir"><span style="color: #990000;">is_dir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/opendir"><span style="color: #990000;">opendir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/chdir"><span style="color: #990000;">chdir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$sitemap</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">!==</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/readdir"><span style="color: #990000;">readdir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/in_array"><span style="color: #990000;">in_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #000088;">$FILES_EXCLUDE</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/is_dir"><span style="color: #990000;">is_dir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$arr</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_scan<span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$arr</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$sitemap</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$value</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$sitemap</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$file</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/chdir"><span style="color: #990000;">chdir</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;../&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/closedir"><span style="color: #990000;">closedir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$sitemap</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span></p>
<p>&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> ssave<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$sitemap_file</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">opts</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;sitemap_file&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sitemap_file</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/fopen"><span style="color: #990000;">fopen</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sitemap_file</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;w+&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$out</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&#8216;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;urlset<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns=&quot;http://www.google.com/schemas/sitemap/0.84&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xsi:schemaLocation=&quot;http://www.google.com/schemas/sitemap/0.84<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://www.google.com/schemas/sitemap/0.84/sitemap.xsd&quot;&gt;&#8217;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for($i = 0, $y = sizeof($this-&gt;sitemap); $i &lt; $y; $i++) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $out .= &quot;&lt;url&gt;\n\t&lt;loc&gt;http://&quot;.$this-&gt;sitemap[$i].&quot;&lt;/loc&gt;\n\t&lt;priority&gt;0.500&lt;/priority&gt;\n&lt;/url&gt;\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $out .= &#8216;&lt;/urlset&gt;&#8217;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fputs($fp, $out);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fclose($fp);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Sitemap has been written to &#8216;&quot;.$sitemap_file.&quot;&#8217;.\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Error: cannot save &#8216;&quot;.$sitemap_file.&quot;&#8217; file.\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; <br />
}</p>
<p>$n = new PHPWgetSitemap();<br />
$n-&gt;setWebsiteUrl(&quot;http://ardoino.com&quot;);<br />
$n-&gt;mirror();<br />
$n-&gt;generate();<br />
?&gt;<br />
&nbsp;</pre>
<p><strong>Download this code:</strong> <a href="http://ardoino.com/pub/web/phpwgetsitemap.txt">phpwgetsitemap.txt</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ardoino.com/15-google-php-wget-sitemap-generator/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Increase website traffic with Google language tools</title>
		<link>http://ardoino.com/11-seo-increase-website-traffic-google-translations/</link>
		<comments>http://ardoino.com/11-seo-increase-website-traffic-google-translations/#comments</comments>
		<pubDate>Fri, 08 Jun 2007 07:00:42 +0000</pubDate>
		<dc:creator>Paolo Ardoino</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://ardoino.com/web-seo-increase-traffic-google-translations/</guid>
		<description><![CDATA[The goal of this article is to show how to exploit Google imperfect translations to increase your website traffic.
Disclaimer :  this is only a hack and you should not use this idea in your site because search engines may not like it :P &#8230; but hack is always a good thing ;)
Google bot indexes [...]]]></description>
			<content:encoded><![CDATA[<p>The goal of this article is to show how to exploit Google<strong> imperfect</strong><em> </em>translations to increase your website traffic.</p>
<p><strong>Disclaimer</strong> :  this is only a hack and you should not use this idea in your site because search engines may not like it :P &#8230; but hack is always a good thing ;)</p>
<p>Google bot indexes relevant content of each page of your website, and so each word used in your texts could be a valid keyword to be found in search engine&#8217;s results. This simply means that producing more relevant content chances to be found grow.</p>
<p>Your site&#8217;s language is only your main language? What would happen if you translate your pages in more than one language? Simple, you&#8217;ll get more daily visitors!<br />
<span id="more-11"></span></p>
<p>Using <em>Google language tools </em>you could translate all site&#8217;s content ( using an automated script I suggest ;) ) &#8230; but as we know that translations are imperfect and often cryptic for common humans.</p>
<p><strong>So&#8230; where&#8217;s the hack?</strong></p>
<p><strong>Simple</strong> ! A simple script at the top of pages that performs this controls:</p>
<ul>
<li>if useragent connecting to a page is <em>Googlebot</em> ( or other search engine spider bot ), we display translated text ( with <em>Google Translator</em> )</li>
<li>otherwise main language content will be displayed</li>
</ul>
<p>So, search engines will index pages in your main <strong>language</strong>and in all languages generated by <em>Google Translator</em>and your website will appear in search engine results for a bigger set of keywords but when a visitor try to access to a page containing imperfect and no good translations he will be redirected to the page in the main language.</p>
<p>Create a simple test site on a free hosting service to believe ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://ardoino.com/11-seo-increase-website-traffic-google-translations/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
