# Having problems interfacing with Google Calendar API using N

**URL:** <https://www.ruby-forum.com/t/having-problems-interfacing-with-google-calendar-api-using-n/68254>\
**Category:** Ruby\
**Created:** [September 11, 2006, 7:21am UTC](https://www.ruby-forum.com/t/having-problems-interfacing-with-google-calendar-api-using-n/68254 "2006-09-11T07:21:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![blissdev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b487fb/32.png) [@blissdev](https://www.ruby-forum.com/u/blissdev)\
**Post date:** [September 11, 2006, 7:21am UTC](https://www.ruby-forum.com/t/having-problems-interfacing-with-google-calendar-api-using-n/68254/1 "2006-09-11T07:21:15Z")

</div>

've been attempting to work on a script that would synch my iCal  
calendar with my google calendar. Just in an attempt to get the hang of  
the api, I’m trying to generate an event and then add it. I’ve got the  
xml generated just fine, but when I try to authenticate myself with  
google. I get an error. Does anyone have any ideas?

Google C. “Add Event”:  
[http://code.google.com/apis/gdata/calendar.html#add\_event](http://code.google.com/apis/gdata/calendar.html#add_event)

My code:  
res =  
Net::HTTP.post\_form(URI.parse(“[https://www.google.com/accounts/ClientLogin](https://www.google.com/accounts/ClientLogin)”),

```
                      {'Email' => "myemail", 'Passwd' =>

```

“mypassword”,  
‘source’ =\>  
“blissdevelopment-calendarSync-1”, ‘service’ =\> “c1”})

puts res.body

And then the error:  
/opt/local/lib/ruby/1.8/net/protocol.rb:133:in `sysread': Connection reset by peer (Errno::ECONNRESET) from /opt/local/lib/ruby/1.8/net/protocol.rb:133:in `rbuf\_fill’  
from /opt/local/lib/ruby/1.8/timeout.rb:56:in `timeout' from /opt/local/lib/ruby/1.8/timeout.rb:76:in `timeout’  
from /opt/local/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill' from /opt/local/lib/ruby/1.8/net/protocol.rb:116:in `readuntil’  
from /opt/local/lib/ruby/1.8/net/protocol.rb:126:in `readline' from /opt/local/lib/ruby/1.8/net/http.rb:1988:in `read\_status\_line’  
from /opt/local/lib/ruby/1.8/net/http.rb:1977:in `read_new' from /opt/local/lib/ruby/1.8/net/http.rb:1046:in `request’  
from /opt/local/lib/ruby/1.8/net/http.rb:405:in `post_form' from /opt/local/lib/ruby/1.8/net/http.rb:545:in `start’  
from /opt/local/lib/ruby/1.8/net/http.rb:404:in `post\_form’  
from calendar\_sync.rb:32

---

<div class="post-metadata">

**Author:** ![blissdev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b487fb/32.png) [@blissdev](https://www.ruby-forum.com/u/blissdev)\
**Post date:** [September 11, 2006, 5:04pm UTC](https://www.ruby-forum.com/t/having-problems-interfacing-with-google-calendar-api-using-n/68254/2 "2006-09-11T17:04:28Z")

</div>

On Mon, Sep 11, 2006 at 02:20:29PM +0900, blissdev wrote:

> [snipped]  
> I would suggest looking at WWW::Mechanize,  
> [http://mechanize.rubyforge.org/](http://mechanize.rubyforge.org/). Also, if you use iCal as your main  
> interface, you don’t really need to write any code, Google speaks ical  
> (little i) and iCal can import this data.
