Sample express app which uses Google GData API

This commit is contained in:
neyric
2011-02-26 15:02:21 +01:00
parent 15f06f254f
commit 8050d82019
4 changed files with 197 additions and 0 deletions

View File

@ -0,0 +1,21 @@
<p><a href="/google_contacts">Check google_contacts</a></p>
<h1>Google Calendars</h1>
<% for(var i = 0 ; i < feed.data.items.length ; i++ ) {
var calendar = feed.data.items[i]; %>
<div>
<h2 style="color:white;background-color:<%= calendar["color"] %>"><%= calendar["title"] %></h2>
<p>canEdit: <%= calendar["canEdit"] %></p>
<p>accessLevel: <%= calendar["accessLevel"] %></p>
<p>timeZone: <%= calendar["timeZone"] %></p>
<p>kind: <%= calendar["kind"] %></p>
<p>updated: <%= calendar["updated"] %></p>
<p>created: <%= calendar["created"] %></p>
</div>
<% } %>

View File

@ -0,0 +1,24 @@
<p><a href="/google_calendars">Check google_calendars</a></p>
<h1>Google Contacts</h1>
<% for(var i = 0 ; i < feed.feed.entry.length ; i++ ) {
var contact = feed.feed.entry[i]; %>
<div>
<!-- you can access much more ! Just a sample: -->
<%= contact["title"]["$t"] %>
<% emails = contact["gd$email"] %>
<ul>
<% for(var j = 0 ; j < emails.length ; j++) { %>
<li><%= emails[j]["address" ]%></li>
<% } %>
</ul>
</div>
<% } %>

View File

@ -0,0 +1,9 @@
<html>
<head>
</head>
<body>
<%- body %>
</body>
</html>