<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.gitignore</filename>
    </added>
    <added>
      <filename>init.rb</filename>
    </added>
    <added>
      <filename>lib/gdata/webmaster_tools.rb</filename>
    </added>
    <added>
      <filename>spec/fixtures/webmaster_tools/add_site.xml</filename>
    </added>
    <added>
      <filename>spec/fixtures/webmaster_tools/site.xml</filename>
    </added>
    <added>
      <filename>spec/fixtures/webmaster_tools/sites.xml</filename>
    </added>
    <added>
      <filename>spec/spec.opts</filename>
    </added>
    <added>
      <filename>spec/spec_helper.rb</filename>
    </added>
    <added>
      <filename>spec/webmaster_tools_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -6,6 +6,10 @@ GDataRuby
   
 Google GData APIs allow developers to build applications on top of the Google open APIs. This project aims to help with wrappers on top of GData, and higher level libraries on top of each API itself (e.g. Calendar, Spreadsheet, Blogger, etc).
 
+See more information about Google GData APIs at
+
+    http://code.google.com/apis/gdata/
+
 == FEATURES/PROBLEMS:
   
 To start out the API set isn't covered. The aim is to support the GData API itself, and then higher level classes for the various Google APIs.
@@ -14,6 +18,7 @@ Current support:
 
 * Google Account Authentication: Handle Google ClientLogin API
 * Google Spreadsheet Data API
+* Google Webmaster Tools API (partial support)
 
 Future support:
 </diff>
      <filename>README.txt</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,3 @@
-class GData
+module GData
   VERSION = '0.0.4'
 end</diff>
      <filename>lib/gdata.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,7 @@
 # require 'gdata'
 #
 # sample = GData::Client.new('service_name', 'version_information', 'service_url')
-# sample.authenticate('username@gmail.com','password')
+# sample.authenticate('username@gmail.com', 'password')
 # sample.get('/samplefeed')
 #
 
@@ -32,19 +32,27 @@ require 'uri'
 module GData
 
   class CAPTCHAException &lt; StandardError
+    
     attr_reader :token, :url
+    
+    # Take the captcha token and url - it can be passed along to run the
+    # Captcha challenge in whatever means necessary.
     def intitialize(captcha_token,captcha_url)
-      # Take the captcha token and url - it can be passed along to run the
-      # Captcha challenge in whatever means necessary.
       @token = captcha_token
       @url = captcha_url
     end
   end
+  
+  class AuthenticationError &lt; StandardError; end #:nodoc:
+  
+  class NotAuthenticatedError &lt; StandardError; end #:nodoc:
 
   class Client
+    
     # URI's that might make this a little easier to handle:
     CLIENTLOGIN_URI = URI.parse('https://www.google.com/accounts/ClientLogin')
     AUTHSUB_URI = URI.parse('https://www.google.com/accounts/AuthSubRequest')
+    
     # It is best to be able to remember what program you're using, so you can
     # check later.
     attr_reader :service, :source, :url, :authenticated
@@ -54,58 +62,61 @@ module GData
     def initialize(service, source, url)
       @service = service
       @source = source
-      @url = Net::HTTP.new(url, 80)
+      @url = Net::HTTP.new(url, 443)
+      @url.use_ssl = true
+      
       # Put out any debug messages to stderr, so we can see if anything goes
       # awry.
-      @url.set_debug_output $stderr
+      # @url.set_debug_output $stderr
       @authenticated = false
     end
 
     # Authenticate the user through the Google ClientLogin Authentication
     # interface.  
-	# TODO: add a variable to either be 'clientLogin' or 'AuthSub' for the 
-	# type of authentication method
+    # TODO: add a variable to either be 'clientLogin' or 'AuthSub' for the 
+    # type of authentication method
     def authenticate(email, passwd)
       req = Net::HTTP::Post.new(CLIENTLOGIN_URI.path)
-      req.set_form_data(
-  	{'Email' =&gt; email,
-  	 'Passwd' =&gt; passwd,
-	 'source' =&gt; @source,
-	 'service' =&gt; @service })
+      req.set_form_data({'accountType' =&gt; 'HOSTED_OR_GOOGLE', 'Email' =&gt; email, 'Passwd' =&gt; passwd, 'source' =&gt; @source, 'service' =&gt; @service})
+      
       authsend = Net::HTTP.new(CLIENTLOGIN_URI.host, CLIENTLOGIN_URI.port)
+      
+      # authsend.set_debug_output $stderr
+      
       # Enable SSL encryption to send over HTTPS.
       authsend.use_ssl = true if CLIENTLOGIN_URI.scheme == &quot;https&quot;
-      response = authsend.start {|send| send.request(req) }
+      response = authsend.start { |send| send.request(req) }
+      
       # Retrieve the Auth string from the response, so we can check to see what
       # kind of result we've received. 
+      
       response_data = Hash.new
       array = response.body.split(/=|\n/)
-      array.each_index{|elem| response_data[array[elem]] = array[elem+1] if elem%2 == 0}
+      array.each_index{ |elem| response_data[array[elem]] = array[elem + 1] if elem % 2 == 0 }
       case response
       # If we don't receive a 200 OK message, check to see if we've received
       # a Captcha request.  If not, then throw an error.
       when Net::HTTPSuccess
-	@headers = {
-	  'Authorization' =&gt; &quot;GoogleLogin auth=#{response_data[&quot;Auth&quot;]}&quot;,
-	  'Content-Type' =&gt; 'application/atom+xml'
+        @headers = {
+          'Authorization' =&gt; &quot;GoogleLogin auth=#{response_data[&quot;Auth&quot;]}&quot;,
+          'Content-Type' =&gt; 'application/atom+xml'
         }
-	@authenticated = true
+        @authenticated = true
       when Net::HTTPForbidden
-	# Check to see whether or not we've received a Captcha challenge, and
-	# raise the CAPTCHAException if we have.
-	if response_data['Error'] == 'CaptchaRequired'
-	  raise CAPTCHAException.new(response_data['CaptchaToken'],response_data['CaptchaUrl'])
-	else
-	  response.error!
-	end
+        # Check to see whether or not we've received a Captcha challenge, and
+        # raise the CAPTCHAException if we have.
+        if response_data['Error'] == 'CaptchaRequired'
+          raise CAPTCHAException.new(response_data['CaptchaToken'],response_data['CaptchaUrl'])
+        else
+          raise AuthenticationError.new(response_data['Error'])
+        end
       else
-	response.error!
+        raise AuthenticationError.new
       end
     end
     
     # TODO: An AuthSub-style authentication procedure will be set up here,
     # for all you naughty little rails programmers. :)
-    
     def authenticated?
       @authenticated
     end
@@ -115,26 +126,30 @@ module GData
     def get(path)
       response, data = @url.get(path, @headers)
     end
+    
     alias request get # for compatibility purposes.
+    
     # Sends an HTTP POST request to the url specified in the instantiation of
     # the class.
     def post(path, entry)
-      @url.post(path,entry,@headers)
+      @url.post(path, entry, @headers)
     end
+    
     # Sends an HTTP PUT request to... you get the idea.
     # It contains the 'X-HTTP-Method-Override' line because there are times
     # that firewalls don't play nice with the HTTP PUT request.
     def put(path,entry)
       h = @headers.clone
       h['X-HTTP-Method-Override'] = 'PUT'
-      @url.put(path,entry,h)
+      @url.put(path, entry, h)
     end
+    
     # Sends an HTTP DELETE request
     # 'X-HTTP-Method-Override' exists for the same reason as above.
     def delete(path)
-      h=@headers.clone
+      h = @headers.clone
       h['X-HTTP-Method-Override'] = 'DELETE'
-      @url.delete(path,h)
+      @url.delete(path, h)
     end
   end
 end</diff>
      <filename>lib/gdata/client.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2550d2a8782c32e74dc5daf3be4a2c01c1e4566f</id>
    </parent>
  </parents>
  <author>
    <name>Priit  Haamer</name>
    <email>priit@fraktal.ee</email>
  </author>
  <url>http://github.com/dsisnero/gdata-ruby/commit/6a4bc59d53189a59cbd79083841d1138d13127a7</url>
  <id>6a4bc59d53189a59cbd79083841d1138d13127a7</id>
  <committed-date>2008-10-27T02:01:44-07:00</committed-date>
  <authored-date>2008-10-27T02:01:44-07:00</authored-date>
  <message>Added Google Webmaster Tools API client class.</message>
  <tree>964ef712dca14cde39dc512c15f942cb9967f5e3</tree>
  <committer>
    <name>Priit  Haamer</name>
    <email>priit@fraktal.ee</email>
  </committer>
</commit>
