lib/gattica.rb
# Returns the list of accounts the user has access to. A user may have multiple accounts on Google Analytics
# and each account may have multiple profiles. You need the profile_id in order to get info from GA. If you
# don't know the profile_id then use this method to get a list of all them. Then set the profile_id of your
# instance and you can make regular calls from then on.
#
#   ga = Gattica.new({:email => 'johndoe@google.com', :password => 'password'})
#   ga.get_accounts
#   # you parse through the accounts to find the profile_id you need
#   ga.profile_id = 12345678
#   # now you can perform a regular search, see Gattica::Engine#get
#
# If you pass in a profile id when you instantiate Gattica::Search then you won't need to
# get the accounts and find a profile_id - you apparently already know it!
#
# See Gattica::Engine#get to see how to get some data.
Returns the list of accounts the user has access to. A user may have multiple accounts on Google Analytics
and each account may have multiple profiles. You need the profile_id in order to get info from GA. If you
don't know the profile_id then use this method to get a list of all them. Then set the profile_id of your
instance and you can make regular calls from then on.

ga = Gattica.new({:email => 'johndoe@google.com', :password => 'password'})
ga.get_accounts
you parse through the accounts to find the profile_id you need
ga.profile_id = 12345678
now you can perform a regular search, see Gattica::Engine#get

If you pass in a profile id when you instantiate Gattica::Search then you won't need to
get the accounts and find a profile_id - you apparently already know it!

See Gattica::Engine#get to see how to get some data.
Returns the list of accounts the user has access to . A user may have multiple accounts on Google Analytics and each account may have multiple profiles . You need the profile_id in order to get info from GA . If you don ' t know the profile_id then use this method to get a list of all them . Then set the profile_id of your instance and you can make regular calls from then on . ga = Gattica . new ( { : email = > ' johndoe@google . com ' : password = > ' password ' } ) ga . get_accounts you parse through the accounts to find the profile_id you need ga . profile_id = 12345678 now you can perform a regular search see Gattica :: Engine#get If you pass in a profile id when you instantiate Gattica :: Search then you won ' t need to get the accounts and find a profile_id - you apparently already know it! See Gattica :: Engine#get to see how to get some data .
def accounts
      if @user_accounts.nil?
        data = do_http_get('/analytics/feeds/accounts/default')
        xml = Hpricot(data)
        @user_accounts = xml.search(:entry).collect { |entry| Account.new(entry) }
      end
      return @user_accounts
    end
def accounts if @user_accounts . nil? data = do_http_get ( '/analytics/feeds/accounts/default' ) xml = Hpricot ( data ) @user_accounts = xml . search ( :entry ) . collect { | entry | Account . new ( entry ) } end return @user_accounts end
Returns the list of accounts the user has access to.
Returns the list of accounts the user has access to .
# if we haven't retrieved the user's accounts yet, get them now and save them