Skip to content

Instantly share code, notes, and snippets.

View pyokagan's full-sized avatar

Paul Tan pyokagan

View GitHub Profile
@pyokagan
pyokagan / googlecurl.py
Created November 2, 2012 16:21
googlecurl - Wrapper around oauth2curl providing automatic pagination of items in google API responses. Supports gdata json, youtube jsonc and new-style google API responses.
#! /usr/bin/python3 -u
"""A wrapper around oauth2curl. Makes multiple
calls to oauth2curl. Returns items one item
per line."""
from argparse import ArgumentParser
from subprocess import Popen, PIPE
import sys
from urllib.parse import urlsplit, parse_qs, urlencode, urlunsplit
import json
import signal