Hanami and Google Calendar


For one of my test Slack Bots, I’ve created small Hanami based app, which uses google_calendar gem.

Just set your .env variables:

CLIENT_ID="XXXXXXXXXX"
CLIENT_SECRET="XXXXXXXXXX"
CALENDAR_ID="XXXXXXXXXX"
REDIRECT_URI="XXXXXXXXXX"
REFRESH_TOKEN="XXXXXXXXXX"

And run hanami server with:

bundle install && bundle exec hanami server

You can try it here on my Github: Hanamirb based Google Calendar API service.

Some test results:

$ curl http://localhost:2300 -H "Content-Type: application/json"
[{"summary":"Daily Standup","visibility":"public","transparency":"transparent","description":null,"location":null,"start":{"dateTime":"2016-12-02T07:45:00Z","timeZone":"Europe/Volgograd"},"end":{"dateTime":"2016-12-02T08:00:00Z","timeZone":"Europe/Volgograd"},"reminders":{"useDefault":true},"guestsCanInviteOthers":null,"guestsCanSeeOtherGuests":null,"recurrence":["RRULE:FREQ=DAILY"]},{"summary":"Barcelona - Real","visibility":"default","transparency":"transparent","description":null,"location":null,"start":{"dateTime":"2016-12-03T11:00:00Z"},"end":{"dateTime":"2016-12-03T12:00:00Z"},"reminders":{"useDefault":true},"guestsCanInviteOthers":null,"guestsCanSeeOtherGuests":null}]%