<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>examples/account.rb</filename>
    </added>
    <added>
      <filename>examples/profile.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,7 @@
+* 0.0.6 - July 30, 2008
+				- Updated Account and Profile to work with google's html changes
+				
 * 0.0.4 - Added new #pageviews_by_day and #visits_by_day methods which return collection of days and values
 * 0.0.3	- updated to new google api and switched to rspec
 * 0.0.2 - switched to googlebase for google auth and requests
-* 0.0.1 - initial relase
\ No newline at end of file
+* 0.0.1 - initial release
\ No newline at end of file</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 require 'statwhore/version'
 
-AUTHOR = 'FIXME full name'  # can also be an array of Authors
-EMAIL = &quot;FIXME email&quot;
-DESCRIPTION = &quot;description of gem&quot;
+AUTHOR = 'John Nunemaker'  # can also be an array of Authors
+EMAIL = &quot;nunemaker@gmail.com&quot;
+DESCRIPTION = &quot;for the stat addict in us all&quot;
 GEM_NAME = 'statwhore' # what ppl will type to install your gem
 RUBYFORGE_PROJECT = 'statwhore' # The unix name for your project
 HOMEPATH = &quot;http://#{RUBYFORGE_PROJECT}.rubyforge.org&quot;
@@ -60,8 +60,6 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p|
   # == Optional
   p.changes = p.paragraphs_of(&quot;History.txt&quot;, 0..1).join(&quot;\\n\\n&quot;)
   p.extra_deps = [ ['googlebase', '&gt;= 0.2.0'], ['activesupport', '&gt;= 2.0.2'], ['hpricot', '&gt;= 0.6'] ]
-  #p.extra_deps = []     # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '&gt;= 1.3.1'] ]
-  
   #p.spec_extras = {}    # A hash of extra values to set in the gemspec.
   
 end</diff>
      <filename>config/hoe.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,39 +2,11 @@ require File.dirname(__FILE__) + '/../lib/statwhore'
 require 'ostruct'
 require 'yaml'
 
-include Statwhore::Google::Analytics
-
-logger = Logger.new('../log/debug.log')
 config = YAML::load(open(ENV[&quot;HOME&quot;] + '/.statwhore'))
 Google::Base.establish_connection(config[:username], config[:password])
+include Statwhore::Google::Analytics
 
-class Site &lt; OpenStruct; end
-
-live = [
-  Site.new(:account =&gt; 344381, :profile =&gt; 3939049, :name =&gt; 'ace'),
-  Site.new(:account =&gt; 344381, :profile =&gt; 4804412, :name =&gt; 'admissions'),
-  Site.new(:account =&gt; 344381, :profile =&gt; 6345870, :name =&gt; 'building_communities'),
-  Site.new(:account =&gt; 344381, :profile =&gt; 8071820, :name =&gt; 'campus_ministry'),
-  Site.new(:account =&gt; 344381, :profile =&gt; 4505702, :name =&gt; 'career'),
-  Site.new(:account =&gt; 344381, :profile =&gt; 5190819, :name =&gt; 'committees'),
-  Site.new(:account =&gt; 344381, :profile =&gt; 3090719, :name =&gt; 'conductor'),
-  Site.new(:account =&gt; 344381, :profile =&gt; 4900769, :name =&gt; 'enlighten'),
-  Site.new(:account =&gt; 344381, :profile =&gt; 5190683, :name =&gt; 'green'),
-  Site.new(:account =&gt; 344381, :profile =&gt; 5309061, :name =&gt; 'issa'),
-  Site.new(:account =&gt; 344381, :profile =&gt; 1027308, :name =&gt; 'law'),
-  Site.new(:account =&gt; 344381, :profile =&gt; 8220615, :name =&gt; 'old2gold'),
-  Site.new(:account =&gt; 1254221, :profile =&gt; 2420755, :name =&gt; 'pray'),
-  Site.new(:account =&gt; 344381, :profile =&gt; 6085464, :name =&gt; 'summer_scholars'),
-  Site.new(:account =&gt; 344381, :profile =&gt; 4263845, :name =&gt; 'vocation'),
-  Site.new(:account =&gt; 344381, :profile =&gt; 543890, :name =&gt; 'webgroup')
-]
-
-# dates = {:from =&gt; Time.mktime(2007, 10, 1), :to  =&gt; Time.now}
-# dates = {:from =&gt; Time.mktime(2008, 1, 1), :to  =&gt; Time.now}
-dates = {:from =&gt; Time.mktime(2008, 4, 1), :to  =&gt; Time.now}
-puts live.inject(0) { |total, site| 
-  views = Profile.find(site.account, site.profile).pageviews(dates)
-  puts &quot;#{views} - #{site.name}&quot;
-  total += views
-  total 
-}
\ No newline at end of file
+dates = {:from =&gt; Time.mktime(2008, 1, 1), :to  =&gt; Time.now}
+profile = Profile.find(config[:account], config[:profile])
+pp profile.pageviews(dates)
+pp profile.visits(dates)
\ No newline at end of file</diff>
      <filename>examples/profiles.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,18 +1,23 @@
 module Statwhore
   module Google
-    module Analytics      
+    module Analytics
       class Account &lt; ::Google::Base
         def self.find_all
-          doc = Hpricot::XML(get('https://www.google.com:443/analytics/home/'))
-          (doc/'select[@name=account_list] option').inject([]) do |accounts, option|
+          doc = Hpricot::XML get('https://www.google.com/analytics/settings/')
+          (doc/'select[@id=account] option').inject([]) do |accounts, option|
             account_id = option['value'].to_i
             accounts &lt;&lt; new(:account_id =&gt; account_id, :name =&gt; option.inner_html) if account_id &gt; 0
             accounts
           end
         end
-        
+
+        def self.find(account_id_or_name)
+          matchs = find_all.select{|a| a.name == account_id_or_name || a.account_id.to_s == account_id_or_name.to_s }
+          matchs.empty? ? nil : matchs.first
+        end
+
         attr_accessor :name, :account_id
-        
+
         def initialize(attrs)
           @name = attrs[:name]
           @account_id = attrs[:account_id]
@@ -25,6 +30,10 @@ module Statwhore
           @profiles
         end
 
+        def find_profile(profile_id_or_name)
+          profiles.detect { |p| p.profile_id.to_s == profile_id_or_name.to_s || p.name == profile_id_or_name }
+        end
+
         def to_s
           &quot;#{name} (#{account_id})&quot;
         end</diff>
      <filename>lib/statwhore/google/analytics/account.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,29 +1,30 @@
 module Statwhore
   module Google
-    module Analytics      
+    module Analytics
       class Profile &lt; ::Google::Base
         def self.find_all(account_id)
-          doc = Hpricot::XML(get(&quot;https://www.google.com:443/analytics/home/admin?scid=#{account_id}&quot;))
-          (doc/'select[@name=profile_list] option').inject([]) do |profiles, option|
+          doc = Hpricot::XML get(&quot;https://www.google.com/analytics/settings/&quot;)
+          (doc/'select[@id=profile] option').inject([]) do |profiles, option|
             profile_id = option['value'].to_i
             profiles &lt;&lt; Profile.new(:account_id =&gt; account_id, :profile_id =&gt; profile_id, :name =&gt; option.inner_html) if profile_id &gt; 0
             profiles
           end
         end
-        
-        def self.find(account_id, profile_id)
-          find_all(account_id).detect { |p| p.profile_id.to_s == profile_id.to_s }
+
+        def self.find(account_id_or_name, profile_id_or_name)
+          account = Account.find(account_id_or_name)
+          account ? account.find_profile(profile_id_or_name) : nil
         end
-        
+
         attr_accessor :account_id, :name, :profile_id
-        
+
         def initialize(attrs)
           raise ArgumentError, &quot;:profile_id is required&quot; unless attrs.has_key?(:profile_id)
           @account_id = attrs[:account_id]  if attrs.has_key?(:account_id)
           @name       = attrs[:name]        if attrs.has_key?(:name)
           @profile_id = attrs[:profile_id]  if attrs.has_key?(:profile_id)
         end
-        
+
         def report(options={})
           options.reverse_merge!({
             :report  =&gt; 'Dashboard',
@@ -36,7 +37,7 @@ module Statwhore
           })
           options[:from] = ensure_datetime_in_google_format(options[:from])
           options[:to]   = ensure_datetime_in_google_format(options[:to])
-          
+
           params = {
             :pdr  =&gt; &quot;#{options[:from]}-#{options[:to]}&quot;,
             :rpt  =&gt; &quot;#{options[:report]}Report&quot;,
@@ -48,11 +49,11 @@ module Statwhore
           }
           self.class.get(&quot;https://google.com/analytics/reporting/export&quot;, :query_hash =&gt; params)
         end
-        
+
         def pageviews(options={})
           get_item_summary_by_message(options.merge(:message =&gt; 'pageviews'))
         end
-        
+
         def pageviews_by_day(options={})
           get_serie_by_label(options.merge({:label =&gt; 'pageviews'}))
         end
@@ -60,20 +61,20 @@ module Statwhore
         def visits(options={})
           get_item_summary_by_message(options.merge(:message =&gt; 'visits'))
         end
-        
+
         def visits_by_day(options={})
           get_serie_by_label(options.merge({:label =&gt; 'visits'}))
         end
-        
+
         # takes a Date, Time or String
         def ensure_datetime_in_google_format(time)
           time.is_a?(Time) || time.is_a?(Date) ? time.strftime('%Y%m%d') : time
         end
-        
+
         def to_s
           &quot;#{name} (#{profile_id})&quot;
         end
-        
+
         private
           def get_item_summary_by_message(options={})
             raise ArgumentError unless options.has_key?(:message)
@@ -83,7 +84,7 @@ module Statwhore
             pageviews = (doc/:ItemSummary).detect { |summary| summary.at('Message').inner_html == message }
             pageviews &amp;&amp; pageviews.at('SummaryValue') ? pageviews.at('SummaryValue').inner_html.gsub(/\D/, '').to_i : 0
           end
-          
+
           def get_serie_by_label(options={})
             raise ArgumentError unless options.has_key?(:label)
             label = options.delete(:label).to_s.capitalize</diff>
      <filename>lib/statwhore/google/analytics/profile.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ module Statwhore #:nodoc:
   module VERSION #:nodoc:
     MAJOR = 0
     MINOR = 0
-    TINY  = 4
+    TINY  = 5
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>lib/statwhore/version.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7106640597e117eea2e816218e93461aef960807</id>
    </parent>
  </parents>
  <author>
    <name>John Nunemaker</name>
    <email>nunemaker@gmail.com</email>
  </author>
  <url>http://github.com/jnunemaker/statwhore/commit/c255612d5146ac21bf9a926a2882dd2bca6fb125</url>
  <id>c255612d5146ac21bf9a926a2882dd2bca6fb125</id>
  <committed-date>2008-07-30T20:01:48-07:00</committed-date>
  <authored-date>2008-07-30T20:01:48-07:00</authored-date>
  <message>Updated Account and Profile to work with google's html changes</message>
  <tree>f6330de47bde486ec2a54d606f48463ba1b8fa04</tree>
  <committer>
    <name>John Nunemaker</name>
    <email>nunemaker@gmail.com</email>
  </committer>
</commit>
