<commit_before># Description:
#   Example scripts for you to examine and try out.
#
# Notes:
#   They are commented out by default, because most of them are pretty silly and
#   wouldn't be useful and amusing enough for day to day huboting.
#   Uncomment the ones you want to try and experiment with.
#
#   These are from the scripting documentation: https://github.com/github/hubot/blob/master/docs/scripting.md


neigeUrl = "http://clientservice.onthesnow.com/externalservice/resort/2212/snowreport?token=<PASSWORD>&language=fr&country=FR"

module.exports = (robot) ->

   annoyIntervalId = null

   robot.respond /neige/, (msg) ->

     robot.http(neigeUrl)
      .header('Accept', 'application/json')
      .get() (err, res, body) ->
        data = JSON.parse(body)
        fall = data.report.snowfall.snow24h

        msg.send "*** Bulletin pour la Rosière ***"
        if fall
          msg.send "Elle a tombé : #{fall} cm de neige hier"

        onSlope = data.report.snowQuality.onSlope
        msg.send "En bas: #{onSlope.surfaceBottom}, #{onSlope.lowerDepth} cm"
        msg.send "En haut: #{onSlope.surfaceTop}, #{onSlope.upperDepth} cm"
  #
  #
  # robot.router.post '/hubot/chatsecrets/:room', (req, res) ->
  #   room   = req.params.room
  #   data   = JSON.parse req.body.payload
  #   secret = data.secret
  #
  #   robot.messageRoom room, "I have a secret: #{secret}"<commit_msg>messages sent in order<commit_after># Description:
#   Example scripts for you to examine and try out.
#
# Notes:
#   They are commented out by default, because most of them are pretty silly and
#   wouldn't be useful and amusing enough for day to day huboting.
#   Uncomment the ones you want to try and experiment with.
#
#   These are from the scripting documentation: https://github.com/github/hubot/blob/master/docs/scripting.md


neigeUrl = "http://clientservice.onthesnow.com/externalservice/resort/2212/snowreport?token=a5bae8eea465aae810130937a29cebaa6cd92ce60336d8e3&language=fr&country=FR"

module.exports = (robot) ->

   annoyIntervalId = null

   robot.respond /neige/, (msg) ->

     sendInOrder (strings) ->
       for s, i in strings
         setTimeout () ->
           msg.send s
         , 10 * i

     robot.http(neigeUrl)
      .header('Accept', 'application/json')
      .get() (err, res, body) ->
        data = JSON.parse(body)
        messages = []
        messages.push "*** Bulletin pour la Rosière ***"

        fall = data.report.snowfall.snow24h
        if fall
          messages.push "Elle a tombé : #{fall} cm de neige hier"

        onSlope = data.report.snowQuality.onSlope
        messages.push "En bas: #{onSlope.surfaceBottom}, #{onSlope.lowerDepth} cm"
        messages.push "En haut: #{onSlope.surfaceTop}, #{onSlope.upperDepth} cm"

        sendInOrder messages
  #
  #
  # robot.router.post '/hubot/chatsecrets/:room', (req, res) ->
  #   room   = req.params.room
  #   data   = JSON.parse req.body.payload
  #   secret = data.secret
  #
  #   robot.messageRoom room, "I have a secret: #{secret}"
{'fraction_non_alphanumeric': 0.12289950576606261, 'fraction_numerical': 0.013179571663920923, 'mean_word_length': 2.872448979591837, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 14, 'https://': 2, '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': '194409', 'n_tokens_mistral': 1019, 'n_tokens_neox': 993, 'n_words': 261}