Skip to content

Instantly share code, notes, and snippets.

View joncalhoun's full-sized avatar
💻
Making Go Courses

Jon Calhoun joncalhoun

💻
Making Go Courses
View GitHub Profile
@joncalhoun
joncalhoun / easypost_buypostage.rb
Created September 29, 2012 00:31
Buying postage with EasyPost and Ruby
require "easypost"
Easypost.api_key = "ek_0HbTD15HeT6RFTwCKoUQ7rrB2NzMZ"
EasyPost::Postage.buy(
:parcel => {
:weight => 1.1,
:height => 12,
:width => 14,
:length => 7
},
@joncalhoun
joncalhoun / easypost_buy.py
Created September 29, 2012 10:25
Buy postage with EasyPost and Python
import easypost
easypost.api_key = "ek_0HbTD15HeT6RFTwCKoUQ7rrB2NzMZ"
easypost.Postage.buy({
"tracking": True,
"insurance": 135,
"weight": 1.1,
"height": 12,
"width": 14,
"length": 7,
@joncalhoun
joncalhoun / easypost_compareprice.rb
Created October 1, 2012 07:24
Compare prices with EasyPost and Ruby
require "easypost"
Easypost.api_key = "ek_0HbTD15HeT6RFTwCKoUQ7rrB2NzMZ"
EasyPost::Postage.compare(
:parcel => {
:weight => 1.1,
:height => 12,
:width => 14,
:length => 7
},
@joncalhoun
joncalhoun / easypost_compare.py
Created October 1, 2012 07:47
Compare prices with EasyPost and Python
import easypost
easypost.api_key = "ek_0HbTD15HeT6RFTwCKoUQ7rrB2NzMZ"
easypost.Postage.compare({
"tracking": True,
"insurance": 135,
"weight": 1.1,
"height": 12,
"width": 14,
"length": 7,
@joncalhoun
joncalhoun / easypost_verify.rb
Created October 1, 2012 09:20
Verify address with EasyPost and Ruby
require "easypost"
Easypost.api_key = "ek_0HbTD15HeT6RFTwCKoUQ7rrB2NzMZ"
Easypost::Address.verify(
:street1 => "101 California St",
:street2 => "Suite 1290",
:city => "San Francisco",
:state => "CA",
:zip => "94111"
)
@joncalhoun
joncalhoun / easypost_verify.py
Created October 1, 2012 09:52
Verify address with EasyPost and Python
import easypost
easypost.api_key = "ek_0HbTD15HeT6RFTwCKoUQ7rrB2NzMZ"
easypost.Address.verify({
"street1": "101 California St",
"street2": "Suite 1290",
"city": "San Francisco",
"state": "CA",
"zip": "94111"
})
@joncalhoun
joncalhoun / easypost_buy.java
Created October 1, 2012 10:26
Buy postage with Easy Post and Java
EasyPost.setApiKey("ek_0HbTD15HeT6RFTwCKoUQ7rrB2NzMZ");
// Create the package
EasyPost.Package package = new EasyPost.Package()
.setWeigth(1.1)
.setHeight(12)
.setWidth(14)
.setLength(7);
// Create the to and from addresses
@joncalhoun
joncalhoun / easypost_compare.java
Created October 1, 2012 10:28
Compare prices with EasyPost and Java
EasyPost.setApiKey("ek_0HbTD15HeT6RFTwCKoUQ7rrB2NzMZ");
// Create the package
EasyPost.Package package = new EasyPost.Package()
.setWeigth(1.1)
.setHeight(12)
.setWidth(14)
.setLength(7);
// Create the to and from addresses
@joncalhoun
joncalhoun / easypost_verify.java
Created October 1, 2012 10:35
Verify address with EasyPost and Java
EasyPost.setApiKey("ek_0HbTD15HeT6RFTwCKoUQ7rrB2NzMZ");
// Create the address to test
EasyPost.Address address = new EasyPost.Address()
.setName("Dirk Diggler")
.setStreet1("300 Granelli Ave")
.setCity("Half Moon Bay")
.setState("CA")
.setZip("94019");
@joncalhoun
joncalhoun / easypost_python_examples.py
Created October 25, 2012 06:04
EasyPost Python Examples
import easypost
easypost.api_key = 'rWI791GTPCIwGMaQEGFQmJyEeZ925kln'
# Setting up data...
to_address = {
"street1": '388 Townsend St',
"street2": 'Apt 20',
"city": 'San Francisco',
"state": 'CA',
"zip": '94107'