Oskar Zabik

Coder & Designer


Playing with Gmail API and Polymer

In this tutorial we will build a simple app using Polymer and Gmail API.

Live demoSource code

Polymer

Polymer lets you extend your HTML with your own components.
Using it is as simple as:

<!-- Importing an element... -->
<link rel="import" href="google-map.html">

<!-- ...and using it -->
<google-map lat="37.790" long="-122.390"></google-map>

Polymer extends standard Web Components with useful stuff and comes with a collection (among others) of predefined components for Google APIs.

Gmail API

The new Gmail API let’s you do a few simple things like read messages or send them. It’s not a full-fledged replacement for IMAP and we can easily use it with a bit of JavaScript.

What are we building?

gmail_conversions_screenshot.png
User replies to online leads via Gmail and labels them as won or lost. We will ask user for his label names, grab the data from Gmail and calculate his conversion rates. Nothing fancy.

...

Continue reading →