Giter Site home page Giter Site logo

gmailer's Introduction

Gmailer

Gmailer is a Clojure library for using Gmail IMAP/SMTP via OAuth.

Installation

Gmailer is available from Clojars, so just add it as a dependency of your project.

DISCLAIMER: This is currently a README driven development work in progress, so nothing apart from the actual authentication really works yet.

:dependencies [[gmailer "0.0.1"]]

Usage

Gmailer assumes you already have a valid OAuth access token. Obtaining this access token is outside the scope of this library (but there is some info further down the page!). When you have the token though, it's easy to use:

(ns my.project
  (:require [gmailer.core as g]))

(def store (g/with-credentials "[email protected]" "ACCESS_TOKEN_HERE"
             (g/imap-store)))

(g/with-store store
  (println (take 5 (g/inbox))))

All access should be wrapped in the with-credentials macro.

Getting a Token

For development the easiest way to get an OAuth token is to go here:

https://developers.google.com/oauthplayground/

Then select Gmail from the API's listed on the left, and enter the scope:

https://mail.google.com/

Click authorise, grant permissions and you should be dumped on a page where you can click a button to exchange your authorisation token for a lovely new access token.

gmailer's People

Contributors

rodnaph avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.