Skip to content

Instantly share code, notes, and snippets.

View marccampbell's full-sized avatar

Marc Campbell marccampbell

View GitHub Profile
@marccampbell
marccampbell / create_alert.py
Created July 28, 2011 21:49
Pager.io API Example: Create Alert
import urllib, urllib2, base64
team_name = 'My Pager.io Team Name'
api_key = 'My Pager.io API Key'
alert_subject = 'Test Alert'
alert_message = 'This is where you would put a longer alert message'
data = {'subject': alert_subject, 'message': alert_message}
base64string = base64.encodestring('%s:%s' % (team_name, api_key)).replace('\n', '')
@marccampbell
marccampbell / pager.io examples
Created July 28, 2011 21:27
Creating Authorization Header for Pager.io API in Python
import base64
header = 'Basic ' + base64.b64encode('pager.io:1234567890')
print header
'Basic cGFnZXIuaW86MTIzNDU2Nzg5MA=='