<commit_before># Description:
#   Display hello
#
# Dependencies:
#   None
#
# Configuration:
#   None
#
# Commands:
#   hi / hello - Replies with a greeting
#
# Author:
#   robertocarroll

moment = require 'moment'

# get current time
currentHour = moment().hour()
greeting = 'hello'

# get current time
weather = 

module.exports = (robot) ->
  robot.hear /hi|hello/i, (msg) ->
  	# Time
  	if currentHour < 12
      greeting = 'Good morning'
    if currentHour >= 12 && currentHour <= 17
      greeting = 'Good afternoon'
    if currentHour > 17 && currentHour <= 24
      greeting = 'Good evening'     
  	msg.send greeting 
<commit_msg>Weather greeting working - primitive version:wq<commit_after># Description:
#   Display hello
#
# Dependencies:
#   None
#
# Configuration:
#   None
#
# Commands:
#   hi / hello - Replies with a greeting
#
# Author:
#   robertocarroll

moment = require 'moment'

# get current time
currentHour = moment().hour()
greeting = 'hello'

# get the weather
currentWeather = ' '
getWeather = (msg, cb) ->
	msg.http("https://api.forecast.io/forecast/#{process.env.HUBOT_DARK_SKY_API_KEY}/53.480759,-2.242631/") 
    	.get() (err, res, body) ->
    		try
    			result = JSON.parse(body)
    			currentWeather = result.currently.summary
    		catch e
    			currentWeather = ' '
    		cb currentWeather


module.exports = (robot) ->
  robot.hear /hi|hello/i, (msg) ->
    # Time
    if currentHour < 12
      greeting = 'Good morning'
    if currentHour >= 12 && currentHour <= 17
      greeting = 'Good afternoon'
    if currentHour > 17 && currentHour <= 24
      greeting = 'Good evening'
    getWeather msg, (currentWeather) ->  
    	msg.send greeting + currentWeather
    




{'fraction_non_alphanumeric': 0.1237594862813777, 'fraction_numerical': 0.020431990659661413, 'mean_word_length': 2.825892857142857, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 14, 'https://': 1, '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': '1030359', 'n_tokens_mistral': 637, 'n_tokens_neox': 599, 'n_words': 148}