Skip to content

A tool created to receive Gmail with Raspberry Pi 3 using golang Gmail SDK

License

Notifications You must be signed in to change notification settings

uchimanajet7/ggm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ggm

A tool created to receive Gmail with Raspberry Pi 3 using golang Gmail SDK.

Description

I made it for Raspberry Pi 3 to work.

Check Gmail using golang Gmail SDK and execute the specified command when there is a mail that meets the conditions.

Speech synthesis(text-to-speech) and USB power management commands must be installed in Raspberry Pi 3 beforehand as specified commands.

Demo

Click on the image to watch the movie!

Speech synthesis(text-to-speech) demo

Features

  • It is made by golang so it supports multi form.
  • If you get Gamil certification and describe the setting in the setting file, it works.

Requirement

Usage

Just run the only one command.

$ ./ggm

However, setting is necessary to execute.

Setting Example

  1. In the same place as the binary file create .ggm dir.

  2. Get Gamil certification.

  3. Save Gamil certification .ggm/client_secret.json

{
	"installed": {
		"client_id": "123456789012-abcdefghijklnmopqrstuvwxyz123456.apps.googleusercontent.com",
		"project_id": "ex-gmail-test",
		"auth_uri": "https://accounts.google.com/o/oauth2/auth",
        "token_uri": "https://accounts.google.com/o/oauth2/token",
        "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
        "client_secret": "AbCdEfGhijklNmopqr135790",
        "redirect_uris": [
            "urn:ietf:wg:oauth:2.0:oob",
            "http://localhost"
        ]
	}
}
  1. Run command ./ggm
  2. Copy the URL displayed on the terminal and access it with the browser.
  3. Perform an authorization operation in the browser, display the code, and input it to the terminal.
  4. .ggm/client_token.json file is created.
{
	"access_token": "1234.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
	"token_type": "Bearer",
	"refresh_token": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
	"expiry": "2017-09-04T20:25:28.251300122+09:00"
}
  1. Execution settings are done with .ggm/user_config.json file.
{
	"LastDate": 1504243346130,
	"LastTotal": 749,
	"UserEmail": "[email protected]",
	"SpeakCommands": [["/home/pi/aquestalkpi/AquesTalkPi", "-s", "120", "%s"],["aplay"]],
	"UsbCommands": [["sudo", "hub-ctrl", "-h", "0", "-P", "2", "-p", "%d"]],
	"Filters": [
		{
			"From": "[email protected]",
			"Subjects": ["test","user1"]
		},
		{
			"From": "[email protected]",
			"Subjects": null
		}
	]
}

Installation

$ go get github.com/uchimanajet7/ggm

Author

uchimanajet7

Licence

MIT License

About

A tool created to receive Gmail with Raspberry Pi 3 using golang Gmail SDK

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages