Skip to content

Instantly share code, notes, and snippets.

View solkennedy's full-sized avatar

Sol Kennedy solkennedy

  • San Francisco, CA
View GitHub Profile
@solkennedy
solkennedy / ship-api-ruby-example.rb
Created August 6, 2012 18:42
Ship API Ruby Example
require 'rest-client'
require 'json'
url = 'https://snapi.sincerely.com/shiplib/create'
request = {
:appkey => ENV["YOUR_APP_KEY"],
:testMode => true,
:frontPhotoId => 123456,
:recipients => [
{
@solkennedy
solkennedy / ship-api-php-example.php
Created August 6, 2012 18:46
Ship API PHP Example
<?
// Upload image from the filesystem
$ch = curl_init();
$request = array('appkey'=>'YOUR_APPKEY_HERE', 'photo'=>'@/path/to/image.jpg');
curl_setopt($ch, CURLOPT_URL, 'https://snapi.sincerely.com/shiplib/upload');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
# Inspired by original script by incanus:
# https://gist.github.com/1186990
#
# Rewritten by martijnthe:
# https://gist.github.com/1379127
#