Hi,

I use the gem gattica to acces our unique visitor data. This works fine
in my console.

require 'rubygems'
require 'gattica'

gs = Gattica.new({:email => 'XXXX', :password => 'XXXXX'})
accounts = gs.accounts
gs.profile_id = XXXXXX

results = gs.get({ :start_date => '2010-02-17', :end_date =>
'2010-02-17', :dimensions => 'day', :metrics => 'visitors'})

output1:

{"start_date"=>Wed, 17 Feb 2010, "end_date"=>Wed, 17 Feb 2010,
"points"=>[{"title"=>"ga:day=17", "dimensions"=>[{:day=>"17"}],
"id"=>"http://www.google.com/analytics/feeds/data?ids=ga:21180637&ga:day=17&start-date=2010-02-17&end-date=2010-02-17";,
"metrics"=>[{:visitors=>4088}], "updated"=>Tue, 16 Feb 2010 16:00:00
-0800}], "items_per_page"=>1, "total_results"=>1, "start_index"=>1}

output 2:
results.to_csv(:short)

"day,visitors\n17,4088\n"


I want to check the Google Analyticsc API with a frequency of 4 hours
and  store the value of visitors (4088)  in my database.  How do i
realize this?


Grtz..remco
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to