Shows the availability of pods, desks and meeting rooms for members at the ODI offices
This code is open source under the MIT license. See the LICENSE.md file for full details.
This is rather a brittle process, and there's a few steps that need to be followed for everything to work. It's documented here, but I'll spell it out here too:
- Set up a new project in the Google API console, this needs to have access to the Google Calendar API
- Set up a service account, download the private key (and put it in the root of the Rails project), and copy and paste the public key fingerprint into the appropriate place in the
.env
file - Copy the service account email address, put it in the appropriate place in the
.env
file too, and also put an email address (which will need to be a domain admin) that the service account will act on behalf of in theGAPPS_USER_EMAIL
entry. You will also need to put their pasword too, but hopefully this step will go away in future - With the service account email still in your clipboard, add the service account to your team (under 'team' in the API console), and make them an owner.
- Go back to the 'API Access' section, and copy the service account Client ID, now go to your domain admin section (in the format
http://google.com/a/{YOUR DOMAIN}
) - Go to 'Advanced tools', and choose 'Manage third party OAuth access'
- Paste the Client ID into the box marked 'Client name', and enter
http://www.google.com/calendar/feeds/, https://www.googleapis.com/auth/calendar
(comma seperated, or it won't work!) into the API scopes box. Click 'Authorize' - Erm
- That's it
We use Poltergeist for some of the testing (because Javascript), so you'll need to make sure phantom.js is installed on your machine. You can do this as follows:
- Homebrew:
brew install phantomjs
- MacPorts:
sudo port install phantomjs
- Manual install: Download this
Do this as a last resort if the binaries don't work for you. It will take quite a long time as it has to build WebKit.
- Download the source tarball
- Extract and cd in
./build.sh
(See also the PhantomJS building guide.)