Sample express app which uses Google GData API
This commit is contained in:
21
examples/express-gdata/views/google_calendars.ejs
Normal file
21
examples/express-gdata/views/google_calendars.ejs
Normal 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>
|
||||
<% } %>
|
24
examples/express-gdata/views/google_contacts.ejs
Normal file
24
examples/express-gdata/views/google_contacts.ejs
Normal 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>
|
||||
|
||||
|
||||
<% } %>
|
9
examples/express-gdata/views/layout.ejs
Normal file
9
examples/express-gdata/views/layout.ejs
Normal file
@ -0,0 +1,9 @@
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<%- body %>
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user