Skip to content

Instantly share code, notes, and snippets.

@mimeoconnect
mimeoconnect / GCP - Client Login
Created February 6, 2011 23:58
Uses the Zend library to authenticate with Google Cloud Print Services Interface with the Client Login API.
<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Http_Client');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
// Gmail User Email
$G_Email = "";
// Gmail User Password
@mimeoconnect
mimeoconnect / GCP - Register
Created February 7, 2011 02:58
Registers a new cloud printer with the Google Cloud Print (GCP) registry using PHP and Zend Framework.
<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Http_Client');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
// Name of Cloud Printer
$Printer_Name = "";
// Description of Cloud Printer
@mimeoconnect
mimeoconnect / GCP - Register - JSON
Created February 7, 2011 03:11
This is a JSON response for the Google Cloud Print (GCP) services interface, register printer call.
{
"success": true,
"printers": [
{
"id": "5846759561318635695",
"name": "My home printer",
"proxy": "ksdjf-7237sf9238-2837jidf"
}
]
}
@mimeoconnect
mimeoconnect / GCP - LIST
Created February 7, 2011 03:46
This returns a list of cloud printers using the Google Cloud Print (GCP) /list interface and the Zend PHP Framework.
<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Http_Client');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
// Path to Printer Capabilities in PPD Format
$Printer_Proxy = "";
// Gmail User Email
@mimeoconnect
mimeoconnect / GCP - LIST - JSON
Created February 7, 2011 03:51
This is an example JSON response for a list of cloud printers using the Google Cloud Print (GCP) /list interface and the Zend PHP Framework
{
"success": true,
"printers": [
{
"id": "5846759561318635695",
"name": "My home printer",
"proxy": "ksdjf-7237sf9238-2837jidf"
},
{
"id": "2066095410062985029",
@mimeoconnect
mimeoconnect / GCP - UPDATE
Created February 7, 2011 04:35
This updates an existing cloud printes using the Google Cloud Print (GCP) /update interface and the Zend PHP Framework
<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Http_Client');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
// ID of Cloud Printer
$Printer_ID = "";
// Name of Cloud Printer
@mimeoconnect
mimeoconnect / GCP - Update - JSON
Created February 7, 2011 04:39
This is an example JSON response for a update of a cloud printer using the Google Cloud Print (GCP) /update interface and the Zend PHP Framework
{
"success": true,
"message": "Printer updated successfully."
}
@mimeoconnect
mimeoconnect / GCP - Delete
Created February 7, 2011 05:03
This deletes an existing cloud printer using the Google Cloud Print (GCP) /delete interface and the Zend PHP Framework
<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Http_Client');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
// ID of Cloud Printer
$Printer_ID = "";
// Name of Cloud Printer
@mimeoconnect
mimeoconnect / GCP - Delete - JSON
Created February 7, 2011 05:08
This is an example JSON response for a delete of a cloud printer using the Google Cloud Print (GCP) /delete interface and the Zend PHP Framework
{
"success": true,
"message": "Printer deleted successfully."
}
@mimeoconnect
mimeoconnect / GCP - Control
Created February 8, 2011 04:55
This updates the status of an existing cloud print job using the Google Cloud Print (GCP) /control interface and the Zend PHP Framework
<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Http_Client');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
// ID of the Print Job
$Job_ID = "";
// Status of the Print Job