forked from dsisnero/gdata-ruby
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added calendar beginnings, bugfixes.
git-svn-id: http://gdata-ruby.rubyforge.org/svn@17 3d76ca7b-2e8e-4910-8bb0-bc18f4d68cdf
- Loading branch information
crkruse
committed
Oct 11, 2007
1 parent
e998eaf
commit 2550d2a
Showing
2 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/ruby | ||
# | ||
# = calendar.rb - extension class for the use of Google Calendar | ||
# by way of the ruby GData library. | ||
# | ||
# Author: Christopher Kruse <christopher.kruse@clarke.edu> | ||
# | ||
# Liscensing for the GData API under the Apache Liscense, version 2.0. | ||
# | ||
# | ||
require 'gdata/client' | ||
require 'rubygems' | ||
require 'builder' | ||
require 'rexml/document' | ||
|
||
module GData | ||
class Calendar < GData::Client | ||
def initialize | ||
super 'cl', 'gdata-ruby', 'www.google.com' | ||
@gsessionid = "" | ||
end | ||
CAL_PATH = "/calendar/feeds/default/allcalendars/full?gsessionid=#{@gsessionid}" | ||
def retrieve_calendar_list | ||
if authenticated? | ||
cal_feed = get('calendar/feeds/default/allcalendars/full') | ||
@gsessionid = cal_feed[0].get_fields("location")[0].split("gsessionid").last | ||
cal_feed = get(cal_feed[0].get_fields("location")) | ||
return cal_feed | ||
else puts "Not authenticated." | ||
end | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters