Skip to content
Fetches a Google calendar and POSTs formatted events beginning two weeks ago to a callback URL.
Branch: master
Clone or download
Latest commit da1d83b Feb 28, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.aws-sam/build fetch up to 250 events Mar 1, 2019
fetch_events
fixtures/vcr_cassettes/google
script
tests/unit
.gitignore
Gemfile
Gemfile.lock
LICENSE
README.md update readme Mar 1, 2019
packaged.yaml
template.yaml

README.md

google-calendar-service

Fetches a Google calendar and POSTs formatted events beginning two weeks ago to a callback URL.

Based on http://blog.blackninjadojo.com/aws/serverless/2019/02/18/build-package-and-deploy-an-aws-lambda-using-the-ruby-runtime.html.

Requirements

Setup process

gem install bundler
bundle

Packaging and deployment

script/ship

Testing

ruby tests/unit/test_handler.rb

Usage

Aws::Lambda::Client.new.invoke({
  function_name: "lambda:arn",
  invocation_type: "Event",
  log_type: "None",
  payload: {
    config: {
      calendar_ref: "google_calendar@google.com",
      credential_options: {
        client_id: "google_client_id",
        scope: "email https://www.googleapis.com/auth/calendar.readonly",
        client_secret: "google_client_secret",
        refresh_token: "google_refresh_token",
        additional_parameters: {"access_type" => "offline"}
      },
      callback_secret: "my_shared_key",
      callback_url: "my_callback_url"
    },
  }.to_json
})
You can’t perform that action at this time.