<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>VV&#039;s Corner &#187; google api</title>
	<atom:link href="http://vinoaj.com/blog/category/howtos/google-api-gdata/feed/" rel="self" type="application/rss+xml" />
	<link>http://vinoaj.com/blog</link>
	<description>my collection of random thoughts, how-to&#039;s and code snippets</description>
	<lastBuildDate>Sat, 04 Dec 2010 15:05:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Consuming a GData Calendar feed</title>
		<link>http://vinoaj.com/blog/2007/04/consuming-a-gdata-calendar-feed/</link>
		<comments>http://vinoaj.com/blog/2007/04/consuming-a-gdata-calendar-feed/#comments</comments>
		<pubDate>Sun, 08 Apr 2007 01:04:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[google api]]></category>

		<guid isPermaLink="false">http://vinoaj.com/blog/howtos/google-api-gdata/consuming-a-gdata-calendar-feed/</guid>
		<description><![CDATA[If you have successfully obtained a calendar feed, you should receive some XML looking like this PLAIN TEXT XML: &#60;default:feed&#62; &#160; &#160; &#60;default:id&#62;http://www.google.com/calendar/feeds/vinoajtest%40gmail.com/public/basic&#60;/default:id&#62; &#160; &#160; &#60;default:updated&#62;2007-04-08T03:38:29.000Z&#60;/default:updated&#62; &#160; &#160; &#60;default:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#event"/&#62; &#160; &#160; &#60;default:title type="text"&#62;Vinoaj Vijeyakumaar&#60;/default:title&#62; &#160; &#160; &#60;default:subtitle type="text"&#62;Vinoaj Vijeyakumaar&#60;/default:subtitle&#62; &#160; &#160; &#60;default:link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.google.com/calendar/feeds/vinoajtest%40gmail.com/public/basic"/&#62; &#160; &#160; &#60;default:link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/vinoajtest%40gmail.com/public/basic?max-results=25"/&#62; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>If you have successfully obtained a calendar feed, you should receive some XML looking like this</p>
<div class="igBar"><span id="lxml-4"><a href="#" onclick="javascript:showPlainTxt('xml-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-4">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:feed<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:id<span style="font-weight: bold; color: black;">&gt;</span></span>http://www.google.com/calendar/feeds/vinoajtest%40gmail.com/public/basic<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/default</span>:id<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:updated<span style="font-weight: bold; color: black;">&gt;</span></span>2007-04-08T03:38:29.000Z<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/default</span>:updated<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:category <span style="color: #000066;">scheme</span>=<span style="color: #ff0000;">"http://schemas.google.com/g/2005#kind"</span> <span style="color: #000066;">term</span>=<span style="color: #ff0000;">"http://schemas.google.com/g/2005#event"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:title <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Vinoaj Vijeyakumaar<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/default</span>:title<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:subtitle <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Vinoaj Vijeyakumaar<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/default</span>:subtitle<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:link <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">"http://schemas.google.com/g/2005#feed"</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/vinoajtest%40gmail.com/public/basic"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:link <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/vinoajtest%40gmail.com/public/basic?max-results=25"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:author<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:name<span style="font-weight: bold; color: black;">&gt;</span></span>Vinoaj Vijeyakumaar<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/default</span>:name<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:email<span style="font-weight: bold; color: black;">&gt;</span></span>vinoajtest@gmail.com<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/default</span>:email<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/default</span>:author<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:generator <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">"http://www.google.com/calendar"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Google Calendar<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/default</span>:generator<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;openSearch</span>:totalResults<span style="font-weight: bold; color: black;">&gt;</span></span>1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/openSearch</span>:totalResults<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;openSearch</span>:startIndex<span style="font-weight: bold; color: black;">&gt;</span></span>1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/openSearch</span>:startIndex<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;openSearch</span>:itemsPerPage<span style="font-weight: bold; color: black;">&gt;</span></span>25<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/openSearch</span>:itemsPerPage<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;gCal</span>:timezone <span style="color: #000066;">value</span>=<span style="color: #ff0000;">"Australia/Sydney"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:entry<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:id<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; http://www.google.com/calendar/feeds/vinoajtest%40gmail.com/public/basic/12ps2qhasoejgtf8uo89des4f0</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/default</span>:id<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:published<span style="font-weight: bold; color: black;">&gt;</span></span>2007-04-08T03:35:52.000Z<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/default</span>:published<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:updated<span style="font-weight: bold; color: black;">&gt;</span></span>2007-04-08T03:36:23.000Z<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/default</span>:updated<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:category <span style="color: #000066;">scheme</span>=<span style="color: #ff0000;">"http://schemas.google.com/g/2005#kind"</span> <span style="color: #000066;">term</span>=<span style="color: #ff0000;">"http://schemas.google.com/g/2005#event"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:summary <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"html"</span><span style="font-weight: bold; color: black;">&gt;</span></span>When: Mon Apr 9, 2007<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;br<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/default</span>:summary<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:link <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=MTJwczJxaGFzb2VqZ3RmOHVvODlkZXM0ZjAgdmlub2FqdGVzdEBt"</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">"alternate"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>:link <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/vinoajtest%40gmail.com/public/basic/12ps2qhasoejgtf8uo89des4f0"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/default</span>:entry<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/default</span>:feed<span style="font-weight: bold; color: black;">&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>A fully-formed private event looks something like this</p>
<div class="igBar"><span id="lxml-5"><a href="#" onclick="javascript:showPlainTxt('xml-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-5">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;entry<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;id<span style="font-weight: bold; color: black;">&gt;</span></span></span>http://www.google.com/calendar/feeds/vinoajtest%40gmail.com/private/full/12ps2qhasoejgtf8uo89des4f0<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/id<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;published<span style="font-weight: bold; color: black;">&gt;</span></span></span>2007-04-08T03:35:52.000Z<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/published<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;updated<span style="font-weight: bold; color: black;">&gt;</span></span></span>2007-04-08T03:36:23.000Z<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/updated<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;category</span> <span style="color: #000066;">scheme</span>=<span style="color: #ff0000;">"http://schemas.google.com/g/2005#kind"</span> <span style="color: #000066;">term</span>=<span style="color: #ff0000;">"http://schemas.google.com/g/2005#event"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;title</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Easter Monday<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/title<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;content</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&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=MTJwczJxaGFzb2VqZ3RmOHVvODlkZXM0ZjAgdmlub2FqdGVzdEBt"</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">"alternate"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&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/vinoajtest%40gmail.com/private/full/12ps2qhasoejgtf8uo89des4f0"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;author<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;name<span style="font-weight: bold; color: black;">&gt;</span></span></span>Vinoaj Vijeyakumaar<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/name<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;email<span style="font-weight: bold; color: black;">&gt;</span></span></span>vinoajtest@gmail.com<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/email<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/author<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;gd</span>:visibility <span style="color: #000066;">value</span>=<span style="color: #ff0000;">"http://schemas.google.com/g/2005#event.public"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;gCal</span>:sendEventNotifications <span style="color: #000066;">value</span>=<span style="color: #ff0000;">"false"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;gd</span>:transparency <span style="color: #000066;">value</span>=<span style="color: #ff0000;">"http://schemas.google.com/g/2005#event.transparent"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;gd</span>:comments<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;gd</span>:feedLink <span style="color: #000066;">href</span>=<span style="color: #ff0000;">"http://www.google.com/calendar/feeds/vinoajtest%40gmail.com/private/full/12ps2qhasoejgtf8uo89des4f0/comments"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/gd</span>:comments<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;gd</span>:eventStatus <span style="color: #000066;">value</span>=<span style="color: #ff0000;">"http://schemas.google.com/g/2005#event.confirmed"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;gd</span>:where<span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;gd</span>:when <span style="color: #000066;">startTime</span>=<span style="color: #ff0000;">"2007-04-09"</span> <span style="color: #000066;">endTime</span>=<span style="color: #ff0000;">"2007-04-10"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;gd</span>:reminder <span style="color: #000066;">minutes</span>=<span style="color: #ff0000;">"10"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/gd</span>:when<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/entry<span style="font-weight: bold; color: black;">&gt;</span></span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<hr />
<p>The following steps show you how to grab a feed using Zend Framework's GData package and then grab the appropriate values.</p>
<div class="igBar"><span id="lphp-6"><a href="#" onclick="javascript:showPlainTxt('php-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-6">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Initiate an authorised http client</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//See previous post on how to get an auth token and convert it to a session token</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$client</span> = Zend_Gdata_AuthSub::<span style="color:#006600;">getHttpClient</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$authToken</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Instantiate a new GData Calendar instance + set the identifiers and parameters</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$gdata_cal</span> = <span style="color:#000000; font-weight:bold;">new</span> Zend_Gdata_Calendar<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$client</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$gdata_cal</span>-&gt;<span style="color:#006600;">setUser</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'vinoajtest@gmail.com'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$gdata_cal</span>-&gt;<span style="color:#006600;">setVisibility</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'private'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$gdata_cal</span>-&gt;<span style="color:#006600;">setProjection</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'full'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Returns an atom feed object represented by Zend_Feed_Atom</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//The Zend_Feed_Atom object is an extension of DOMDocument</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Call Zend_Feed_Atom::saveXML() to acquire a fully-formed DOMDocument at any time</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$gdata_cal_feed</span> = <span style="color:#0000FF;">$gdata_cal</span>-&gt;<span style="color:#006600;">getCalendarFeed</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Let's spit out some basic FEED information</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$n_entries</span> &nbsp;= <span style="color:#0000FF;">$gdata_cal_feed</span>-&gt;<span style="color:#006600;">count</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; <span style="color:#FF9933; font-style:italic;">//int</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$feed_title</span> = <span style="color:#0000FF;">$gdata_cal_feed</span>-&gt;<span style="color:#006600;">title</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp;<span style="color:#FF9933; font-style:italic;">//str</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$feed_id</span> &nbsp; &nbsp;= <span style="color:#0000FF;">$gdata_cal_feed</span>-&gt;<span style="color:#006600;">id</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp;<span style="color:#FF9933; font-style:italic;">//str url</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$feed_links</span> = <span style="color:#0000FF;">$gdata_cal_feed</span>-&gt;<span style="color:#006600;">link</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; <span style="color:#FF9933; font-style:italic;">//array links</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$feed_links</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$ix</span> =&gt; <span style="color:#0000FF;">$link</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//Each item is of type DOMElement</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$link_rel</span>&nbsp; = <span style="color:#0000FF;">$link</span>-&gt;<span style="color:#006600;">getAttribute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'rel'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$link_type</span> = <span style="color:#0000FF;">$link</span>-&gt;<span style="color:#006600;">getAttribute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'type'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$link_href</span> = <span style="color:#0000FF;">$link</span>-&gt;<span style="color:#006600;">getAttribute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'href'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$feed_subtitle</span> &nbsp;&nbsp;= <span style="color:#0000FF;">$gdata_cal_feed</span>-&gt;<span style="color:#006600;">subtitle</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//Equivalent to a RSS' channel description</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$feed_author_name</span> &nbsp; = <span style="color:#0000FF;">$gdata_cal_feed</span>-&gt;<span style="color:#006600;">author</span>-&gt;<span style="color:#006600;">name</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//str</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$feed_author_email</span> &nbsp;= <span style="color:#0000FF;">$gdata_cal_feed</span>-&gt;<span style="color:#006600;">author</span>-&gt;<span style="color:#006600;">email</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; <span style="color:#FF9933; font-style:italic;">//str email</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Now lets's spit out ENTRIES and their information</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$gdata_cal_feed</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$ix</span> =&gt; <span style="color:#0000FF;">$cal_entry</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_id</span> &nbsp; &nbsp; &nbsp; &nbsp; = <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600;">id</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#FF9933; font-style:italic;">//str url</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_title</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600;">title</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//str</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_author</span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;= <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600;">author</span>-&gt;<span style="color:#006600;">name</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; <span style="color:#FF9933; font-style:italic;">//str</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_content</span>&nbsp; &nbsp; &nbsp; = <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600;">content</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//str</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_email</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600;">author</span>-&gt;<span style="color:#006600;">email</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; <span style="color:#FF9933; font-style:italic;">//str email</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_published</span> &nbsp; &nbsp;&nbsp; &nbsp;= <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600;">published</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp;&nbsp;<span style="color:#FF9933; font-style:italic;">//str date</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_updated</span> &nbsp;&nbsp;&nbsp;= <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600;">updated</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp;&nbsp;<span style="color:#FF9933; font-style:italic;">//str date</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_summary</span> &nbsp;&nbsp;&nbsp;= <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600;">summary</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp;&nbsp;<span style="color:#FF9933; font-style:italic;">//str</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_visibility</span>&nbsp; &nbsp;&nbsp; &nbsp;= <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#FF0000;">'gd:visibility'</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'value'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;&nbsp; <span style="color:#FF9933; font-style:italic;">//str bool</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_sendeventnotify</span> &nbsp;= <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#FF0000;">'gCal:sendEventNotifications'</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'value'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_transparency</span> &nbsp; &nbsp; = <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#FF0000;">'gd:transparency'</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'value'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;&nbsp;<span style="color:#FF9933; font-style:italic;">//str</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_event_status</span>&nbsp;&nbsp;= <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#FF0000;">'gd:eventStatus'</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'value'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;&nbsp; &nbsp;<span style="color:#FF9933; font-style:italic;">//str</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_where</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#FF0000;">'gd:where'</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'valueString'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;&nbsp; <span style="color:#FF9933; font-style:italic;">//str</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_starttime</span>&nbsp; &nbsp; &nbsp; &nbsp; = <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#FF0000;">'gd:when'</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'startTime'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;&nbsp;&nbsp;<span style="color:#FF9933; font-style:italic;">//str date</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_endtime</span>&nbsp; &nbsp; &nbsp; = <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#FF0000;">'gd:when'</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'endTime'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;&nbsp;&nbsp;<span style="color:#FF9933; font-style:italic;">//str date</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_reminder_mins</span>&nbsp; &nbsp; = <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#FF0000;">'gd:when'</span><span style="color:#006600; font-weight:bold;">&#125;</span>-&gt;<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#FF0000;">'gd:reminder'</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'minutes'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;&nbsp; <span style="color:#FF9933; font-style:italic;">//str mins</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_commentsfeedlink</span>&nbsp;= <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#FF0000;">'gd:comments'</span><span style="color:#006600; font-weight:bold;">&#125;</span>-&gt;<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#FF0000;">'gd:feedLink'</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'href'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;&nbsp; <span style="color:#FF9933; font-style:italic;">//str url</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_links</span> = <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600;">link</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$cal_entry_links</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$ix</span> =&gt; <span style="color:#0000FF;">$entry_link</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$entry_link_rel</span>&nbsp;&nbsp;= <span style="color:#0000FF;">$entry_link</span>-&gt;<span style="color:#006600;">getAttribute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'rel'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//str</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$entry_link_type</span>&nbsp; &nbsp; = <span style="color:#0000FF;">$entry_link</span>-&gt;<span style="color:#006600;">getAttribute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'type'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//str</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$entry_link_href</span>&nbsp; &nbsp; = <span style="color:#0000FF;">$entry_link</span>-&gt;<span style="color:#006600;">getAttribute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'href'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//str url</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$entry_link_title</span> &nbsp; = <span style="color:#0000FF;">$entry_link</span>-&gt;<span style="color:#006600;">getAttribute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'title'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp;<span style="color:#FF9933; font-style:italic;">//str</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//category</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_category</span> = <span style="color:#0000FF;">$cal_entry</span>-&gt;<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#FF0000;">'category'</span><span style="color:#006600; font-weight:bold;">&#125;</span>;&nbsp;<span style="color:#FF9933; font-style:italic;">//Type Zend_Feed_Entry</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_category_dom</span> = <span style="color:#0000FF;">$cal_entry_category</span>-&gt;<span style="color:#006600;">getDOM</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; <span style="color:#FF9933; font-style:italic;">//Convert it to a DOM element so we can read off the attributes</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_category_scheme</span> &nbsp;= <span style="color:#0000FF;">$cal_entry_category_dom</span>-&gt;<span style="color:#006600;">getAttribute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'scheme'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$cal_entry_category_term</span> &nbsp; &nbsp;= <span style="color:#0000FF;">$cal_entry_category_dom</span>-&gt;<span style="color:#006600;">getAttribute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'term'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://vinoaj.com/blog/2007/04/consuming-a-gdata-calendar-feed/&via=vinoaj&text=Consuming a GData Calendar feed&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://vinoaj.com/blog/2007/04/consuming-a-gdata-calendar-feed/&via=vinoaj&text=Consuming a GData Calendar feed&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fvinoaj.com%2Fblog%2F2007%2F04%2Fconsuming-a-gdata-calendar-feed%2F&amp;title=Consuming%20a%20GData%20Calendar%20feed" id="wpa2a_2"><img src="http://vinoaj.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://vinoaj.com/blog/2007/04/consuming-a-gdata-calendar-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Authenticating for Google and GData</title>
		<link>http://vinoaj.com/blog/2007/04/authenticating-for-google-and-gdata/</link>
		<comments>http://vinoaj.com/blog/2007/04/authenticating-for-google-and-gdata/#comments</comments>
		<pubDate>Sat, 07 Apr 2007 09:51:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[google api]]></category>

		<guid isPermaLink="false">http://vinoaj.com/blog/howtos/google-api-gdata/authenticating-for-google-and-gdata/</guid>
		<description><![CDATA[Making changes to your data and accessing private data will require the passing of an authentication token with your requests. You need to make use of the AuthSub Interface to acquire a token. Acquiring and manipulating tokens The workflow of the AuthSub authentication process is nicely summarised by Google: AuthSubRequest - Request an authentication token [...]]]></description>
			<content:encoded><![CDATA[<p>Making changes to your data and accessing private data will require the passing of an authentication token with your requests.  You need to make use of the <a href="http://code.google.com/apis/accounts/AuthForWebApps.html" target="_blank">AuthSub Interface</a> to acquire a token.</p>
<p><strong>Acquiring and manipulating tokens</strong><br />
The workflow of the AuthSub authentication process is nicely summarised by Google:<br />
<img src="http://code.google.com/apis/accounts/Authsub_diagram.png" title="AuthSub workflow" alt="AuthSub workflow" /></p>
<p><strong>AuthSubRequest - Request an authentication token</strong></p>
<div class="igBar"><span id="lphp-16"><a href="#" onclick="javascript:showPlainTxt('php-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-16">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Once the request is authenticated, AuthSub will redirect the user to this page.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$callback_url</span> = <a href="http://www.php.net/urlencode"><span style="color:#000066;">urlencode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'&lt;a href=&quot;http://www.mysite.com/calendar.php&quot; class=&quot;linkification-ext&quot; title=&quot;Linkification: http://www.mysite.com/calendar.php&quot;&gt;http://www.mysite.com/calendar.php&lt;/a&gt;'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Indicate for which objects or scope you wish to be authenticated for</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$scope</span> = <a href="http://www.php.net/urlencode"><span style="color:#000066;">urlencode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'&lt;a href=&quot;http://www.google.com/calendar/feeds/yourgoogleacct%40gmail.com/private/full&quot; class=&quot;linkification-ext&quot; title=&quot;Linkification: http://www.google.com/calendar/feeds/yourgoogleacct%40gmail.com/private/full&quot;&gt;http://www.google.com/calendar/feeds/yourgoogleacct%40gmail.com/private/full&lt;/a&gt;'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Set to 1 if you have a registered application and wish to issue a secure token</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$secure</span> = <span style="color:#CC66CC;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//1 - the one-time-use token may be exchanged for a session token; 0 - cannot be exchanged</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$session</span> = <span style="color:#CC66CC;color:#800000;">1</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Call the URL:</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$url</span> = <span style="color:#FF0000;">"&lt;a href="</span>https:<span style="color:#FF9933; font-style:italic;">//www.google.com/accounts/AuthSubRequest?next=$callback_url&amp;amp;scope=$scope&amp;amp;secure=$secure&amp;amp;session=$session&quot; class=&quot;linkification-ext&quot; title=&quot;Linkification: https://www.google.com/accounts/AuthSubRequest?next=$callback_url&amp;amp;scope=$scope&amp;amp;secure=$secure&amp;amp;session=$session&quot;&gt;https://www.google.com/accounts/AuthSubRequest?next=$callback_url&amp;amp;scope=$scope&amp;amp;secure=$secure&amp;amp;session=$session&lt;/a&gt;&quot;);</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Location: '</span> . <span style="color:#0000FF;">$url</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/exit"><span style="color:#000066;">exit</span></a>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The user will be taken to a login screen hosted on Google's end, where they will have to provide their credentials.  If successful, they will be redirected back to the callback URL with a 'token' parameter in the URL's query string.</p>
<div class="igBar"><span id="lphp-17"><a href="#" onclick="javascript:showPlainTxt('php-17'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-17">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$authsub_token</span> = <span style="color:#0000FF;">$_GET</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'token'</span><span style="color:#006600; font-weight:bold;">&#93;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>AuthSubSessionToken - acquire a session token</strong><br />
The token returned above is for one-time-use.  If you are going to be making multiple token requests, it is more efficient to convert the one-time-use token to a long-lived session token.</p>
<p>Call AuthSubSessionToken using an HTTP GET request to <code><a href="https://www.google.com/accounts/AuthSubSessionToken" class="linkification-ext" title="Linkification: https://www.google.com/accounts/AuthSubSessionToken">https://www.google.com/accounts/AuthSubSessionToken</a></code>.  The request must also contain an Authorization header.</p>
<div class="igBar"><span id="lphp-18"><a href="#" onclick="javascript:showPlainTxt('php-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-18">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Authorization: AuthSub token=&quot;'</span> . <span style="color:#0000FF;">$token</span> . <span style="color:#FF0000;">'&quot;'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>If the request is successful, Google responds with an HTTP 200 message. The response header will contain the token in the form<br />
<code>Token=ASDF...8976</code></p>
<p><strong>AuthSubTokenInfo - check the status of a given token</strong><br />
You can check on the status of a token by making an HTTP GET request to <code><a href="https://www.google.com/accounts/AuthSubTokenInfo" class="linkification-ext" title="Linkification: https://www.google.com/accounts/AuthSubTokenInfo">https://www.google.com/accounts/AuthSubTokenInfo</a></code>. The request must also contain an Authorization header.</p>
<div class="igBar"><span id="lphp-19"><a href="#" onclick="javascript:showPlainTxt('php-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-19">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Authorization: AuthSub token=&quot;'</span> . <span style="color:#0000FF;">$token</span> . <span style="color:#FF0000;">'&quot;'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The successful HTTP 200 response will give you 3 pieces of key information:</p>
<p><code><br />
Target=<a href="http://www.mysite.com" class="linkification-ext" title="Linkification: http://www.mysite.com">http://www.mysite.com</a><br />
Scope=<a href="http://www.google.com/calendar/feeds/yourgoogleacct%40gmail.com/private/full" class="linkification-ext" title="Linkification: http://www.google.com/calendar/feeds/yourgoogleacct%40gmail.com/private/full">http://www.google.com/calendar/feeds/yourgoogleacct%40gmail.com/private/full</a><br />
Secure=true<br />
</code></p>
<p><strong>AuthSubRevokeToken - revoke an active token</strong><br />
At the time of writing, session tokens do not have an expiration time.  There may be cases (e.g. security has been compromised, user no longer wishes to use your service) where you wish to revoke a token.</p>
<p>Make an HTTP GET request to <code><a href="https://www.google.com/accounts/AuthSubRevokeToken" class="linkification-ext" title="Linkification: https://www.google.com/accounts/AuthSubRevokeToken">https://www.google.com/accounts/AuthSubRevokeToken</a></code>. The request must also contain an Authorization header.</p>
<div class="igBar"><span id="lphp-20"><a href="#" onclick="javascript:showPlainTxt('php-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-20">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Authorization: AuthSub token=&quot;'</span> . <span style="color:#0000FF;">$token</span> . <span style="color:#FF0000;">'&quot;'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>If the request is successful you will receive an HTTP 200 message.</p>
<p><strong>Things to keep in mind</strong><br />
At the time of writing, Google will only issue 10 session tokens per site per scope.  This means you should keep track of, via a database, your users' tokens.  They can be re-used each time the user logs in to your application.  If you do not wish to store your users' tokens, and wish them to reauthenticate with Google each time they visit your application, be sure to revoke the tokens whenever they log our or if there is a period of inactivity.</p>
<hr />
<p><b>Using the Zend Framework</b></p>
<p><a href="http://framework.zend.com/manual/en/zend.gdata.authsub.html" target="_blank">More comprehensive examples and explanations are available here.</a></p>
<p><b>AuthSubRequest</b></p>
<div class="igBar"><span id="lphp-21"><a href="#" onclick="javascript:showPlainTxt('php-21'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-21">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$scope</span> = <span style="color:#FF0000;">'http://www.google.com/calendar/feeds/yourgoogleacct%40gmail.com/private/full'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$callback_url</span> = <a href="http://www.php.net/urlencode"><span style="color:#000066;">urlencode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'http://www.mysite.com/calendar.php'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$secure</span> = <span style="color:#CC66CC;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$session</span> = <span style="color:#CC66CC;color:#800000;">1</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$googleURI</span> = Zend_Gdata_AuthSub::<span style="color:#006600;">getAuthSubTokenUri</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$callback_url</span>, <span style="color:#0000FF;">$scope</span>, <span style="color:#0000FF;">$secure</span>, <span style="color:#0000FF;">$session</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&lt;a href=<span style="color:#000099; font-weight:bold;">\"</span>$googleURI<span style="color:#000099; font-weight:bold;">\"</span>&gt;Click here to authorise this application to access your calendar&lt;/a&gt;"</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><b>AuthSubToken</b></p>
<div class="igBar"><span id="lphp-22"><a href="#" onclick="javascript:showPlainTxt('php-22'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-22">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$session_token</span> = Zend_Gdata_AuthSub::<span style="color:#006600;">getAuthSubSessionToken</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$token</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Making use of your token</p>
<div class="igBar"><span id="lphp-23"><a href="#" onclick="javascript:showPlainTxt('php-23'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-23">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Once you have the token you can create an authenticated HTTP Client to communicate with Google</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$client</span> = Zend_Gdata_AuthSub::<span style="color:#006600;">getHttpClient</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$token</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Create a Gdata object using the authenticated client</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$cal</span> = <span style="color:#000000; font-weight:bold;">new</span> Zend_Gdata_Calendar<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$client</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><b>AuthSubRevokeToken</b></p>
<div class="igBar"><span id="lphp-24"><a href="#" onclick="javascript:showPlainTxt('php-24'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-24">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Zend_Gdata_AuthSub::<span style="color:#006600;">AuthSubRevokeToken</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$token</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://vinoaj.com/blog/2007/04/authenticating-for-google-and-gdata/&via=vinoaj&text=Authenticating for Google and GData&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://vinoaj.com/blog/2007/04/authenticating-for-google-and-gdata/&via=vinoaj&text=Authenticating for Google and GData&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fvinoaj.com%2Fblog%2F2007%2F04%2Fauthenticating-for-google-and-gdata%2F&amp;title=Authenticating%20for%20Google%20and%20GData" id="wpa2a_4"><img src="http://vinoaj.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://vinoaj.com/blog/2007/04/authenticating-for-google-and-gdata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with Google Data (GData) services using the Zend Framework &#8211; setting up the framework</title>
		<link>http://vinoaj.com/blog/2007/04/working-with-google-data-gdata-services-using-the-zend-framework-setting-up-the-framework/</link>
		<comments>http://vinoaj.com/blog/2007/04/working-with-google-data-gdata-services-using-the-zend-framework-setting-up-the-framework/#comments</comments>
		<pubDate>Sat, 07 Apr 2007 09:01:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[google api]]></category>

		<guid isPermaLink="false">http://vinoaj.com/blog/howtos/google-api-gdata/working-with-google-data-gdata-services-using-the-zend-framework-setting-up-the-framework/</guid>
		<description><![CDATA[The Zend Framework provides a PHP client library package that allows for easy interaction with GData services. Setting up your application to work with the package is simple. Download a copy of the Zend Framework from: http://framework.zend.com/download/tgz Unzip the contents to a folder that will house the Zend library. Note that to have a functioning [...]]]></description>
			<content:encoded><![CDATA[<p>The Zend Framework provides a PHP client library package that allows for easy interaction with GData services.  Setting up your application to work with the package is simple.</p>
<ol>
<li>Download a copy of the Zend Framework from: <a href="http://framework.zend.com/download/tgz" target="_blank">http://framework.zend.com/download/tgz</a></li>
<li>Unzip the contents to a folder that will house the Zend library.  Note that to have a functioning Zend framework, you only need the contents of the <code>/library/</code> folder.</li>
<li>The library needs to be accessible via PHP's path.  You can either set that in php.ini or within your script like so:
<div class="igBar"><span id="lphp-26"><a href="#" onclick="javascript:showPlainTxt('php-26'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-26">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/set_include_path"><span style="color:#000066;">set_include_path</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'/path/to/Zend/library/'</span> . PATH_SEPARATOR . <a href="http://www.php.net/get_include_path"><span style="color:#000066;">get_include_path</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></li>
</ol>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://vinoaj.com/blog/2007/04/working-with-google-data-gdata-services-using-the-zend-framework-setting-up-the-framework/&via=vinoaj&text=Working with Google Data (GData) services using the Zend Framework - setting up the framework&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://vinoaj.com/blog/2007/04/working-with-google-data-gdata-services-using-the-zend-framework-setting-up-the-framework/&via=vinoaj&text=Working with Google Data (GData) services using the Zend Framework - setting up the framework&related=:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fvinoaj.com%2Fblog%2F2007%2F04%2Fworking-with-google-data-gdata-services-using-the-zend-framework-setting-up-the-framework%2F&amp;title=Working%20with%20Google%20Data%20%28GData%29%20services%20using%20the%20Zend%20Framework%20%E2%80%93%20setting%20up%20the%20framework" id="wpa2a_6"><img src="http://vinoaj.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://vinoaj.com/blog/2007/04/working-with-google-data-gdata-services-using-the-zend-framework-setting-up-the-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

