<commit_before># Description:
#   PagerDuty Integration for checking who's on call, making exceptions, ack, resolve, etc.
#
# Commands:
#
#   hubot who's on call - return the username of who's on call
#   hubot pager me trigger <msg> - create a new incident with <msg>
#   hubot pager me 60 - take the pager for 60 minutes
#   hubot pager me as <email> - remember your pager email is <email>
#   hubot pager me incidents - return the current incidents
#   hubot pager me incident NNN - return the incident NNN
#   hubot pager me note <incident> <content> - add note to incident #<incident> with <content>
#   hubot pager me notes <incident> - show notes for incident #<incident>
#   hubot pager me problems - return all open incidents
#   hubot pager me ack <incident> - ack incident #<incident>
#   hubot pager me resolve <incident1> <incident2> ... <incidentN> - ack all specified incidents
#   hubot pager me ack - ack all triggered incidents 
#   hubot pager me resolve <incident> - resolve incident #<incident>
#   hubot pager me resolve <incident1> <incident2> ... <incidentN>- resolve all specified incidents
#   hubot pager me resolve - resolve all acknowledged incidents
#
# Dependencies:
#  "moment": "1.6.2"
#
# Notes: 
#   To setup the webhooks and get the alerts in your chatrooms, you need to add the endpoint you define here (e.g /hooks) in 
#   the service settings of your Pagerduty accounts. You also need to define the room in which you want them to appear. 
#   (Unless you want to spam all the rooms with alerts, but we don't believe that should be the default behavior :)  
#
# URLS: 
#   http://developer.pagerduty.com/documentation/rest/webhooks
#   http://support.pagerduty.com/entries/21774694-Webhooks-
#
# Configuration:
#
#   HUBOT_PAGERDUTY_API_KEY - API Access Key
#   HUBOT_PAGERDUTY_SUBDOMAIN
#   HUBOT_PAGERDUTY_SERVICE_API_KEY - Service API Key from a 'General API Service'
#   HUBOT_PAGERDUTY_SCHEDULE_ID
#   HUBOT_PAGERDUTY_ROOM - Room in which you want the pagerduty webhook notifications to appear
#   HUBOT_PAGERDUTY_ENDPOINT - Pagerduty Webhook listener e.g /hook
#
# Authors: 
#   <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
#

inspect = require('util').inspect

moment = require('moment')

pagerDutyApiKey        = process.env.HUBOT_PAGERDUTY_API_KEY
pagerDutySubdomain     = process.env.HUBOT_PAGERDUTY_SUBDOMAIN
pagerDutyBaseUrl       = "https://#{pagerDutySubdomain}.pagerduty.com/api/v1"
pagerDutyServiceApiKey = process.env.HUBOT_PAGERDUTY_SERVICE_API_KEY
pagerDutyScheduleId    = process.env.HUBOT_PAGERDUTY_SCHEDULE_ID
pagerRoom              = process.env.HUBOT_PAGERDUTY_ROOM
# Webhook listener endpoint. Set it to whatever URL you want, and make sure it matches your pagerduty service settings 
pagerEndpoint          = process.env.HUBOT_PAGERDUTY_ENDPOINT || "/hook"

module.exports = (robot) ->
  robot.respond /pager( me)?$/i, (msg) -><commit_msg>Add warning that it's deprecated<commit_after># Description:
#   PagerDuty Integration for checking who's on call, making exceptions, ack, resolve, etc.
#
# Commands:
#
#   hubot who's on call - return the username of who's on call
#   hubot pager me trigger <msg> - create a new incident with <msg>
#   hubot pager me 60 - take the pager for 60 minutes
#   hubot pager me as <email> - remember your pager email is <email>
#   hubot pager me incidents - return the current incidents
#   hubot pager me incident NNN - return the incident NNN
#   hubot pager me note <incident> <content> - add note to incident #<incident> with <content>
#   hubot pager me notes <incident> - show notes for incident #<incident>
#   hubot pager me problems - return all open incidents
#   hubot pager me ack <incident> - ack incident #<incident>
#   hubot pager me resolve <incident1> <incident2> ... <incidentN> - ack all specified incidents
#   hubot pager me ack - ack all triggered incidents 
#   hubot pager me resolve <incident> - resolve incident #<incident>
#   hubot pager me resolve <incident1> <incident2> ... <incidentN>- resolve all specified incidents
#   hubot pager me resolve - resolve all acknowledged incidents
#
# Dependencies:
#  "moment": "1.6.2"
#
# Notes: 
#   To setup the webhooks and get the alerts in your chatrooms, you need to add the endpoint you define here (e.g /hooks) in 
#   the service settings of your Pagerduty accounts. You also need to define the room in which you want them to appear. 
#   (Unless you want to spam all the rooms with alerts, but we don't believe that should be the default behavior :)  
#
# URLS: 
#   http://developer.pagerduty.com/documentation/rest/webhooks
#   http://support.pagerduty.com/entries/21774694-Webhooks-
#
# Configuration:
#
#   HUBOT_PAGERDUTY_API_KEY - API Access Key
#   HUBOT_PAGERDUTY_SUBDOMAIN
#   HUBOT_PAGERDUTY_SERVICE_API_KEY - Service API Key from a 'General API Service'
#   HUBOT_PAGERDUTY_SCHEDULE_ID
#   HUBOT_PAGERDUTY_ROOM - Room in which you want the pagerduty webhook notifications to appear
#   HUBOT_PAGERDUTY_ENDPOINT - Pagerduty Webhook listener e.g /hook
#
# Authors: 
#   <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
#

inspect = require('util').inspect

moment = require('moment')

pagerDutyApiKey        = process.env.HUBOT_PAGERDUTY_API_KEY
pagerDutySubdomain     = process.env.HUBOT_PAGERDUTY_SUBDOMAIN
pagerDutyBaseUrl       = "https://#{pagerDutySubdomain}.pagerduty.com/api/v1"
pagerDutyServiceApiKey = process.env.HUBOT_PAGERDUTY_SERVICE_API_KEY
pagerDutyScheduleId    = process.env.HUBOT_PAGERDUTY_SCHEDULE_ID
pagerRoom              = process.env.HUBOT_PAGERDUTY_ROOM
# Webhook listener endpoint. Set it to whatever URL you want, and make sure it matches your pagerduty service settings 
pagerEndpoint          = process.env.HUBOT_PAGERDUTY_ENDPOINT || "/hook"

module.exports = (robot) ->
   robot.logger.warning "pagerduty.coffee has moved from hubot-scripts to its own package. See https://github.com/hubot-scripts/hubot-pager-me installation instructions"

  robot.respond /pager( me)?$/i, (msg) ->
{'fraction_non_alphanumeric': 0.08926196808510638, 'fraction_numerical': 0.006648936170212766, 'mean_word_length': 3.9892205638474296, 'pattern_counts': {'":': 2, '<': 57, '<?xml version=': 0, '>': 61, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2107557', 'n_tokens_mistral': 2081, 'n_tokens_neox': 2038, 'n_words': 652}