<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7749730490023417716</id><updated>2011-11-27T16:20:11.494-08:00</updated><title type='text'>Some secret stuff</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://somesecretstuff.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7749730490023417716/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://somesecretstuff.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>rubygaluga</name><uri>http://www.blogger.com/profile/14423449858277238034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7749730490023417716.post-5976100458696385324</id><published>2007-11-09T08:40:00.001-08:00</published><updated>2007-11-09T08:48:45.342-08:00</updated><title type='text'>Rolling with Ruby on Rails</title><content type='html'>Maybe you've heard about Ruby on Rails, the super productive new way to develop web applications, and you'd like to give it a try, but you don't know anything about Ruby or Rails. This article steps through the development of a web application using Rails. It won't teach you how to program in Ruby, but if you already know another object-oriented programming language, you should have no problem following along (and at the end you can find links on learning Ruby).&lt;br /&gt;&lt;br /&gt;Let's answer a couple of burning questions before rolling up our sleeves to build a web application!&lt;br /&gt;What is Ruby?&lt;br /&gt;&lt;br /&gt;Ruby is a pure object-oriented programming language with a super clean syntax that makes programming elegant and fun. Ruby successfully combines Smalltalk's conceptual elegance, Python's ease of use and learning, and Perl's pragmatism. Ruby originated in Japan in the early 1990s, and has started to become popular worldwide in the past few years as more English language books and documentation have become available.&lt;br /&gt;What is Rails?&lt;br /&gt;&lt;br /&gt;Rails is an open source Ruby framework for developing database-backed web applications. What's special about that? There are dozens of frameworks out there and most of them have been around much longer than Rails. Why should you care about yet another framework?&lt;br /&gt;&lt;br /&gt;What would you think if I told you that you could develop a web application at least ten times faster with Rails than you could with a typical Java framework? You can--without making any sacrifices in the quality of your application! How is this possible?&lt;br /&gt;&lt;br /&gt;Part of the answer is in the Ruby programming language. Many things that are very simple to do in Ruby are not even possible in most other languages. Rails takes full advantage of this. The rest of the answer is in two of Rail's guiding principles: less software and convention over configuration.&lt;br /&gt;&lt;br /&gt;Less software means you write fewer lines of code to implement your application. Keeping your code small means faster development and fewer bugs, which makes your code easier to understand, maintain, and enhance. Very shortly, you will see how Rails cuts your code burden.&lt;br /&gt;&lt;br /&gt;Convention over configuration means an end to verbose XML configuration files--there aren't any in Rails! Instead of configuration files, a Rails application uses a few simple programming conventions that allow it to figure out everything through reflection and discovery. Your application code and your running database already contain everything that Rails needs to know!&lt;br /&gt;Seeing is Believing&lt;br /&gt;&lt;br /&gt;We developers often hear the excessive hype that always seems to accompany something new. I can just imagine that skeptical look on your face as you hear my dubious claims. Ten times faster development, indeed!&lt;br /&gt;&lt;br /&gt;Editor's Note: Bill Walton has ported this tutorial to Rolling with Ruby on InstantRails -- for a very quick installation experience.&lt;br /&gt;&lt;br /&gt;I'm not asking you to accept this on blind faith. I'll show you how to prove it to yourself. First, I'll install the needed software. Then I will lead you through the development of a web application.&lt;br /&gt;Installing the Software&lt;br /&gt;&lt;br /&gt;We'll develop this web application on Windows. You can still follow along if you use a Linux or Macintosh system, but your screen will look different from the screen shots shown below and you will have to install software packages built specifically for your system. See the Resources section at end of this article for additional software links.&lt;br /&gt;&lt;br /&gt;To develop this web application, install the following software:&lt;br /&gt;&lt;br /&gt;    * Ruby&lt;br /&gt;    * The Rails framework&lt;br /&gt;    * The MySQL database (and perhaps a MySQL GUI client)&lt;br /&gt;&lt;br /&gt;Step 1: Install Ruby&lt;br /&gt;&lt;br /&gt;Ruby Windows installer&lt;br /&gt;Figure 1. Ruby Windows installer&lt;br /&gt;&lt;br /&gt;Installing Ruby couldn't be any simpler:&lt;br /&gt;&lt;br /&gt;   1. Download the latest One-Click Ruby Installer for Windows (shown in Figure 1). As of this writing, the latest is ruby182-14.exe).&lt;br /&gt;   2. Double-click on the downloaded executable and follow the installation instructions. Unless you have some special needs, just press Enter to accept all of the defaults.&lt;br /&gt;&lt;br /&gt;Note to Linux and OS X users: The Windows installer come with the RubyGems package manager already installed. Whatever means you use to install Ruby, you will probably have to install RubyGems, also.&lt;br /&gt;Step 2: Install Rails&lt;br /&gt;&lt;br /&gt;installing Rails through RubyGems&lt;br /&gt;Figure 2. Installing Rails through RubyGems&lt;br /&gt;&lt;br /&gt;Now we can use the RubyGems package manager to download and install Rails 0.9.4 (the version covered by this tutorial), as Figure 2 shows:&lt;br /&gt;&lt;br /&gt;   1. Open a command window and run the command gem install rails --remote.&lt;br /&gt;   2. RubyGems will also install all of the other libraries that Rails depends on. For each of these dependencies, RubyGems will ask you if you want to install it. Answer "y" (yes) to each one.&lt;br /&gt;&lt;br /&gt;Step 3: Install MySQL&lt;br /&gt;&lt;br /&gt;MySQL Server setup wizard&lt;br /&gt;Figure 3. MySQL Server setup wizard&lt;br /&gt;&lt;br /&gt;We still need to install our database server. Rails supports many different databases. We'll use MySQL.&lt;br /&gt;&lt;br /&gt;   1. Download the latest "essential" version of the MySQL Windows installer. (Currently, that is Windows Essentials (x86) 4.1.7.)&lt;br /&gt;   2. Double-click on the installer (Figure 3) and accept all of the defaults, though skip signing up for a mysql.com account.&lt;br /&gt;   3. When you reach the final panel of the installer, clicking the Finish button will bring up the configuration wizard.&lt;br /&gt;   4. In the configuration wizard, you can also just accept all of the defaults, except that in the security panel you must uncheck the "Modify Security Settings" checkbox (Figure 4). This is because starting with version 4.1.7, MySQL uses a new authentication algorithm that is not compatible with older client software, including the current version of Rails. By unchecking this box, you can access MySQL without a password.&lt;br /&gt;&lt;br /&gt;MySQL configuration wizard&lt;br /&gt;Figure 4. MySQL configuration wizard&lt;br /&gt;Step 4: Install MySQL-Front&lt;br /&gt;&lt;br /&gt;Author's note: MySQL-Front is not longer available. HeidiSQL is a good open source equivalent.&lt;br /&gt;&lt;br /&gt;MySQL-Front is a graphical interface for the MySQL database. It is an inexpensive commercial application, but you can try it for free for 30 days. In this article, we will use MySQL-Front to develop our database. If you prefer, you can also just send SQL commands to the database from the command line.&lt;br /&gt;&lt;br /&gt;   1. Download the latest version of MySQL-Front (currently, version 3.1).&lt;br /&gt;   2. Double-click on the downloaded executable and follow the installation instructions (Figure 5). Unless you have some special needs, you can accept all of the defaults.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Please click one of the following ads by Google to go to the next page..&lt;/span&gt;.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7749730490023417716-5976100458696385324?l=somesecretstuff.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7749730490023417716/posts/default/5976100458696385324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7749730490023417716/posts/default/5976100458696385324'/><link rel='alternate' type='text/html' href='http://somesecretstuff.blogspot.com/2007/11/rolling-with-ruby-on-rails_09.html' title='Rolling with Ruby on Rails'/><author><name>rubygaluga</name><uri>http://www.blogger.com/profile/14423449858277238034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7749730490023417716.post-2601294971933065305</id><published>2007-11-09T08:09:00.000-08:00</published><updated>2007-11-09T08:48:20.761-08:00</updated><title type='text'>Top 12 Ruby on Rails Tutorials</title><content type='html'>&lt;ol&gt;&lt;li&gt;&lt;a href="http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html"&gt;Rolling with Ruby on Rails&lt;/a&gt; - Curtis Hibbs of ONLamp.com offers his first excellent introduction to Ruby on Rails. This is the article that got me really excited about RoR.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.onlamp.com/pub/a/onlamp/2005/03/03/rails.html"&gt;Rolling with Ruby on Rails, Part 2&lt;/a&gt; - The sequel to Curtis Hibbs excellent series of articles.&lt;/li&gt;&lt;li&gt;&lt;a href="http://rails.homelinux.org/"&gt;Four Days on Rails (PDF)&lt;/a&gt; - a great tutorial that is broken down into simple tasks that you can do over a four day period. To be quite honest, this tutorial only takes about 2 hours, but nonetheless it is very well organized!&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.slash7.com/articles/2005/01/24/really-getting-started-in-rails"&gt;Really Getting Started in Rails&lt;/a&gt; - Amy Hoy has a great tutorial that not only covers RoR, but also introduces the reader to many of the basic concepts of the very cool Ruby scripting language.&lt;/li&gt;&lt;li&gt;&lt;a href="http://wiki.rubyonrails.com/rails/pages/Tutorial"&gt;Tutorial in Ruby on Rails&lt;/a&gt; - is a basic tutorial aimed at newbies.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www-128.ibm.com/developerworks/linux/library/l-rubyrails/"&gt;Fast-track your Web apps with Ruby on Rails&lt;/a&gt; - IBM jumps into the sandbox with an excellent (as usual) tutorial to get you on your feet fast.&lt;/li&gt;&lt;li&gt;&lt;a href="http://webmonkey.wired.com/webmonkey/05/28/index4a.html"&gt;Getting Your Feet Wet With Ruby on Rails&lt;/a&gt; - Talking about getting on your feet fast, this one from Webmonkey promises to get them wet too!&lt;/li&gt;&lt;li&gt;&lt;a href="http://darkhost.mine.nu:8080/%7Evince/rails/tutorial.html"&gt;How to make a todo list program with Rails&lt;/a&gt; - Another excellent introductory tutorial that actually helps you build something useful!&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.onlamp.com/pub/a/onlamp/2005/06/09/rails_ajax.html"&gt;Ajax on Rails&lt;/a&gt; - Curtis Hibbs offers part 3 of his look at RoR&lt;/li&gt;&lt;li&gt;&lt;a href="http://jrhicks.net/Projects/rails/has_many_and_belongs_to_many.pdf"&gt;Many to Many Tutorial for Rails (PDF)&lt;/a&gt; - is a nice document that begins to delve into some of the more complex parts of &lt;a itxtdid="4709848" target="_blank" href="http://www.digitalmediaminute.com/article/1816/top-ruby-on-rails-tutorials#" style="border-bottom: 0.075em solid darkgreen; font-weight: normal; font-size: 100%; text-decoration: underline; color: darkgreen; background-color: transparent; padding-bottom: 1px;" classname="iAs" class="iAs"&gt;web application&lt;/a&gt; programming, but in fine Ruby on Rails manner, it’s really not too complicated!&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.erikveen.dds.nl/distributingrubyapplications/rails.html"&gt;Distributing Rails Applications - A Tutorial&lt;/a&gt; - So now you’ve built your RoR application, how to you push it to a production &lt;a itxtdid="4525411" target="_blank" href="http://www.digitalmediaminute.com/article/1816/top-ruby-on-rails-tutorials#" style="border-bottom: 0.075em solid darkgreen; font-weight: normal; font-size: 100%; text-decoration: underline; color: darkgreen; background-color: transparent; padding-bottom: 1px;" classname="iAs" class="iAs"&gt;server&lt;/a&gt;?  This tutorial covers the bases.&lt;/li&gt;&lt;li&gt;&lt;a href="http://digitalmediaminute.com/howto/fc4rails/"&gt;Installing Ruby on Rails with Lighttpd and MySQL on Fedora Core 4&lt;/a&gt; - and of course this list wouldn’t be complete without a shameless bit of self-promotion, this tutorial promises what it says. Other install tutorials can be found &lt;a href="http://locomotive.sourceforge.net/"&gt;here&lt;/a&gt;, &lt;a href="http://locomotive.sourceforge.net/"&gt;here &lt;/a&gt;and &lt;a href="http://rubyinstaller.rubyforge.org/wiki/wiki.pl"&gt;here&lt;/a&gt;!&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Please click one of the following ads by Google to go to the next page..&lt;/span&gt;.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7749730490023417716-2601294971933065305?l=somesecretstuff.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7749730490023417716/posts/default/2601294971933065305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7749730490023417716/posts/default/2601294971933065305'/><link rel='alternate' type='text/html' href='http://somesecretstuff.blogspot.com/2007/11/top-12-ruby-on-rails-tutorials.html' title='Top 12 Ruby on Rails Tutorials'/><author><name>rubygaluga</name><uri>http://www.blogger.com/profile/14423449858277238034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7749730490023417716.post-602376579395087903</id><published>2007-11-09T08:00:00.001-08:00</published><updated>2007-11-09T08:48:57.287-08:00</updated><title type='text'>You don't have to be a geek to unlock iPhone (part II)</title><content type='html'>&lt;h3&gt;Step 3: jailbreak&lt;/h3&gt; &lt;p&gt; Click on the Home button of the iPhone (the big and the only button at the bottom iPhone)&lt;br /&gt;Do the Slide for Emergency Again&lt;br /&gt;Now do the &lt;b&gt;*#307#&lt;/b&gt; to get into the contact Screen Again&lt;br /&gt;Tap your contact, and select the Jailbreak contact. Safari will open up and take you to the url: http://jailbreakme.com&lt;br /&gt;Scroll down and select AppSnap&lt;br /&gt;Safari will crash&lt;br /&gt;Please wait a few minutes and the phone will ring, answer it and after about 2, 3 minutes, the phone should be freezing up&lt;br /&gt;Go ahead and turn it off and turn it back one, the iPhone should now be activated (you can use wifi, iPod...but can not make call yet).&lt;br /&gt;&lt;br /&gt;&lt;img src="http://ens.utulsa.edu/%7Ephamki/iPhone/img/iPhone/jailbreak.jpg" alt="" height="480" width="320" /&gt; &lt;/p&gt;&lt;br /&gt; &lt;h3&gt;Step 4: install application and unlock the iPhone&lt;/h3&gt; &lt;p&gt; Slide to unlock, you will see the icon at the bottom left which is Installer, run that. Make sure wifi is still connected&lt;br /&gt;It might ask you to update, go ahead and update to the latest version of Installer.&lt;br /&gt;&lt;br /&gt;Now go to Install tab, find Sources, install the Community Sources&lt;br /&gt;&lt;br /&gt;Still in the Install tab, find System, install BSD Subsystem&lt;br /&gt;&lt;br /&gt;Then go to Sources tab at the bottom, click on Edit button at the top right, then Add&lt;br /&gt;&lt;br /&gt;Add this source: &lt;b&gt;http://i.unlock.no&lt;/b&gt;.If it doesn't work, try adding this source too: &lt;b&gt;http://rep.frenchiphone.com&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Once added, do Refresh Sources&lt;br /&gt;&lt;br /&gt;Go back to Install tab, find All Package, you should find anySim 1.1 program, install it&lt;br /&gt;&lt;br /&gt;Restart your iPhone&lt;br /&gt;&lt;br /&gt;anySim will shows up at the Home Screen&lt;br /&gt;&lt;br /&gt;Run anySim and it will unlock your iPhone now.&lt;br /&gt;&lt;br /&gt;Once the iPhone is unlocked, you can go back into the program Installer and click on Uninstall tab to uninstall the anySim program. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Please click one of the following ads by Google to go to the next page..&lt;/span&gt;.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7749730490023417716-602376579395087903?l=somesecretstuff.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7749730490023417716/posts/default/602376579395087903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7749730490023417716/posts/default/602376579395087903'/><link rel='alternate' type='text/html' href='http://somesecretstuff.blogspot.com/2007/11/you-dont-have-to-be-geek-to-unlock_09.html' title='You don&apos;t have to be a geek to unlock iPhone (part II)'/><author><name>rubygaluga</name><uri>http://www.blogger.com/profile/14423449858277238034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7749730490023417716.post-7428978340164746525</id><published>2007-11-09T07:58:00.001-08:00</published><updated>2007-11-09T08:45:03.307-08:00</updated><title type='text'>You don't have to be a geek to unlock iPhone (part I)</title><content type='html'>&lt;h1&gt;Unlock iPhone with firmware version 1.1.1&lt;/h1&gt;  &lt;h2 class="heading"&gt;Overview&lt;/h2&gt; &lt;div class="content"&gt; &lt;p&gt;The purpose of this tutorial is to help user unlock their iPhone with firmware version 1.1.1. If you have an already unlock iPhone with version 1.02 and would like to update to version 1.1.1, &lt;a href="http://ens.utulsa.edu/%7Ephamki/iPhone/index.php?iPhone/virginize/"&gt;you need to restore your iPhone first, see the restore tutorial here.&lt;/a&gt;&lt;/p&gt; &lt;/div&gt;&lt;!-- end content div --&gt;  &lt;h2 class="heading"&gt;Unlock&lt;/h2&gt;  &lt;h3&gt;Step 1: dial the magic number *#307#&lt;/h3&gt; &lt;p&gt;Do the Slide for Emergency. The type in: *#307# and click on Call.&lt;br /&gt;Your phone will ring, press Answer. If you don't get the Answer screen, delete the *#307# and type 0 then press Call&lt;br /&gt;Press hold&lt;br /&gt;Your phone will ring again but this time press Decline, the Contacts Screen will shows up.&lt;br /&gt;&lt;img src="http://ens.utulsa.edu/%7Ephamki/iPhone/img/iPhone/307.jpg" alt="" height="480" width="320" /&gt; &lt;img src="http://ens.utulsa.edu/%7Ephamki/iPhone/img/iPhone/1.jpg" alt="" height="480" width="320" /&gt; &lt;/p&gt;&lt;br /&gt; &lt;h3&gt;Step 2: add fake contacts&lt;/h3&gt; &lt;p&gt; Click on Contacts tab at the bottom&lt;br /&gt;Click on the Add button on the top right corner&lt;br /&gt;Select the firstname, lastname box, type in Wifi for the firstname&lt;br /&gt;Select the URL, type in: &lt;b&gt;prefs://1F&lt;/b&gt; then go back to the Contact Screen&lt;br /&gt;Add a new Contact&lt;br /&gt;Type in Jailbreak for the name&lt;br /&gt;Type in &lt;b&gt;http://jailbreakme.com&lt;/b&gt; for the URL&lt;br /&gt;If you done it correctly, your screen should now look like this:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://ens.utulsa.edu/%7Ephamki/iPhone/img/iPhone/wifiContact.jpg" alt="" height="480" width="320" /&gt; &lt;img src="http://ens.utulsa.edu/%7Ephamki/iPhone/img/iPhone/contact.jpg" alt="" height="480" width="320" /&gt; &lt;/p&gt;&lt;br /&gt; &lt;h3&gt;Step 3: select wifi network and get ip address&lt;/h3&gt; &lt;p&gt; Now select the Wifi contact, and click on the Homepage link which is prefs://1F. This will get you to the Settings Screen where you can set your Wifi setting.&lt;br /&gt;Make sure you get an IP address before you leave this screen&lt;br /&gt;&lt;br /&gt;&lt;img src="http://ens.utulsa.edu/%7Ephamki/iPhone/img/iPhone/ip.jpg" alt="" height="480" width="320" /&gt; &lt;br /&gt;Click on Wifi-Networks button at the top left and then click on Settings button. This will take you back to the Settings Screen, go ahead and change the Auto-lock value to Never. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Please click one of&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7749730490023417716-7428978340164746525?l=somesecretstuff.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7749730490023417716/posts/default/7428978340164746525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7749730490023417716/posts/default/7428978340164746525'/><link rel='alternate' type='text/html' href='http://somesecretstuff.blogspot.com/2007/11/you-dont-have-to-be-geek-to-unlock.html' title='You don&apos;t have to be a geek to unlock iPhone (part I)'/><author><name>rubygaluga</name><uri>http://www.blogger.com/profile/14423449858277238034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7749730490023417716.post-3396619100035634880</id><published>2007-11-08T19:29:00.000-08:00</published><updated>2007-11-09T08:45:25.701-08:00</updated><title type='text'>Using Python to run W3C Validator</title><content type='html'>&lt;h1&gt;Validating an entire site&lt;/h1&gt;          &lt;p&gt;Periodically you may want to make sure your entire website validates. This can be a hassle if your site is big. In this article we introduce a few python scripts which will help us do mass validation from a list of links. We will also modify the &lt;a href="http://validator.w3.org/"&gt;W3C validator&lt;/a&gt; to work the way we want.&lt;/p&gt;  &lt;p&gt;Recently I had a siutation where I wanted to validate a large collection of pages. A customer has a rather large site and more than 100 editors are invloved in content creation. Since it is possible to create invalid html in their CMS tool there is a need to check the site regularly. This code could also be the foundation for a continuous testing framework in a GUI development project. In short it includes:&lt;/p&gt; &lt;ol&gt;&lt;script type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&lt;br /&gt;src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;br /&gt;&lt;/script&gt;&lt;li&gt;Installing the W3C validator on a local machine.&lt;/li&gt;&lt;li&gt;Modifying the validator to output XML.&lt;/li&gt;&lt;li&gt;Writing a script to collect validator result for all URLs in a text file.&lt;/li&gt;&lt;li&gt;Writing a script to crawl a web site and log all page URLs (which will be used as input to the script above).&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;The modified validator code and the Python scrips are available at the end of this article.&lt;/p&gt; &lt;h2&gt;Installing the W3C validator&lt;/h2&gt; &lt;p&gt;If you have a Mac with OS X this is an easy step. Following the excellent &lt;a href="http://developer.apple.com/internet/opensource/validator.html"&gt;installation instructions on the Apple developer site&lt;/a&gt; I had the validator up and running on my iBook within ten minutes. Tip: If you have trouble installing the Bundle::W3C::Validator, try to install it after a reboot. It worked on my second attempt.&lt;/p&gt; &lt;h2&gt;Modifying the validator&lt;/h2&gt; &lt;p&gt;After installing the W3C validator and looking at the Perl code (yack!) I was surprised to find that XML output is already available! Appending ‘&amp;amp;output=xml’ to the query string will make the validator &lt;a href="http://validator.w3.org/check?uri=www.standards-schmandards.com&amp;amp;output=xml"&gt;output the validation result as XML&lt;/a&gt;. It is even possible to get the result in &lt;a href="http://www.w3.org/2001/03/earl/"&gt;&lt;acronym title="Evaluation And Report Language"&gt;EARL&lt;/acronym&gt;&lt;/a&gt; by using ‘n3′ for the output parameter!&lt;/p&gt; &lt;p&gt;This saved me some time. However, if the validator tries to validate a page where encoding hasn’t been specified it will produce an error in html format. For my purposes this was not good enough so I have a modified the error handling to output XML as well. I also wanted to check if the page was using &lt;a href="http://www.dublincore.org/"&gt;Dublin Core for meta data&lt;/a&gt; and therefore I have included a &lt;a href="http://dublincore.org/documents/dcq-html/#sect-2-7"&gt;check for the &lt;acronym title="Dublin Core"&gt;DC&lt;/acronym&gt; schema identifier&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;My modifications are commented with “PKR” in the &lt;a href="http://www.standards-schmandards.com/exhibits/validator2/check"&gt;modified check script&lt;/a&gt;.&lt;/p&gt; &lt;h2&gt;Some additional scripts&lt;/h2&gt; &lt;p&gt;So, all I needed now was some simple scripts to call my local validator, parse the XML result and output data to a &lt;acronym title="Comma Separated Value"&gt;CSV&lt;/acronym&gt; file from which I can create statistics. The first script, &lt;a href="http://www.standards-schmandards.com/exhibits/validator2/massvalidate.py"&gt;massvalidate.py&lt;/a&gt;, takes two arguments:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;The name of a text file containing a list of URLs to validate. One URL per line please.&lt;/li&gt;&lt;li&gt;The filename of the result CSV file.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;The script will log information about the number of validation errors, the doctype used, web server software and the presence of DC metadata.&lt;/p&gt; &lt;p&gt;The second script, &lt;a href="http://www.standards-schmandards.com/exhibits/validator2/crawlsite.py"&gt;crawlsite.py&lt;/a&gt;, crawls a web site and extracts all unique URLs. The URL of the web site is passed in the first argument to the script (e.g. ‘python crawlsite.py http://127.0.0.1′). You can use this script to crawl your site and then feed the result to the massvalidate.py script.&lt;/p&gt; &lt;h2&gt;Interesting statistics&lt;/h2&gt; &lt;p&gt;My first trial run was to validate the start page of the 1020 public web sites listed at &lt;a href="http://www.sverige.se/sverige/templates/languagepage____6339.aspx"&gt;sverige.se&lt;/a&gt;. Sverige.se is the online gateway to Swedenâ€™s public sector. The result: only 63 sites use valid html. See &lt;a href="http://www.standards-schmandards.com/exhibits/validator2/stats"&gt;more statistics about doctypes used&lt;/a&gt;.&lt;/p&gt; &lt;h2&gt;The next step&lt;/h2&gt; &lt;p&gt;By adding some simple metadata to your pages (if you are using Dublin Core it may already be there) it would be trivial to have the script email the responsible developer/editor with any validation errors that were found. Please submit other ideas for development and I will add them here.&lt;/p&gt; &lt;h2&gt;References&lt;/h2&gt; &lt;p&gt;Please note that these scripts were written in a haste. If you find errors or have any suggestions please send them to me and I will update them as soon as possible.&lt;/p&gt; &lt;ol&gt;&lt;li&gt;&lt;a href="http://developer.apple.com/internet/opensource/validator.html"&gt;Installing the W3C HTML Validator on Mac OS X&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://validator.w3.org/"&gt;The W3C markup validation service&lt;/a&gt;&lt;/li&gt;&lt;li&gt;The &lt;a href="http://www.standards-schmandards.com/exhibits/validator2/check"&gt;modified validator “check” script&lt;/a&gt;. Please replace the original “check” file with this one.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.standards-schmandards.com/exhibits/validator2/crawlsite.py"&gt;crawlsite.py&lt;/a&gt; crawls a web site and lists links to validate (&lt;a href="http://www.standards-schmandards.com/exhibits/validator2/crawlsite.py.html"&gt;view crawlsite.py in html format&lt;/a&gt;). This script uses the &lt;a href="http://www.python.org/pypi/htmldata/"&gt;htmldata library by Connelly Barnes&lt;/a&gt;. Please make sure it is available in the same folder.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.standards-schmandards.com/exhibits/validator2/massvalidate.py"&gt;massvalidate.py&lt;/a&gt;. This script uses a list of links, feeds them to the validator and logs the result in a CSV file (&lt;a href="http://www.standards-schmandards.com/exhibits/validator2/massvalidate.py.html"&gt;view massvalidate.py in html format&lt;/a&gt;).&lt;/li&gt;&lt;li&gt;&lt;a href="http://htmlhelp.org/tools/validator/index.html.en"&gt;The Web Design Group’s validator&lt;/a&gt;. This one uses a different engine compared to the W3C validator but has built in support for mass validation.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Please click one of&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7749730490023417716-3396619100035634880?l=somesecretstuff.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7749730490023417716/posts/default/3396619100035634880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7749730490023417716/posts/default/3396619100035634880'/><link rel='alternate' type='text/html' href='http://somesecretstuff.blogspot.com/2007/11/using-python-to-run-w3c-validator.html' title='Using Python to run W3C Validator'/><author><name>rubygaluga</name><uri>http://www.blogger.com/profile/14423449858277238034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>
