Giter Club home page Giter Club logo

epical's Introduction

EpiCal

A simple tool to synchronize your Epitech events with Google calendar.

Requirements

Epitech token

To run this script you have to use your Epitech auto login token which can be found here. The URL is of the form https://intra.epitech.eu/auth-XXX... The token used by the script is only the right part of the URL after the auth- part.

Google calendar credentials

You have to enable the Google Calendar API for your account. You can follow the Google developer QuickStart and click ENABLE THE GOOGLE CALENDAR API button. Then in the resulting dialog click DOWNLOAD CLIENT CONFIGURATION and save the file credentials.json to your working directory.

Installation

With go CLI

go get -v -u github.com/ShellBear/epical/...
epical version

Direct download

You can also download the binaries from the releases page.

Commands

Sync

A command to synchronize Epitech events with your Google calendar.

./epical --token YOUR_EPITECH_AUTOLOGIN_TOKEN sync

List

A command to list Epitech events.

./epical --token YOUR_EPITECH_AUTOLOGIN_TOKEN list

Clear

Delete all events previously created by EpiCal.

./epical clear

Options

Credentials

You can specify the Google Calendar API folder path containing credentials.json and token.json files using the --credentials or -c option.

./epical --token YOUR_EPITECH_AUTOLOGIN_TOKEN --credentials /run/secrets/ sync

Usage

The easiest way to run this tool is to execute it with a periodic cron job.

First, you need to generate the token.json file, which is the Google Calendar API token file. Make sure you have the file credentials.json and then run the script for the first time:

If the credentials.json file is in your current directory then you can just do:

epical --token YOUR_EPITECH_AUTOLOGIN_TOKEN

Otherwise, you can specify the path of the folder where it can be found:

epical --token YOUR_EPITECH_AUTOLOGIN_TOKEN --credentials /run/secrets/

Then a message will appear:

Go to the following link in your browser then type the authorization code: 
https://accounts.google.com/o/oauth2/auth...

Just open this link in a browser, sign in with your google account, and paste the code you received. Then, the token.json will be generated automatically.

Finally, make sure that cron is installed and that the /etc/cron.hourly folder exists. Just create a script in the /etc/cron.hourly directory or any other cron directory of your choice:

> cat /etc/cron.hourly/epical
#!/bin/sh

EPICAL_BINARY_PATH/epical --token YOUR_EPITECH_AUTOLOGIN_TOKEN -c CREDENTIALS_AND_TOKEN_FOLDER_PATH sync

Then give execute permission to the script and check that everything is working correctly:

chmod +x /etc/cron.hourly/epical
run-parts -v /etc/cron.hourly/

Congrats, you're done!

Built With

License

This project is licensed under the MIT License - see the LICENSE file for details

epical's People

Contributors

shellbear avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

epical's Issues

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.