Skip to content

Instantly share code, notes, and snippets.

Last active March 10, 2017 19:54
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
PubNub DevOps UI w/ PagerDuty
<!doctype html>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<link rel="stylesheet" href="//" />
<link rel="stylesheet" href="" />
<div class="container" ng-app="PubNubAngularApp" ng-controller="MyDevOpsCtrl">
NOTE: make sure to update the PubNub keys below with your keys,
and ensure that the devops BLOCK is configured properly!
<h3>MyApp DevOps Controls</h3>
<input type="submit" ng-click="publish()" value="PANIC!" />
<br /><br />
<li ng-repeat="message in messages track by $index">
Event Description: {{message.description}}
<br />
PagerDuty Incident Key: {{message.result.incident_key}}
angular.module('PubNubAngularApp', ["pubnub.angular.service"])
.controller('MyDevOpsCtrl', function($rootScope, $scope, Pubnub) {
$scope.messages = [];
$ = 'pagerduty-event';
if (!$rootScope.initialized) {
publishKey: 'YOUR_PUB_KEY',
subscribeKey: 'YOUR_SUB_KEY',
$rootScope.initialized = true;
var msgCallback = function(payload) {
$scope.$apply(function() {
$scope.publish = function() {
channel: $,
message: {description:"user hit PANIC button on channel '" + $ + "'!"}
Pubnub.subscribe({ channels: [$] });
Pubnub.addListener({ message: msgCallback });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment