Skip to content
This repository has been archived by the owner. It is now read-only.


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Deprecation Notice

This sample project has been deprecated. It is no longer being actively maintained and is probably out of date.

In other words, if you decide to clone this repository, you're on your own.

Google Mirror API's Quick Start for Ruby (using Sinatra)

This project shows you how to implement a simple piece of Glassware that demos the major functionality of the Google Mirror API.


  • Ruby 1.9 or higher
  • To use subscriptions, you also need an Internet accessible hosting environment with a valid SSL certificate signed by a trusted certificate authority.

Note: You can start developing with a localhost instance of your HTTP server, but you must have an Internet accessible host to use the subscription features of the API.

Configuring the project

Enter your client ID, secret, and an OAuth2 redirect URL in client_secrets.json:

    "web": {
        "client_id": "",
        "client_secret": "ITS_A_SECRET_TO_EVERYBODY",
        "redirect_uris": [
        "auth_uri": "",
        "token_uri": ""

Installing gem dependencies

This example uses Bundler to manage gem dependencies. Before running the script for the first time, run the following command from a terminal in the directory containing the Quick Start files to install the required gems:

$ bundle install

Running a local development server

Before deploying to your production server, you can run the Quick Start project as a local development server for testing. This application is written using the Sinatra micro-framework, and you can launch it as a standard Ruby script from the terminal:

  1. From a terminal in the directory containing your Quick Start files, run:

     $ ruby mirror_quick_start.rb
  2. Start using the Quick Start on your default browser at http://localhost:4567.

Deploying the project

To deploy the Quick Start to your host server, copy the Ruby Quick Start directory to your web server and configure it as a Rack application per your server's instructions. Phusion Passenger along with Apache httpd or nginx work great. For detailed instructions on deploying a Sinatra application to either of these servers, please refer to the Phusion Passenger users guide for Apache or nginx.


Google Mirror API's Quickstart for Ruby (deprecated)







No releases published


No packages published