<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Boundary Conditions</title>
	<atom:link href="http://67central.com/bc/feed/" rel="self" type="application/rss+xml" />
	<link>http://67central.com/bc</link>
	<description>Exploring Calendars, Time Lines, Timekeeping and Scheduling Tools</description>
	<pubDate>Sun, 16 Nov 2008 02:58:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Running Multiple Versions of Firefox</title>
		<link>http://67central.com/bc/2008/11/10/running-multiple-versions-of-firefox/</link>
		<comments>http://67central.com/bc/2008/11/10/running-multiple-versions-of-firefox/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 07:03:25 +0000</pubDate>
		<dc:creator>yesteray</dc:creator>
		
		<category><![CDATA[Visual Elements]]></category>

		<guid isPermaLink="false">http://67central.com/bc/?p=124</guid>
		<description><![CDATA[A question:
&#8220;I want to create a custom launcher for Firefox 2 and Firefox 3 with different profiles. Perhaps the real question is how do we create a custom version of a Mac application launcher, passing in the arguments we need?&#8221;
&#8230; without having to invoke it on the command line every time.
Mac OS X is assumed.
Firefoxen [...]]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://blabs.pivotallabs.com/users/joe/blog/articles/577-standup-11-07-2008-selenium-for-flash">question</a>:</p>
<blockquote><p>&#8220;I want to create a custom launcher for Firefox 2 and Firefox 3 with different profiles. Perhaps the real question is how do we create a custom version of a Mac application launcher, passing in the arguments we need?&#8221;</p>
<p>&#8230; without having to invoke it on the command line every time.</p></blockquote>
<p>Mac OS X is assumed.</p>
<p><a href="http://github.com/yesteray/firefoxen/tree">Firefoxen</a> is an answer in code. It&#8217;s a script to automatically configure multiple installations of Firefox so that they open with different profiles. The script encapsulates what I needed to do to figure out how to solve this problem. </p>
<p>The steps are:</p>
<ol>
<li>Modify each application&#8217;s Info.plist CFBundleExecutable to point to a shell script inside the application&#8217;s bundle</li>
<li>Create the appropriate shell script that runs ./firefox-bin -P profile-name in each bundle.</li>
<li>Reregister the application&#8217;s bundle with launchservices so that the changes are picked up. Normally they are cached.</li>
</ol>
<p>Only the last of these took too longer to figure out. You can trigger an update of launchservices by renaming the application bundle (Firefox.app => Firefox3.app), but if you rename it back it seems to revert to the previous db entry. (Cached by application name?)</p>
<p>Unfortunately, you can&#8217;t combine 1 and 2 either. I tried multiple permutations on changing the CFBundleExecutable parameter in each bundle from the default <code>firefox-bin</code> to something like <code>firefox-bin -P versioned-profile</code> but I couldn&#8217;t make it work with any amount of quoting.</p>
<p>Git it here: <a href="http://github.com/yesteray/firefoxen/tree">http://github.com/yesteray/firefoxen/tree</a></p>
<p>Here&#8217;s a screen grab:<br />
<div id="attachment_130" class="wp-caption alignnone" style="width: 442px"><a href="http://67central.com/bc/wp-content/uploads/2008/11/4foxen_with_launch_bar.png"><img src="http://67central.com/bc/wp-content/uploads/2008/11/4foxen_with_launch_bar.png" alt="Running 4 versions of Firefox." title="4foxen_with_launch_bar" width="432" height="270" class="size-full wp-image-130" /></a><p class="wp-caption-text">Running 4 versions of Firefox.</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://67central.com/bc/2008/11/10/running-multiple-versions-of-firefox/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Adding Events to Secondary Google Calendars in Python</title>
		<link>http://67central.com/bc/2008/09/28/adding-events-to-secondary-google-calendars-in-python/</link>
		<comments>http://67central.com/bc/2008/09/28/adding-events-to-secondary-google-calendars-in-python/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 19:49:42 +0000</pubDate>
		<dc:creator>yesteray</dc:creator>
		
		<category><![CDATA[Calendar]]></category>

		<category><![CDATA[GCalendar]]></category>

		<category><![CDATA[GData]]></category>

		<category><![CDATA[SecondaryCalendarEvents]]></category>

		<guid isPermaLink="false">http://67central.com/bc/?p=86</guid>
		<description><![CDATA[Before writing, I assumed that I would need to refer any reader to the introductory post of this series on adding events to secondary calendars. Depending on your skill level and experience that may still be true, and it definitely is true if you want to understand what you are doing, but if you just [...]]]></description>
			<content:encoded><![CDATA[<p>Before writing, I assumed that I would need to refer any reader to the <a href="http://67central.com/bc/2008/09/01/adding-events-to-secondary-google-calendars/">introductory post</a> of this series on adding events to secondary calendars. Depending on your skill level and experience that may still be true, and it definitely is true if you want to understand what you are doing, but if you just want to get it done, you can probably muddle through with the following instructions. </p>
<p>Here&#8217;s the really short story: when you call the <a href="http://gdata-python-client.googlecode.com/svn/trunk/pydocs/gdata.calendar.service.html">insertEvent</a> method, you pass the event that you are creating and optionally, the edit url of the calendar where you want the event to appear. So, to create an event on a secondary calendar, just pass the edit link of the calendar. (You can get the edit link of a calendar in python by calling <code>GetEditLink().href</code> on it.)</p>
<p>For the longer story, I&#8217;ll assume that you have installed Python, ElementTree and the Google Data Python Library, following <a href="http://code.google.com/apis/gdata/articles/python_client_lib.html">Google&#8217;s instructions</a>. </p>
<p>Run through the tests and the sample code. When I ran the calendarExample.py it failed with this stack trace:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">Traceback <span style="color: #7a0874; font-weight: bold;">&#40;</span>most recent call <span style="color: #c20cb9; font-weight: bold;">last</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>:
  File <span style="color: #ff0000;">&quot;./samples/calendar/calendarExample.py&quot;</span>, line <span style="color: #000000;">577</span>, <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">&lt;</span>module<span style="color: #000000; font-weight: bold;">&gt;</span>
    main<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
  File <span style="color: #ff0000;">&quot;./samples/calendar/calendarExample.py&quot;</span>, line <span style="color: #000000;">574</span>, <span style="color: #000000; font-weight: bold;">in</span> main
    sample.Run<span style="color: #7a0874; font-weight: bold;">&#40;</span>delete<span style="color: #7a0874; font-weight: bold;">&#41;</span>
  File <span style="color: #ff0000;">&quot;./samples/calendar/calendarExample.py&quot;</span>, line <span style="color: #000000;">498</span>, <span style="color: #000000; font-weight: bold;">in</span> Run
    self._PrintAllEventsOnDefaultCalendar<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
  File <span style="color: #ff0000;">&quot;./samples/calendar/calendarExample.py&quot;</span>, line <span style="color: #000000;">99</span>, <span style="color: #000000; font-weight: bold;">in</span> _PrintAllEventsOnDefaultCalendar
    print <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>%s'</span> <span style="color: #000000; font-weight: bold;">%</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>a_participant.attendee_status.value,<span style="color: #7a0874; font-weight: bold;">&#41;</span>
AttributeError: <span style="color: #ff0000;">'NoneType'</span> object has no attribute <span style="color: #ff0000;">'value'</span></pre></div></div>

<p>Since all I wanted to do was to make this sample code run for the single case of adding an event to a secondary calendar, I commented out line 99, but the code should be checking that there is an attendee status before writing its value. After that change the sample code ran fine for me.</p>
<p>To insert a single event in a secondary calendar, I copied <code>calendarExample.py</code> to <code> secondaryCalendarInsert.py</code>. Then I commented out everything in the <code>Run</code> method except this line:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>503
</pre></td><td class="code"><pre class="python python" style="font-family:monospace;">    see = <span style="color: #008000;">self</span>._InsertSingleEvent<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>and made the following change,</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>266
267
</pre></td><td class="code"><pre class="python python" style="font-family:monospace;">new_event = <span style="color: #008000;">self</span>.<span style="color: black;">cal_client</span>.<span style="color: black;">InsertEvent</span><span style="color: black;">&#40;</span>event, 
  <span style="color: #483d8b;">'/calendar/feeds/g5b79g3f2bi5hc1it41seuu41c@group.calendar.google.com/private/full'</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>This instructs the InsertEvent method to create the event in my secondary calendar by <code>POST</code>ing to the url of  my &#8220;Secondary Calendar&#8221; (id <code>g5b79g3f2bi5hc1it41seuu41c@group.calendar.google.com</code>) instead of my primary calendar (id <code>default</code>). I found the calendar ID on the calendar settings page of the calendar, but as I said above, if you have accessed a calendar programatically, you can just call <code>GetEditLink().href</code> on it to get the proper link.</p>
<p>You can see that a &#8220;One Time Tennis with Beth&#8221; event was inserted beginning at the moment I did the insert and lasting for one hour, as described in the sample code. </p>
<p>[Update 2008-11-14: You can't see this if you are using Safari. In general embedded calendar's show in Safari, but there is something about this particular calendar that causes it not to display. Google does a number of separate calls and redirects to obtain the correct data for this calendar and it looks like one of the calls returns data that doesn't correspond to the mime-types. The point that I was trying to communicate with this illustration was that the event did in fact appear and that it was on the secondary calendar.]</p>
<p><iframe src="http://www.google.com/calendar/embed?showTitle=0&amp;showNav=0&amp;showDate=0&amp;showPrint=0&amp;showTabs=0&amp;showTz=0&amp;mode=WEEK&amp;dates=20080928%2F20081004&amp;height=600&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=calendar.maven%40gmail.com&amp;color=%232952A3&amp;src=g5b79g3f2bi5hc1it41seuu41c%40group.calendar.google.com&amp;color=%235229A3&amp;ctz=America%2FLos_Angeles" style=" border-width:0 " width="600" height="600" frameborder="0" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://67central.com/bc/2008/09/28/adding-events-to-secondary-google-calendars-in-python/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Q &#038; A - Sharing Calendars</title>
		<link>http://67central.com/bc/2008/09/09/q-a-sharing-calendars/</link>
		<comments>http://67central.com/bc/2008/09/09/q-a-sharing-calendars/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 03:41:09 +0000</pubDate>
		<dc:creator>yesteray</dc:creator>
		
		<category><![CDATA[Calendar]]></category>

		<category><![CDATA[GCalendar]]></category>

		<category><![CDATA[Visual Elements]]></category>

		<guid isPermaLink="false">http://67central.com/bc/?p=83</guid>
		<description><![CDATA[This is a little out of my normal area here, but I received this question in my email and I figured I&#8217;d answer it here for everyone&#8217;s future reference. Maybe I&#8217;ll become the next &#8220;Ask Dave&#8220;? 
On Sep 9, 2008, at 9:05 AM, nadine wrote:
Dear Ray,
I do hope you don’t mind my email you… I [...]]]></description>
			<content:encoded><![CDATA[<p>This is a little out of my normal area here, but I received this question in my email and I figured I&#8217;d answer it here for everyone&#8217;s future reference. Maybe I&#8217;ll become the next &#8220;<a href="http://www.askdavetaylor.com/">Ask Dave</a>&#8220;? </p>
<blockquote><p>On Sep 9, 2008, at 9:05 AM, nadine wrote:<br />
Dear Ray,</p>
<p>I do hope you don’t mind my email you… I am desperate!!! </p>
<p>I work for a gentleman who in turn works for 6 different companies.  Because his calendar entries need to be colour coded I have obviously set up a calendar representing each different company which shows a different colour.  This works fine between he and I. </p>
<p>However, he would like to share his calendar with a number of colleagues.  Do I firstly have to ask each of his colleagues to open a Google account and then do I send an invite to them?  However, I think this invites them only to his one calendar and not to all the associated company calendars?<br />
 <span id="more-83"></span><br />
If you are able to advise, I’d be most grateful.  I have trawled the net for approx three hours without success.</p>
<p>Thanks,<br />
Nadine
</p></blockquote>
<p>Hi Nadine,</p>
<p>It depends on what you mean by share.</p>
<p>If your employer wants to share 6 different calendars with another person, and that person will have access to add and delete events, or add other persons to those who can view those calendars, he will need to send 6 separate invitations to that person.</p>
<p>If he wants to do exactly the same for a number of other people, then he still only has to send 6 invitations, but include all of the other people.</p>
<p>There are a couple of easier alternatives, though, if the others don&#8217;t need to make changes to the company calendars.</p>
<p>You can see one example at my blog, http://67central.com/bc/calendar/. On that page I have displayed 5 different calendars, that anyone can see. These are embedded calendars using the Google Calendar Embed tool to present 5 calendars, all in different colors on a single web page. If you have your own web server or web page, you could add code to a page and your employers colleagues could view it. They could also add the events to their personal calendars.</p>
<p>One small fly in the ointment of that approach is that the content will be visible to anyone which may be a concern, depending on what is on the calendar.</p>
<p>Finally, you can just send the colleagues the private urls for the 6 calendars. On the settings page of each Google calendar, there are 3 links for the &#8220;Private Address.&#8221; These are links to the XML, HTML, and iCal formatted versions of the calendar. If you send the colleagues the 6 HMTL private links for each color coded company, then the colleagues can view the calendars in their web browser. If you send them the XML links they will be able to subscribe to those calendars in Google and finally if you send them the iCal links, the colleagues will be able to add those calendars to many different types of calendaring software.</p>
<p>I hope that helps,</p>
<p>Ray</p>
]]></content:encoded>
			<wfw:commentRss>http://67central.com/bc/2008/09/09/q-a-sharing-calendars/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Adding Events to Secondary Google Calendars</title>
		<link>http://67central.com/bc/2008/09/01/adding-events-to-secondary-google-calendars/</link>
		<comments>http://67central.com/bc/2008/09/01/adding-events-to-secondary-google-calendars/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 19:00:59 +0000</pubDate>
		<dc:creator>yesteray</dc:creator>
		
		<category><![CDATA[Calendar]]></category>

		<category><![CDATA[GCalendar]]></category>

		<category><![CDATA[GData]]></category>

		<category><![CDATA[SecondaryCalendarEvents]]></category>

		<guid isPermaLink="false">http://67central.com/bc/?p=20</guid>
		<description><![CDATA[The most frequently asked question posed in the Google Calendar Date API Group is, &#8220;How do I add events to a secondary calendar?&#8221;
In this series of posts, I am going to attempt to provide an answer for using every language that has a client library. I discuss the &#8220;official&#8221; client libraries for Python, Php, .NET, [...]]]></description>
			<content:encoded><![CDATA[<p>The most frequently asked question posed in the <a href="http://groups.google.com/group/google-calendar-help-dataapi">Google Calendar Date API Group</a> is, &#8220;How do I add events to a secondary calendar?&#8221;</p>
<p>In this series of posts, I am going to attempt to provide an answer for using every language that has a client library. I discuss the &#8220;official&#8221; client libraries for Python, Php, .NET, Java and Javascript as well as the slightly less official Objective-C library and some of the attempts to create Ruby library for interacting with Google Calendar and GData. If there are other client libraries, just let me know in the comments and I&#8217;ll add instructions here, or link to them elsewhere as I have time, interest and understanding.</p>
<p>I start with describing how to POST XML to a calendar url. This is &#8220;The Protocol&#8221;.  You should read this information about the protocol, even if you plan to use a client library. Each client library is using this protocol under the covers, so understanding what is happening will help you better use your client library. In addition, I&#8217;ll only explain some terms in this section, so you&#8217;ll need to read it to understand what I am talking about.</p>
<p>All information in these posts comes from the Google Developer&#8217;s Guides, the Client Library Documentation, the source code for the client library and my own exploration and testing. I&#8217;ll provide links to these resources in the text as appropriate. For simplicity&#8217;s sake, I only cover creating single-occurrence events for users that have properly authenticated using client login. These cases should be sufficient for illustrating how to add to secondary calendars, but 1) I&#8217;m not aware of any differences in creating single-occurrence versus quickadd or recurrent events on secondary calendars in any of the client libraries and 2) I haven&#8217;t used AuthSub. </p>
<p>I have personally tested all of the code that I present here, unless otherwise noted. That means that I was able to create an event on a calendar using that code. In all cases, I am adding events to my <a href="http://www.google.com/calendar/embed?src=2v78cr597kh4kduf3db9t4p1es%40group.calendar.google.com&#038;ctz=America/Los_Angeles">Secondary Calendar</a> which is public, so have a look. I&#8217;ll be trying to add an event that occurs at the time when the relevant article is posted.</p>
<p>Here is a table of contents of the language-specific treatments. I&#8217;ll update the links as I complete the sections.</p>
<p><a href="http://67central.com/bc/2008/09/28/adding-events-to-secondary-google-calendars-in-python/">Python</a> - Complete September 29, 2008<br />
Php<br />
.NET<br />
Java<br />
Javascript<br />
Objective C<br />
Ruby</p>
<p><span id="more-20"></span></p>
<h2>The Protocol</h2>
<p>To create an event on any Google Calendar you POST the appropriate XML to the calendar&#8217;s url. The easiest way to obtain the appropriate XML is to start with an existing event. The easiest way to obtain the calendar&#8217;s url, well, that&#8217;s a really the rub.</p>
<p>Here&#8217;s what Google says about finding the appropriate url:</p>
<blockquote><p>To post an entry, send the following HTTP request to Calendar, using a special &#8220;default&#8221; URL (and an Authorization header; see the section on authentication above). Calendar automatically redirects the default URL to the URL of the read/write private feed of the calendar belonging to the authenticated user. (Note that you don&#8217;t have to use the default URL to send a POST request to Calendar; you can specify the user ID instead of &#8220;default&#8221; if you prefer. For more information, see the <a href="http://code.google.com/apis/calendar/reference.html#Feeds">Calendar feed types</a> reference.)</p></blockquote>
<p>This is the source of all the confusion on the issue of creating events on secondary calendars.<br />
As mentioned  further on after this quote, the &#8220;default&#8221; URL is<br />
<code>http://www.google.com/calendar/feeds/default/private/full</code><br />
If you specify the user ID, this would be <code>http://www.google.com/calendar/feeds/user@gmail.com/private/full</code>, you get another URL for the user&#8217;s primary calendar. You can POST to this url and create events. </p>
<p>The question is, what is the user ID for a secondary calendar? If the calendar belongs to your friend, then <code>http://www.google.com/calendar/feeds/friend@gmail.com/private/full</code> works. Suppose that I have created a personal calendar and a work calendar. The user ID for my personal (primary) calendar is my gmail address. What is the user ID for my work calender? My gmail address? No, that is the user ID for my personal calendar. </p>
<p>The problem is that Google doesn&#8217;t use the term user ID consistently and what they really mean here is what they call calendar ID in <a href="http://code.google.com/apis/calendar/developers_guide_protocol.html#UpdatingCalendars">other contexts</a>.</p>
<p>To get the calendar ID, there are a couple of methods. </p>
<p>Google suggests that you parse the calendar ID from the calendar&#8217;s edit link in the allcalendars feed. Here is the entire entry for my secondary calendar from the all calendar&#8217;s feed.</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  http://www.google.com/calendar/feeds/default/allcalendars/full/2v78cr597kh4kduf3db9t4p1es%40group.calendar.google.com<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;published<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2008-09-01T05:24:24.673Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/published<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;updated<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2008-09-01T04:13:31.000Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/updated<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Secondary Calendar<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;summary</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>This calendar is for testing and
  illustrating the creation of events using the Google Calendar
  Data API on a secondary calendar.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/summary<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;content</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/atom+xml'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">src</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/2v78cr597kh4kduf3db9t4p1es%40group.calendar.google.com/private/full'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'alternate'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/atom+xml'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/2v78cr597kh4kduf3db9t4p1es%40group.calendar.google.com/private/full'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'http://schemas.google.com/acl/2007#accessControlList'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/atom+xml'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/2v78cr597kh4kduf3db9t4p1es%40group.calendar.google.com/acl/full'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'self'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/atom+xml'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/default/allcalendars/full/2v78cr597kh4kduf3db9t4p1es%40group.calendar.google.com'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'edit'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/atom+xml'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/default/allcalendars/full/2v78cr597kh4kduf3db9t4p1es%40group.calendar.google.com'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Secondary Calendar<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gCal:timezone</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'America/Los_Angeles'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gCal:timesCleaned</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'0'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gCal:hidden</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'false'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gCal:color</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'#5229A3'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gCal:selected</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'true'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gCal:accesslevel</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'owner'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:where</span> <span style="color: #000066;">valueString</span>=<span style="color: #ff0000;">''</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>So, Google is suggesting that you take the element <code>&lt;link rel='edit' ...  .&gt;</code> element , parse out the href, extract the calendar ID, &#8220;2v78cr597kh4kduf3db9t4p1es%40group.calendar.google.com&#8221;, and substitute it into &#8220;http://www.google.com/calendar/feeds/default/<calendar ID>/full&#8221;. That works, but isn&#8217;t the most intuitive series of steps.</p>
<p>A more direct way is to just use the <code>src</code> attribute of the content. Since the content of the calendar is empty, <a href="http://tools.ietf.org/html/rfc4287#section-4.1.3">Atom specifies</a> that the <code>src</code> attribute must be present, and contain a link to the content. That&#8217;s a long way of saying, &#8220;This is the link that we want!&#8221; To read the content of a calendar, GET the url indicated by the <code>src</code> attribute link of the content. To create an event, POST appropriately formed XML to the <code>src</code> attribute link of the calendar. This is REST 101.</p>
<p>Note that the link in the <code>src</code> attribute of the content is exactly the same as the <code>alternate</code> link. This might be useful information as we work through the various client libraries.</p>
<p>The easiest method is to look it up manually through the UI. In the UI, under the Calendar Details tab of Calendar Settings, there is a section for Calendar Address and included in that section is a parenthetical notation of the Calendar ID. </p>
<p>Note that this is called Calendar ID whether the calendar is the user&#8217;s primary calendar (in which case the calendar ID is also the user ID) or a secondary calendar, in which case it is some other user&#8217;s email address, or a long string that looks like an e-mail address for an obscure user in the group.calendar.google.com domain, like <code>2v78cr597kh4kduf3db9t4p1es@group.calendar.google.com</code>. That by the way is the calendar ID in my <a href="http://www.google.com/calendar/embed?src=2v78cr597kh4kduf3db9t4p1es%40group.calendar.google.com&#038;ctz=America/Los_Angeles">Secondary Calendar</a>. You can see how Google has used the calendar ID as the <code>src</code> parameter in the link to that calendar, <code>http://www.google.com/calendar/embed?src=2v78cr597kh4kduf3db9t4p1es%40group.calendar.google.com</code>.</p>
<p>So now the hard part is over. We have the correct url. Here&#8217;s the XML that we&#8217;ll send as the data in our post request, cribbed from the <a href="http://code.google.com/apis/calendar/developers_guide_protocol.html#CreatingEvents">Developer&#8217;s Guide</a> and modified for our purposes. Follow that link for more details about how additional elements will be added on creation.</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;entry</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">'http://www.w3.org/2005/Atom'</span></span>
<span style="color: #009900;">    <span style="color: #000066;">xmlns:gd</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;category</span> <span style="color: #000066;">scheme</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#kind'</span></span>
<span style="color: #009900;">    <span style="color: #000066;">term</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event'</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/category<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>POSTed XML<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;content</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>I was POSTed using hand-crafted XML via the Protocol!<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:transparency</span></span>
<span style="color: #009900;">    <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event.opaque'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/gd:transparency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:eventStatus</span></span>
<span style="color: #009900;">    <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event.confirmed'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/gd:eventStatus<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:when</span> <span style="color: #000066;">startTime</span>=<span style="color: #ff0000;">'2008-09-01'</span></span>
<span style="color: #009900;">    <span style="color: #000066;">endTime</span>=<span style="color: #ff0000;">'2008-09-02'</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/gd:when<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Wrap this up in a script that I have that does authentication and handles the redirects and POST that <code>&lt;entry&gt;</code> to</p>

<div class="wp_syntax"><div class="code"><pre class="xm" style="font-family:monospace;">https://www.google.com/calendar/feeds/2v78cr597kh4kduf3db9t4p1es@group.calendar.google.com/private/full</pre></div></div>

<p>.</p>
<p>Below is Google&#8217;s response. More importantly, see the resulting event <a href="href='http://www.google.com/calendar/event?eid=NXEzOHExOWgyczc1NnVtODkwMmI5ZjdtcnMgMnY3OGNyNTk3a2g0a2R1ZjNkYjl0NHAxZXNAZw'">here</a>. Enjoy.</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">'1.0'</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">'utf-8'</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;entry</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">'http://www.w3.org/2005/Atom'</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns:batch</span>=<span style="color: #ff0000;">'http://schemas.google.com/gdata/batch'</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns:gCal</span>=<span style="color: #ff0000;">'http://schemas.google.com/gCal/2005'</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns:gd</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  http://www.google.com/calendar/feeds/2v78cr597kh4kduf3db9t4p1es%40group.calendar.google.com/private/full/5q38q19h2s756um8902b9f7mrs<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;published<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2008-09-01T11:32:34.000Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/published<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;updated<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2008-09-01T11:32:35.000Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/updated<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;category</span> <span style="color: #000066;">scheme</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#kind'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">term</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>POSTed XML<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;content</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>I was POSTed using hand-crafted XML via the
  Protocol!<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'alternate'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text/html'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/event?eid=NXEzOHExOWgyczc1NnVtODkwMmI5ZjdtcnMgMnY3OGNyNTk3a2g0a2R1ZjNkYjl0NHAxZXNAZw'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">title</span>=<span style="color: #ff0000;">'alternate'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'self'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/atom+xml'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/2v78cr597kh4kduf3db9t4p1es%40group.calendar.google.com/private/full/5q38q19h2s756um8902b9f7mrs'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'edit'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/atom+xml'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/2v78cr597kh4kduf3db9t4p1es%40group.calendar.google.com/private/full/5q38q19h2s756um8902b9f7mrs/63355951955'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Calendar Maven<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;email<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>calendar.maven@gmail.com<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/email<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:comments<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:feedLink</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/2v78cr597kh4kduf3db9t4p1es%40group.calendar.google.com/private/full/5q38q19h2s756um8902b9f7mrs/comments'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/gd:comments<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:eventStatus</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event.confirmed'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:visibility</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event.default'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:transparency</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event.opaque'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gCal:uid</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'5q38q19h2s756um8902b9f7mrs@google.com'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gCal:sequence</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'0'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:when</span> <span style="color: #000066;">startTime</span>=<span style="color: #ff0000;">'2008-09-01'</span> <span style="color: #000066;">endTime</span>=<span style="color: #ff0000;">'2008-09-02'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:who</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event.organizer'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">valueString</span>=<span style="color: #ff0000;">'Secondary Calendar'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">email</span>=<span style="color: #ff0000;">'2v78cr597kh4kduf3db9t4p1es@group.calendar.google.com'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:where</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://67central.com/bc/2008/09/01/adding-events-to-secondary-google-calendars/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Link Elements in GCalendar Calendar Feeds</title>
		<link>http://67central.com/bc/2008/05/15/link-attributes-in-gcalendar-calendar-feeds/</link>
		<comments>http://67central.com/bc/2008/05/15/link-attributes-in-gcalendar-calendar-feeds/#comments</comments>
		<pubDate>Thu, 15 May 2008 07:02:08 +0000</pubDate>
		<dc:creator>yesteray</dc:creator>
		
		<category><![CDATA[Calendar]]></category>

		<category><![CDATA[GCalendar]]></category>

		<category><![CDATA[GData]]></category>

		<guid isPermaLink="false">http://cornercases.67central.com/?p=8</guid>
		<description><![CDATA[Here for reference is a complete listing of the rel and type attributes I have observed for link elements in Google Calendar feeds. These are a superset of the attributes contained in link elements found in event feeds. Google Calendar feeds do not use all available combinations of permitted Atom link elements. A complete list [...]]]></description>
			<content:encoded><![CDATA[<p>Here for reference is a complete listing of the <code>rel</code> and <code>type</code> attributes I have observed for <code>link</code> elements in Google Calendar feeds. These are a superset of the attributes contained in <code>link</code> elements <a href="http://67central.com/bc/2008/04/27/link-elements-in-gcalendar-feeds/">found</a> in <code>event</code> feeds. Google Calendar feeds do not use all available combinations of permitted Atom link elements. A complete list of Atom link relations is <a href="http://www.iana.org/assignments/link-relations.html">here</a>. Atom requires that each element have a maximum of one link of each relation and type. Types are specified <a href="http://tools.ietf.org/html/rfc4287#section-3.1.1">here</a> for Atom elements. None of the observed relations from outside the Atom namespace have types. </p>
<pre><code>link rel='alternate' type='application/atom+xml'
link rel='alternate' type='text/calendar'
link rel='alternate' type='text/html'
link rel='edit' type='application/atom+xml'
link rel='http://schemas.google.com/acl/2007#accessControlList'
link rel='http://schemas.google.com/g/2005#batch'
link rel='http://schemas.google.com/acl/2007#controlledObject'
link rel='http://schemas.google.com/g/2005#feed'
link rel='http://schemas.google.com/g/2005#post'
link rel='next' type='application/atom+xml'
link rel='previous' type='application/atom+xml'
link rel='self' type='application/atom+xml'
</code></pre>
<h2>Notes</h2>
<p><code>Alternate</code> links point to an alternate representation of the same resource. There are three types represented in Google Calendar feeds; the <code>type</code> specifies that nature of the alternate representation. The <code>application/atom+xml</code> type alternate links are all contained inside <code>&lt;entry&gt;</code> elements and point to the individual <code>entry</code>. The <code>text/html</code> type links are to html representations of the calendar or event. The <code>text/calendar</code> are links to ics format calendar files.</p>
<p>The <code>edit</code> links are used to update or delete calendars or events. The <code>post</code> links are used to create calendars or events. The <code>edit</code> links are defined in the <a href="http://tools.ietf.org/html/rfc5023#section-11.1">Atom Publishing Protocol</a>. <code>Post</code> links are Google&#8217;s own invention.</p>
<p><code>Batch</code> links identify the uri for posting batch request. I have no experience with batch requests, but according to the <a href="http://code.google.com/apis/gdata/batch.html">documentation</a> insert, update, delete, or query operations are permitted.</p>
<p>Feed links in all observed cases are exactly the same as the <code>id</code> of the feed. The <code>self</code> links are related to the <code>feed</code> links and id, but also contain the (possibly implicit) url parameters that were used to retrieve the feed.  </p>
<p>AccessControlList links identify the location of the access control list (acl) for the feed. ControlledObject links identify the feed that the acl pertains to.</p>
<p><code>Next</code> and <code>previous</code> specify Atom Publishing Protocol <a href="http://tools.ietf.org/html/rfc5023#section-10.1">partial collections</a>.  <code>Next</code> and <code>previous</code> are <a href="http://tools.ietf.org/html/rfc5005#section-3">paged feeds</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://67central.com/bc/2008/05/15/link-attributes-in-gcalendar-calendar-feeds/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Persistence of gsessionids</title>
		<link>http://67central.com/bc/2008/05/08/persistence-of-gsessionids/</link>
		<comments>http://67central.com/bc/2008/05/08/persistence-of-gsessionids/#comments</comments>
		<pubDate>Thu, 08 May 2008 22:40:00 +0000</pubDate>
		<dc:creator>yesteray</dc:creator>
		
		<category><![CDATA[Calendar]]></category>

		<category><![CDATA[GCalendar]]></category>

		<category><![CDATA[GData]]></category>

		<guid isPermaLink="false">http://67central.com/bc/?p=12</guid>
		<description><![CDATA[I&#8217;ve read this paragraph many times, but somehow the full meaning just became apparent to me.
Just like in the previous example, Calendar may return an HTTP 302 redirect; if so, then the redirect URL has a new parameter, gsessionid, appended to it.  If you received the redirect, then send the same POST request again, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve read this <a href="http://code.google.com/apis/calendar/developers_guide_protocol.html#CreatingEvents">paragraph</a> many times, but somehow the full meaning just became apparent to me.</p>
<blockquote><p>Just like in the previous example, Calendar may return an HTTP 302 redirect; if so, then the redirect URL has a new parameter, <code>gsessionid</code>, appended to it.  If you received the redirect, then send the same <code>POST</code> request again, with the same Authorization header and the same content, but with the <code>gsessionid</code> parameter appended.  The response may also include a <code>S</code> cookie, which you should store and send this cookie with future requests <a href="http://www.ietf.org/rfc/rfc2109.txt">as appropriate</a>.  Please see the <a href="http://code.google.com/support/bin/answer.py?answer=55833&amp;topic=10360">knowledge base</a> for more information on handling sessions with the Calendar data API. Please note: if a session ID indicated in a cookie header conflicts<br />with the session ID passed as a gsessionid URL parameter, you will get caught in a redirect loop. </p></blockquote>
<p>The introductory clause obscures important information. Having read the previous example, I thought that there wasn&#8217;t much to be gained by reading this paragraph in detail. Just do the same thing as before, &#8220;So after you&#8217;ve sent the <code>GET</code> request, you have to read the HTTP headers of the response to find the URL with the session ID appended; then you need to send another <code>GET</code> request with that new URL.&#8221;</p>
<p>Really, I didn&#8217;t think too much. The gsessionid is a persistent session id. You can send it with any future request and if you do, and the session id matches the <code>auth</code> token your request will be accepted without redirect. Moreover you can grab the <code>S</code> cookie and stick it in your headers and not need to worry about it.This is documented <a href="http://code.google.com/support/bin/answer.py?answer=55833&#038;topic=10360">here</a>.</p>
<p>Here&#8217;s an example in action:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># get_feed is from a project I'm working on</span>
irb:01:0<span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'get_feed'</span>                         
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>
<span style="color:#008000; font-style:italic;"># it provides an authorization method that also sets @headers and creates @http object</span>
irb:02:0<span style="color:#006600; font-weight:bold;">&gt;</span> get_auth<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'me@gmail.com'</span>,<span style="color:#996600;">'top_secret'</span><span style="color:#006600; font-weight:bold;">&#41;</span>      
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#996600;">&quot;Authorization&quot;</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;GoogleLogin auth=DQAAAIQAAABECsmTToeu0o97DoPQ8v9lXDkqFYQY4tOC4QmkItA9jb1J2GfEql69SifsFF7TJJ6_lbAST3iuc-aZQUIvY3qDfPj4pNpo9_XAsCEphd9jRdqeqengYDnpTOEJJedw9jRV738b4x-EluyDKDPBw0f46fFDto0o8zkgY_bUChKK0T6j8A5PgedYRRJzQJm_oSY&quot;</span>, <span style="color:#996600;">&quot;Content-Type&quot;</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;application/atom+xml&quot;</span>, <span style="color:#996600;">&quot;Service&quot;</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;67central.com--get-feed-0.0.1&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
irb:03:0<span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#0066ff; font-weight:bold;">@headers</span>                                   
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#996600;">&quot;Authorization&quot;</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;GoogleLogin auth=DQAAAIQAAABECsmTToeu0o97DoPQ8v9lXDkqFYQY4tOC4QmkItA9jb1J2GfEql69SifsFF7TJJ6_lbAST3iuc-aZQUIvY3qDfPj4pNpo9_XAsCEphd9jRdqeqengYDnpTOEJJedw9jRV738b4x-EluyDKDPBw0f46fFDto0o8zkgY_bUChKK0T6j8A5PgedYRRJzQJm_oSY&quot;</span>, <span style="color:#996600;">&quot;Content-Type&quot;</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;application/atom+xml&quot;</span>, <span style="color:#996600;">&quot;Service&quot;</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;67central.com--get-feed-0.0.1&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#008000; font-style:italic;"># User's default calendar and own calendars feeds</span>
irb:04:0<span style="color:#006600; font-weight:bold;">&gt;</span> default =  <span style="color:#996600;">'/calendar/feeds/default'</span>          
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/calendar/feeds/default&quot;</span>
irb:05:0<span style="color:#006600; font-weight:bold;">&gt;</span> all = <span style="color:#996600;">'/calendar/feeds/default/owncalendars/full'</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/calendar/feeds/default/owncalendars/full&quot;</span>
<span style="color:#008000; font-style:italic;"># Request for feeds are redirected           </span>
irb:06:0<span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#0066ff; font-weight:bold;">@http</span>.<span style="color:#9900CC;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span>default,@headers<span style="color:#006600; font-weight:bold;">&#41;</span>       
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#008000; font-style:italic;">#&lt;Net::HTTPFound 302 Moved Temporarily readbody=true&gt;</span>
irb:07:0<span style="color:#006600; font-weight:bold;">&gt;</span> response = <span style="color:#0066ff; font-weight:bold;">@http</span>.<span style="color:#9900CC;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span>all,@headers<span style="color:#006600; font-weight:bold;">&#41;</span>       
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#008000; font-style:italic;">#&lt;Net::HTTPFound 302 Moved Temporarily readbody=true&gt;</span>
<span style="color:#008000; font-style:italic;"># All calendars feed to this location, note the gsessionid</span>
irb:08:0<span style="color:#006600; font-weight:bold;">&gt;</span> response<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'Location'</span><span style="color:#006600; font-weight:bold;">&#93;</span>                       
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;https://www.google.com:443/calendar/feeds/default/owncalendars/full?gsessionid=uVGhyT0F60BtaKPNVsOeig&quot;</span>
<span style="color:#008000; font-style:italic;"># Also returns this cookie       </span>
irb:09:0<span style="color:#006600; font-weight:bold;">&gt;</span> response<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'set-cookie'</span><span style="color:#006600; font-weight:bold;">&#93;</span>                     
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;S=calendar=uVGhyT0F60BtaKPNVsOeig;Expires=Fri, 08-May-2009 20:54:31 GMT&quot;</span>
irb:<span style="color:#006666;">10</span>:0<span style="color:#006600; font-weight:bold;">&gt;</span> s_cookie =  response<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;set-cookie&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">';'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">first</span>                                                  
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;S=calendar=uVGhyT0F60BtaKPNVsOeig&quot;</span>
irb:<span style="color:#006666;">11</span>:0<span style="color:#006600; font-weight:bold;">&gt;</span> all_redirect = <span style="color:#996600;">&quot;/calendar/feeds/default/owncalendars/full?gsessionid=uVGhyT0F60BtaKPNVsOeig&quot;</span>        
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/calendar/feeds/default/owncalendars/full?gsessionid=uVGhyT0F60BtaKPNVsOeig&quot;</span>
<span style="color:#008000; font-style:italic;"># With the gsessionid, request succeeds    </span>
irb:<span style="color:#006666;">12</span>:0<span style="color:#006600; font-weight:bold;">&gt;</span> response = <span style="color:#0066ff; font-weight:bold;">@http</span>.<span style="color:#9900CC;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span>all_redirect,@headers<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#008000; font-style:italic;">#&lt;Net::HTTPOK 200 OK readbody=true&gt;</span>
irb:<span style="color:#006666;">13</span>:0<span style="color:#006600; font-weight:bold;">&gt;</span> default_with_redirect = default <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;?gsessionid=uVGhyT0F60BtaKPNVsOeig&quot;</span>                                        
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;/calendar/feeds/default?gsessionid=uVGhyT0F60BtaKPNVsOeig&quot;</span>
<span style="color:#008000; font-style:italic;"># So does this one                         </span>
irb:<span style="color:#006666;">14</span>:0<span style="color:#006600; font-weight:bold;">&gt;</span> response = <span style="color:#0066ff; font-weight:bold;">@http</span>.<span style="color:#9900CC;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span>default_with_redirect,@headers<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#008000; font-style:italic;">#&lt;Net::HTTPOK 200 OK readbody=true&gt;</span>
<span style="color:#008000; font-style:italic;"># Set the cookie                        </span>
irb:<span style="color:#006666;">15</span>:0<span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#0066ff; font-weight:bold;">@headers</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'Cookie'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = s_cookie                
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;S=calendar=uVGhyT0F60BtaKPNVsOeig&quot;</span>
<span style="color:#008000; font-style:italic;"># And both request succeed without gsessionid                     </span>
irb:<span style="color:#006666;">16</span>:0<span style="color:#006600; font-weight:bold;">&gt;</span> response = <span style="color:#0066ff; font-weight:bold;">@http</span>.<span style="color:#9900CC;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span>all,@headers<span style="color:#006600; font-weight:bold;">&#41;</span>         
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#008000; font-style:italic;">#&lt;Net::HTTPOK 200 OK readbody=true&gt;</span>
irb:<span style="color:#006666;">17</span>:0<span style="color:#006600; font-weight:bold;">&gt;</span> response = <span style="color:#0066ff; font-weight:bold;">@http</span>.<span style="color:#9900CC;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span>default,@headers<span style="color:#006600; font-weight:bold;">&#41;</span>         
<span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#008000; font-style:italic;">#&lt;Net::HTTPOK 200 OK readbody=true&gt;</span></pre></div></div>

<p>I hope that is useful to some one. There is a claim in the documentation (I&#8217;ve temporarily lost it) that the API libraries will handle these session ids and cookies automatically. Good to know.</p>
]]></content:encoded>
			<wfw:commentRss>http://67central.com/bc/2008/05/08/persistence-of-gsessionids/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Link Elements in GCalendar Event Feeds</title>
		<link>http://67central.com/bc/2008/04/27/link-elements-in-gcalendar-feeds/</link>
		<comments>http://67central.com/bc/2008/04/27/link-elements-in-gcalendar-feeds/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 06:14:40 +0000</pubDate>
		<dc:creator>yesteray</dc:creator>
		
		<category><![CDATA[Calendar]]></category>

		<category><![CDATA[GCalendar]]></category>

		<category><![CDATA[GData]]></category>

		<category><![CDATA[atom]]></category>

		<category><![CDATA[feeds]]></category>

		<category><![CDATA[googlecalendar]]></category>

		<guid isPermaLink="false">http://cornercases.67central.com/?p=7</guid>
		<description><![CDATA[A question from the for the Google Calendar Data API Developer Forum.
Hi all, 

for (CalendarEventEntry event : calEventList) { 
    for (Link link : event.getLinks()) { 
        System.out.println(link.getHref()); 
} 

above code fragment prints three types of links, what these are meant for?
What these links signify [...]]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://groups.google.com/group/google-calendar-help-dataapi/browse_thread/thread/a9e11afdb73ee3dd">question</a> from the for the Google Calendar Data API <a href="http://groups.google.com/group/google-calendar-help-dataapi">Developer Forum</a>.</p>
<blockquote><p>Hi all, </p>
<pre><code>
for (CalendarEventEntry event : calEventList) { 
    for (Link link : event.getLinks()) { 
        System.out.println(link.getHref()); 
} 
</code></pre>
<p>above code fragment prints three types of links, what these are meant for?<br />
What these links signify in the feed.<br />
&#8211;<br />
Regards,<br />
Vijay
</p></blockquote>
<p>This is a question that I had been meaning to address, but I was planning to get to it after I addressed all the different urls that are used in the GCalendar API. Actually this question is easier and more straight-forward to answer, so it makes sense to  answer this first. I&#8217;ll defer the larger questions of GCalendar event feeds and generic Atom feeds for a later post.</p>
<p>Here&#8217;s a complete entry feed (as formated with <code>tidy -xml -indent</code>):</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">'1.0'</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">'utf-8'</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;entry</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">'http://www.w3.org/2005/Atom'</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns:batch</span>=<span style="color: #ff0000;">'http://schemas.google.com/gdata/batch'</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns:gCal</span>=<span style="color: #ff0000;">'http://schemas.google.com/gCal/2005'</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns:gd</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>  http://www.google.com/calendar/feeds/td3s32e6k1ib7pkgibi7v6jktg%40group.calendar.google.com/private/full/g0pdsjl18em9tcdau6baqgatkk<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;published<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2008-04-21T22:36:07.000Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/published<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;updated<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2008-04-21T22:36:07.000Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/updated<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;category</span> <span style="color: #000066;">scheme</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#kind'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">term</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Tennis with Beth<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;content</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Meet for a quick lesson.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'alternate'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text/html'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/event?eid=ZzBwZHNqbDE4ZW05dGNkYXU2YmFxZ2F0a2sgdGQzczMyZTZrMWliN3BrZ2liaTd2NmprdGdAZw'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">title</span>=<span style="color: #ff0000;">'alternate'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'self'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/atom+xml'</span></span>
<span style="color: #009900;"> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/td3s32e6k1ib7pkgibi7v6jktg%40group.calendar.google.com/private/full/g0pdsjl18em9tcdau6baqgatkk'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'edit'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/atom+xml'</span>  <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/td3s32e6k1ib7pkgibi7v6jktg%40group.calendar.google.com/private/full/g0pdsjl18em9tcdau6baqgatkk/63344500567'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Ray Baxter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;email<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>me@gmail.com<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/email<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:comments<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:feedLink</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/td3s32e6k1ib7pkgibi7v6jktg%40group.calendar.google.com/private/full/g0pdsjl18em9tcdau6baqgatkk/comments'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/gd:comments<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:eventStatus</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event.confirmed'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:visibility</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event.default'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:transparency</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event.opaque'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gCal:uid</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'g0pdsjl18em9tcdau6baqgatkk@google.com'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gCal:sequence</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'0'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:when</span> <span style="color: #000066;">startTime</span>=<span style="color: #ff0000;">'2008-04-17T08:00:00.000-07:00'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">endTime</span>=<span style="color: #ff0000;">'2008-04-17T10:00:00.000-07:00'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:who</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event.organizer'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">valueString</span>=<span style="color: #ff0000;">''</span></span>
<span style="color: #009900;">  <span style="color: #000066;">email</span>=<span style="color: #ff0000;">'td3s32e6k1ib7pkgibi7v6jktg@group.calendar.google.com'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:where</span> <span style="color: #000066;">valueString</span>=<span style="color: #ff0000;">'Rolling Lawn Courts'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Coming to Vijay&#8217;s question, there are three <code>&lt;link&gt;</code> elements in this feed. They are:</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'alternate'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text/html'</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/event?eid=ZzBwZHNqbDE4ZW05dGNkYXU2YmFxZ2F0a2sgdGQzczMyZTZrMWliN3BrZ2liaTd2NmprdGdAZw'</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">'alternate'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'self'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/atom+xml'</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/td3s32e6k1ib7pkgibi7v6jktg%40group.calendar.google.com/private/full/g0pdsjl18em9tcdau6baqgatkk'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'edit'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/atom+xml'</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/td3s32e6k1ib7pkgibi7v6jktg%40group.calendar.google.com/private/full/g0pdsjl18em9tcdau6baqgatkk/63344500567'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>The links are named for their relations, i.e. the values of their <code>rel</code> attributes.</p>
<p>The first link is the alternate link, so called because it is an alternative version of the content of this event. In this case the alternate version in html format as you can see by the <code>type='text/html'</code> attribute. Because this calendar is public, you can click on that link and see the event in your browser. <a target="_blank" href="http://www.google.com/calendar/event?eid=ZzBwZHNqbDE4ZW05dGNkYXU2YmFxZ2F0a2sgdGQzczMyZTZrMWliN3BrZ2liaTd2NmprdGdAZw" onclick="link_popup(this); return false">Try it</a>. </p>
<p>The second link is a self link. That is the the xml feed for this event, and can repull the event from this feed (in the event that Google&#8217;s servers are working, which they don&#8217;t appear to be currently.) Notice that the http attribute of the self link is exactly the same URL as the <code>&lt;id&gt;</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
http://www.google.com/calendar/feeds/td3s32e6k1ib7pkgibi7v6jktg%40group.calendar.google.com/private/full/g0pdsjl18em9tcdau6baqgatkk<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'self'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/atom+xml'</span></span>
<span style="color: #009900;"> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/td3s32e6k1ib7pkgibi7v6jktg%40group.calendar.google.com/private/full/g0pdsjl18em9tcdau6baqgatkk'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>The self link may not have been the location from <em>you</em> pulled the event. You might have pulled an entire calendar of events (which would have it&#8217;s own, distinct, self link) or you might have made a query for events matching some pattern and retrieved a number of events for that feed (which would ought have it&#8217;s own self link, but I haven&#8217;t verified).</p>
<p>Finally there is the edit link. This is the URL that you use to make changes to the event. Sending a DELETE request to this URL will delete the event. Sending a PUT request will replace event&#8217;s data with the data that you send.</p>
<p>For reference, the self and alternate link relations are specified as part of the Atom Syndication Format (<a href="http://www.rfc-editor.org/rfc/rfc4287.txt">RFC4287</a>) and the edit relation is specified as part of the Atom Publication Protocol (<a href="http://www.rfc-editor.org/rfc/rfc5023.txt">RFC5023</a>). A convenient table of all the Atom link relations is <a href="http://www.iana.org/assignments/link-relations.html">here</a>. That table will come in handy as we examine the other link relations in GCalendar feeds.</p>
<hr />
Any other questions? Leave them in the comments and I&#8217;ll get to them as I can.</p>
]]></content:encoded>
			<wfw:commentRss>http://67central.com/bc/2008/04/27/link-elements-in-gcalendar-feeds/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Purple Include</title>
		<link>http://67central.com/bc/2007/08/20/purple-include/</link>
		<comments>http://67central.com/bc/2007/08/20/purple-include/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 05:49:40 +0000</pubDate>
		<dc:creator>yesteray</dc:creator>
		
		<category><![CDATA[Visual Elements]]></category>

		<guid isPermaLink="false">http://cornercases.67central.com/2007/08/20/purple-include/</guid>
		<description><![CDATA[Brad Neuberg has worked up a new release of the Purple Include tool that came out of the Hyperscope project. Brad&#8217;s description is here.
Basically Purple Include is a mechanism for including the content of other web pages (local or remote) in the body of your page. Here are a couple of examples.  Here is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://codinginparadise.org/">Brad Neuberg</a> has worked up a new release of the Purple Include tool that came out of the <a href="http://hyperscope.org/">Hyperscope</a> project. Brad&#8217;s description is <a href="http://codinginparadise.org/weblog/2007/08/new-purple-include-release-include.html">here</a>.</p>
<p>Basically Purple Include is a mechanism for including the content of other web pages (local or remote) in the body of your page. Here are a couple of examples.  Here is a paragraph from a post of mine about Jane Jacob&#8217;s work:</p>
<p><script src="http://codinginparadise.org/projects/purple-include/purple-include.js"></script></p>
<blockquote href="http://www.warmroom.com/yesterdays/2006/11/12/network-effects-of-the-opposite-kind/#xpath(//p[6])"></blockquote>
<p>Here are two bullet points from the forgotten wisdom of Donald Rumsfeld:</p>
<blockquote href="http://www.warmroom.com/yesterdays/2006/11/08/rumsfelds-rules/#xpath(//div[@class='entry']//li)"></blockquote>
<p>There are three elements of Purple Include.</p>
<ol>
<li>
Markup that you add your page. Depending on what you are trying to do, you add a p, blockquote, q, pre, div, or span element with an href attribute.<br />
The first blockquote above came from this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;blockquote href=&quot;http://www.warmroom.com/yesterdays/2006/11/12/network-effects-of-the-opposite-kind/#xpath(//p[6])&quot;&gt;&lt;/blockquote&gt;</pre></div></div>

<p>The xpath expression, <code>#xpath(//p[6])</code>, identifies the relevant paragraph on the referenced page that will be included into you page.
</li>
<li>
A javascript that you add to your page.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script src=&quot;http://codinginparadise.org/projects/purple-include/purple-include.js&quot;&gt;&lt;/script&gt;</pre></div></div>

<p>As you can see, Brad is hosting this script on his site, for rapid development and improvements.</p>
<p>On load, this java script pulls the marked up elements from your page and makes a call to a service that Brad is running to fetch the content to be included on your page. The script inserts this content into the inner html of the element.</p>
<p>The content is of the class .included and .includeok. I have styled .included in the dark gray that you see instead of the normal silver that I am using for blockquotes, so you can see the change in color as the content is inserted.
</li>
<li>
Brad is running the service that the javascript calls. This service is doing the xpath queries on the content of the referenced page to get the returned content.
</li>
</ol>
<p>This is an interesting design. When I read about it, the first thing that I thought about was caching of the content.  In my examples, I referenced my own pages, as Brad referenced his in his examples. I am sure that if you can read these pages, then Brad&#8217;s service can read the referenced pages. I&#8217;m probably not going to change the pages that I referenced, but I could.</p>
<p>This could be either a good thing, or a bad thing depending on your purposes. The bad is that the exact elements on a page are subject to change. The sixth paragraph of my Jacob&#8217;s post could become the seventh or the fifth if I changed blog templates, or fixed a typo in the post. When including content from another site, all bets are off. Also, the remote server could be off line or inaccessible. Brad could add a cache to his service so that any given xpath element of a referenced url from a specific referrer would return the cached result. There would need to be some way to clear the cache, but see below.</p>
<p>On the other hand, this could be just what you want. This is a way to add dynamic content directly to your page, and you don&#8217;t need to worry about updating. For many purposes, having a remote server off line isn&#8217;t that big a deal and you are likely to be dealing with more fixed markup than I see on my blog pages. A properly scoped xpath query could pull out exactly what you want from most sites.</p>
<p>A couple of other little things that I came across while playing with this. </p>
<p>You can&#8217;t include the same exact url (including xpath parameters) twice. The script uses a hash to map from urls to elements. The server returns the content, the url, and an error and looks up the element in the hash by url. Here is the first of Rumsfeld&#8217;s pithy sayings from above:</p>
<blockquote href="http://www.warmroom.com/yesterdays/2006/11/08/rumsfelds-rules/#xpath(//div[@class='entry']//li[1])"></blockquote>
<p>And here it is again:</p>
<blockquote href="http://www.warmroom.com/yesterdays/2006/11/08/rumsfelds-rules/#xpath(//div[@class='entry']//li[1])"></blockquote>
<p>Only the second appears; the first is just the roller gif. (You can also see that the styling is different.) This is a bug, or at least an unanticipated use case. You can work around by referring to a non-existent query parameter, so urls</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">href=&quot;http://www.warmroom.com/yesterdays/2006/11/08/rumsfelds-rules/?1#xpath(//div[@class='entry']//li[1])&quot;</pre></div></div>

<p>and</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">href=&quot;http://www.warmroom.com/yesterdays/2006/11/08/rumsfelds-rules/?2#xpath(//div[@class='entry']//li[2])&quot;</pre></div></div>

<p>Produce</p>
<blockquote href="http://www.warmroom.com/yesterdays/2006/11/08/rumsfelds-rules/?1#xpath(//div[@class='entry']//li[1])"></blockquote>
<p>and</p>
<blockquote href="http://www.warmroom.com/yesterdays/2006/11/08/rumsfelds-rules/?2#xpath(//div[@class='entry']//li[1])"></blockquote>
<p>respectively.</p>
<p>Finally, the href attribute isn&#8217;t valid with any of p, blockquote, q, pre, div, or span in either html 4 or xhtml. This page is <a href="http://validator.w3.org/check/referer">invalid</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://67central.com/bc/2007/08/20/purple-include/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Marcus Bains Line</title>
		<link>http://67central.com/bc/2007/06/05/marcus-bains-line/</link>
		<comments>http://67central.com/bc/2007/06/05/marcus-bains-line/#comments</comments>
		<pubDate>Tue, 05 Jun 2007 08:34:33 +0000</pubDate>
		<dc:creator>yesteray</dc:creator>
		
		<category><![CDATA[Calendar]]></category>

		<category><![CDATA[Visual Elements]]></category>

		<guid isPermaLink="false">http://www.warmroom.com/cornercases/marcus-bains-line</guid>
		<description><![CDATA[A useful visual element that can be added to an online calendar is the Marcus Bains Line. Here is a reference and an example.
The line indicates the current time on a daily calendar.
]]></description>
			<content:encoded><![CDATA[<p>A useful visual element that can be added to an online calendar is the Marcus Bains Line. <a href="http://people.csail.mit.edu/rahimi/marcus-bains-line/">Here</a> is a reference and an example.</p>
<p>The line indicates the current time on a daily calendar.</p>
]]></content:encoded>
			<wfw:commentRss>http://67central.com/bc/2007/06/05/marcus-bains-line/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Limitation on Recurring Events in Google Calendar</title>
		<link>http://67central.com/bc/2007/06/05/limitation-on-recurring-events-in-google-calendar/</link>
		<comments>http://67central.com/bc/2007/06/05/limitation-on-recurring-events-in-google-calendar/#comments</comments>
		<pubDate>Tue, 05 Jun 2007 07:45:09 +0000</pubDate>
		<dc:creator>yesteray</dc:creator>
		
		<category><![CDATA[Calendar]]></category>

		<category><![CDATA[GData]]></category>

		<guid isPermaLink="false">http://www.warmroom.com/cornercases/limitation-on-recurring-events-in-google-calendar</guid>
		<description><![CDATA[Trying to plan a calendar for a group I belong to, I found an old thread from Jeremy with many useful links to the state of calendar solution in early 2005. 
One interesting link that I found in the comments was this post from Denka, who points out the Google&#8217;s Calendar implementation is hobbled by [...]]]></description>
			<content:encoded><![CDATA[<p>Trying to plan a calendar for a group I belong to, I found an old <a href="http://jeremy.zawodny.com/blog/archives/004282.html">thread</a> from Jeremy with many useful links to the state of calendar solution in early 2005. </p>
<p>One interesting link that I found in the comments was <a href="http://me-techie.blogspot.com/2006/04/google-calendar-why-did-it-take-so.html">this</a> post from Denka, who points out the Google&#8217;s Calendar implementation is hobbled by patents. In particular, the display of an event is limited in both Google&#8217;s online calendar, or in the xml feed from that calendar, if single events are requested. (singleevents=true is a query parameter in the GData API that expands recurrent events to single events.)</p>
<p>For instance, I created a calendar with a single event that recurs every day, beginning on June 9th, 2007. Using the web interface to the calendar, the last day that this recurring event appears is June 7th, 2008. There are exactly 365 recurrences of the event (2008 is a leap year). You can see the calendar <a href="http://www.google.com/calendar/embed?src=1durhf5pmv4jt7uk35ipo025jc%40group.calendar.google.com&#038;dates=20080601%2F20080701">here</a>, although it will be interesting to see what happens after June 9th passes. </p>
<p>I see the same behavior in the xml <a href="http://www.google.com/calendar/feeds/1durhf5pmv4jt7uk35ipo025jc%40group.calendar.google.com/public/basic?singleevents=true&#038;max-results=400">feed</a> for the calendar. Note that that feed url has the appended query parameters singleevents=true and max-results=400. Also note that Google has used two different styles for creating parameters from compound phrases. </p>
<p>I manually pulled the results from that feed 6 times to figure out what the restrictions were. Here are the resulting file sizes using wget:</p>
<pre><code>-rw-r--r--   1 ray  wheel   36418 Jun  5 01:06 basic?singleevents=true
-rw-r--r--   1 ray  wheel  419435 Jun  5 01:06 basic?singleevents=true&amp;max-results=300
-rw-r--r--   1 ray  wheel  507095 Jun  5 01:06 basic?singleevents=true&amp;max-results=364
-rw-r--r--   1 ray  wheel  508280 Jun  5 01:06 basic?singleevents=true&amp;max-results=365
-rw-r--r--   1 ray  wheel  508280 Jun  5 01:06 basic?singleevents=true&amp;max-results=366
-rw-r--r--   1 ray  wheel  508280 Jun  5 01:06 basic?singleevents=true&amp;max-results=400
</code></pre>
<p>Once you have 365 instances of the recurring event in the feed, you don&#8217;t get any more data no matter how many you request.</p>
<p>Interestingly, the ics feed doesn&#8217;t have this problem and neither would the xml feed if I weren&#8217;t using the singleevents parameter. You get a single event with a start, and no end. The xml feed actually contains the VEVENT recurrence data.</p>
<p>Denka says that Microsoft has sewn up the patents in this area so Google had to treat recurrent events this way. </p>
<p><strong>[Update: 2007-07-02]</strong> After June 9th passed, nothing changed. Both the feed and the web have only the same 365 events. There are no events after June 7, 2008. You can see this very clearly if you add the start-min parameter to the query string, as in <a href="http://www.google.com/calendar/feeds/1durhf5pmv4jt7uk35ipo025jc%40group.calendar.google.com/private-8a60a56de770ffc06b3d9f172330a9c8/basic?singleevents=true&#038;start-min=2008-06-08">this link</a> which returns no results. Interestingly the date stamp on the returned file is June 5, the last day that I modified the calendar.</p>
<pre><code>
-rw-r--r--   1 ray  wheel  1530 Jun  5 01:41 basic?singleevents=true&amp;start-min=2008-06-08
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://67central.com/bc/2007/06/05/limitation-on-recurring-events-in-google-calendar/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
