Skip to content

Instantly share code, notes, and snippets.

View kinlane's full-sized avatar

Kin Lane kinlane

View GitHub Profile
@kinlane
kinlane / API - Tech - XML
Created February 8, 2011 20:07
This is a XML example I am using in my business of APIs series for API Evangelist.
<contact>
<firstname>Kin</firstname>
<lastname>Lane</lastname>
<age>38</age>
<website>apievangelist.com</website>
<address>
<streetaddress>123 2nd Street</streetaddress>
<city>New York</city>
<state>NY</state>
<postalcode>10021</postalcode>
@kinlane
kinlane / API - Tech - JSON
Created February 8, 2011 20:17
This is a JSON example I am using in my business of APIs series for API Evangelist.
{
"firstName": "Kin",
"lastName": "Lane",
"age": 38,
"website": “apievangelist.com”,
"address":
{
"streetAddress": "123 2nd Street",
"city": "New York",
"state": "NY",
@kinlane
kinlane / API - Tech - SOAP
Created February 8, 2011 20:34
This is a SOAP example I am using in my business of APIs series for API Evangelist.
POST /InStock HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 299
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
</soap:Header>
<soap:Body>
@kinlane
kinlane / GCP - XMPP - 1
Created February 28, 2011 21:25
Google Client Login for Google Cloud Print XMPP Print Job Service Using Zend
include 'XMPPHP/XMPP.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 = "[Your Print Proxy ID]";
// Gmail User Email
@kinlane
kinlane / GCP - XMPP - 2
Created February 28, 2011 21:30
Persisent XMPP Connection for Google Cloud Print XMPP Print Job Service Using XMPPHP Library
// Begin XMPP
$conn = new XMPPHP_XMPP('talk.google.com', 5222, $G_Email, $G_Pass, 'xmpphp', 'gmail.com', $printlog=true, $loglevel=XMPPHP_Log::LEVEL_VERBOSE);
$conn->autoSubscribe();
$vcard_request = array();
//var_dump($conn);
try {
@kinlane
kinlane / GCP - XMPP - 3
Created February 28, 2011 21:35
XMPP Subscription Stanza for Google Cloud Print XMPP Print Job Service Using XMPPHP
<iq from='{Full JID}' to='{Bare JID}' type='set' id='1'>
<subscribe xmlns='google:push'>
<item channel='cloudprint.google.com/proxy/b{Proxy ID}' from='cloudprint.google.com'/>
</subscribe>
</iq>
@kinlane
kinlane / GCP - XMPP - 4
Created February 28, 2011 21:39
XMPP Acknowledgement Response for Google Cloud Print XMPP Print Job Service Using XMPPHP
<iq to="{Full JID}" from="{Bare JID}" id="1" type="result"/>
@kinlane
kinlane / GCP - XMPP - 5
Created February 28, 2011 21:42
XMPP Print Job Notification for Google Cloud Print XMPP Print Job Service Using XMPPHP
<message from="cloudprint.google.com" to="{Full JID}">
<push:push channel="cloudprint.google.com/proxy/bcdf3feb8b6b2625104c8994e0927605" xmlns:push="google:push">
<push:recipient to="{Bare JID}">
</push:recipient>
<push:data>LTExMDM2MjYxMDk0MjU3NjQ5NTA=</push:data>
</push:push>
</message>
@kinlane
kinlane / MCP - Storage Service - POST
Created March 15, 2011 04:22
POST a file to the Mimeo Cloud Print Storage Service
<?php
require_once "rest_client.php";
if(isset($_POST['imgupload']))
{
$fileName = $_FILES['uploadFile']['name'];
$fileTempName = $_FILES['uploadFile']['tmp_name'];
@kinlane
kinlane / Twitter Web Intent API
Created March 31, 2011 17:11
Allows users to make Tweets more interactive without employing OAuth.
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<p><a href="http://twitter.com/intent/tweet?in_reply_to=51113028241989632">Reply</a></p>
<p><a href="http://twitter.com/intent/retweet?tweet_id=51113028241989632">Retweet</a></p>
<p><a href="http://twitter.com/intent/favorite?tweet_id=51113028241989632">Favorite</a></p>