I want to use ruby script language to create/modify google spreadsheet
behind firewall with the proxy of http://wwwproxy.test.com:2080 setting.
I am able to use Ruby's "google_spreadsheet" rubygem (see R1) to
create/query Google Spreadsheet using my personal and corporate Google
accounts from home network. The problem is how do I do the same for networks
behind corporate firewall ?
The hurdle I am facing is how do I configure the proxy setting in Ruby ?
Looking at Ruby's API guide in R2 but can't find out how to set http proxy
info.
I haven't read through all the online docs and forum discussion yet.
Please let me know if you have a pointer on how to have ruby interact with
Google spreadsheets behind a http proxy.
Thanks
tj
R1: ruby sample code
#! /usr/bin/ruby
require "rubygems"
require "google_spreadsheet"
# Logs in.
#
session = GoogleSpreadsheet.login("[email protected]", "mypassword")
# First worksheet of
http://spreadsheets.google.com/ccc?key=xxWlvmLseKRa2JV5CphdnZw&hl=en
ws = session.spreadsheet_by_key("xxWlvmLseKRa2JV5CphdnZw").worksheets[0]
# Gets content of A2 cell.
p ws[2, 1] #==> "hoge"
# Changes content of cells. Changes are not sent to the server until you
call ws.save().
ws[2, 1] = "foo"
ws[2, 2] = "bar"
ws.save()
# Dumps all cells.
for row in 1..ws.num_rows
for col in 1..ws.num_cols
p ws[row, col]
end
end
R2: http://code.google.com/apis/gdata/articles/using_ruby.html