Generar una lista de franjas horarias disponibles desde Google Calendar

Estoy buscando un programa (Windows 7), una extensión de Google Chrome o una secuencia de comandos que pueda ver mi Google Calendar y generar una lista de intervalos de tiempo cuando esté disponible para los próximos X días, por ejemplo:

  • Lunes 13 de abril de 10 a 13 hs.
  • Lunes 13 de abril en cualquier momento después de las 3 p. m.
  • Martes 14 de abril en cualquier momento después de la 1 p. m.
  • Miércoles 15 de abril de 10 a 13 hs.
  • Miércoles 15 de abril en cualquier momento después de las 3 p. m.
  • Viernes 17 de abril en cualquier momento después de las 11:30 a. m.
  • Lunes 20 de abril de 10 a 13 hs.
  • Lunes 20 de abril en cualquier momento después de las 3 p. m.
  • Martes 21 de abril en cualquier momento después de la 1 p. m.
  • Miércoles 22 de abril de 10 a 13 hs.
  • Miércoles 22 de abril en cualquier momento después de las 3 p. m.
  • Viernes 24 de abril en cualquier momento después de las 11:30 a. m.
  • etc.

Respuestas (1)

Con python más la API de Google Calendar , puede usar el calendar.freebusy.querymétodo. Esto también se puede usar desde Google App Engine y puede encontrar más información aquí .

Esto devuelve devuelve: Un objeto de la forma:

{
"timeMax": "A String", # The end of the interval.
"kind": "calendar#freeBusy", # Type of the resource ("calendar#freeBusy").
"calendars": { # List of free/busy information for calendars.
  "a_key": { # Free/busy expansions for a single calendar.
    "busy": [ # List of time ranges during which this calendar should be regarded as busy.
      {
        "start": "A String", # The (inclusive) start of the time period.
        "end": "A String", # The (exclusive) end of the time period.
      },
    ],
    "errors": [ # Optional error(s) (if computation for the calendar failed).
      {
        "domain": "A String", # Domain, or broad category, of the error.
        "reason": "A String", # Specific reason for the error. Some of the possible values are:
            # - "groupTooBig" - The group of users requested is too large for a single query.
            # - "tooManyCalendarsRequested" - The number of calendars requested is too large for a single query.
            # - "notFound" - The requested resource was not found.
            # - "internalError" - The API service has encountered an internal error.  Additional error types may be added in the future, so clients should gracefully handle additional error statuses not included in this list.
      },
    ],
  },
},
"groups": { # Expansion of groups.
  "a_key": { # List of calendars that are members of this group.
    "errors": [ # Optional error(s) (if computation for the group failed).
      {
        "domain": "A String", # Domain, or broad category, of the error.
        "reason": "A String", # Specific reason for the error. Some of the possible values are:
            # - "groupTooBig" - The group of users requested is too large for a single query.
            # - "tooManyCalendarsRequested" - The number of calendars requested is too large for a single query.
            # - "notFound" - The requested resource was not found.
            # - "internalError" - The API service has encountered an internal error.  Additional error types may be added in the future, so clients should gracefully handle additional error statuses not included in this list.
      },
    ],
    "calendars": [ # List of calendars' identifiers within a group.
      "A String",
    ],
  },
},
"timeMin": "A String", # The start of the interval.

}

Esto debería ser fácil de usar para generar lo que necesita.

Puede jugar en el API Explorer , solo recuerde activar el interruptor OAuth.

Tenga en cuenta que los parámetros mínimos son:

{ "timeMin":"2015-01-01T00:00:00Z" "timeMax":"2015-02-01T00:00:00Z" }