This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$inputJSON = file_get_contents('php://input'); | |
$event = \EasyPost\Event::receive($inputJSON); | |
if($event.description == 'tracker.updated'){ | |
//process event here | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request | |
import easypost | |
import json | |
app = Flask(__name__) | |
@app.route("/webhooks", methods=['POST']) | |
def webhook(): | |
e = easypost.Event() | |
e.receive(json.loads(request.form.keys()[0])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'easypost' | |
require 'sinatra' | |
require 'json' | |
post '/webhook' do | |
e = EasyPost::Event.new | |
e.receive(JSON.parse(request.body.string)) | |
e.result.to_s | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This will fetch shipments and ouput them into csv | |
# | |
# Dependencies | |
# python requests lib - pip install requests | |
# python iso8601 lib - pip install iso8601 | |
# | |
# Setup | |
# add your API key to the code | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "easypost" | |
EasyPost.api_key = 'YOUR API KEY' | |
shipment_ids = #fetch a list of shipment ids from your end | |
shipment_ids.each do |id| | |
shipment = EasyPost::Shipment.retrieve(id) | |
if shipment.tracker.status == 'pre_transit' | |
begin | |
shipment.refund |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
// "log" | |
"log/syslog" | |
) | |
func main() { | |
pt, err := syslog.Dial("udp", "<host>.papertrailapp.com:11111", syslog.LOG_ERR, "My_App_Name") | |
if err != nil { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'librato/metrics' | |
c = Librato::Metrics | |
email = '[email protected]' | |
token = 'abcd1234' | |
c.authenticate email, token |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://www.graphviz.org/content/cluster | |
digraph G { | |
subgraph cluster_level_1 { | |
style=filled; | |
color=lightgrey; | |
node [style=filled,color=white]; | |
integration_0[label="integration"]; | |
custom_space_0[label="custom_space"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Python MAC OSX Librato Agent install script | |
# Version: 0.0.2 | |
# Author: Librato | |
# | |
# run: | |
# curl -s "https://raw.githubusercontent.com/librato/python-librato-agent/master/sh/install.sh?" | bash | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Python MAC OSX Librato Agent install script | |
# Version: 0.0.2 | |
# Author: Librato | |
# | |
# run: | |
# curl -s "https://raw.githubusercontent.com/librato/python-librato-agent/master/sh/install.sh?" | bash | |
# |