Skip to content

Instantly share code, notes, and snippets.

@usmanfarman
usmanfarman / MyGlass.php
Created Oct 12, 2013
Excerpts from two classes that I'm messing around with.
View MyGlass.php
/**
* Download an attachment's content.
*
* @param string item_id ID of the timeline item the attachment belongs to.
* @param Google_Attachment $attachment Attachment's metadata.
* @return string The attachment's content if successful, null otherwise.
*/
function download_attachment($item_id, $attachment) {
$request = new Google_HttpRequest($attachment->getContentUrl(), 'GET', null, null);
$httpRequest = Google_Client::$io->authenticatedRequest($request);