<commit_before># Description:
#   Find out what food trucks are at Truck Stop SF today
#   See http://truckstopsf.com
#
# Dependencies:
#   None
#
# Configuration:
#   None
#
# Commands:
#   hubot truckstopsf - get just the names of the food trucks today
#   hubot truckstopsf details|deets - get food truck names and details
#   hubot truckstopsf! - get food truck names and details
#
# Author:
#   chris

utils = require 'underscore'

data_by_matcher = (input, matcher) ->
  get_data = (match.match(matcher).slice(1) for match in input)
  utils.flatten(get_data)

module.exports = (robot) ->
  robot.respond /truckstopsf\s?(!|details|deets)?/i, (res) ->
    d = new Date()
    utc = d.getTime() + (d.getTimezoneOffset() * 60000)
    pstDate = new Date(utc + (3600000*-8));
    today = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'][pstDate.getDay()]

    if today is 'Sunday' or today is 'Saturday'
      res.send "Sorry, the trucks aren't there on weekend"
    else
      res.http("http://www.truckstopsf.com/").get() (err, _, body) ->
        return res.send "Sorry, the trucks are out of gas or something." if err
        show_details = res.match[1]?
        body = body.replace(/\r|\n/g, ' ')<commit_msg>Add underscore dependency to header<commit_after># Description:
#   Find out what food trucks are at Truck Stop SF today
#   See http://truckstopsf.com
#
# Dependencies:
#   "underscore": "*"
#
# Configuration:
#   None
#
# Commands:
#   hubot truckstopsf - get just the names of the food trucks today
#   hubot truckstopsf details|deets - get food truck names and details
#   hubot truckstopsf! - get food truck names and details
#
# Author:
#   chris

_ = require 'underscore'

data_by_matcher = (input, matcher) ->
  get_data = (match.match(matcher).slice(1) for match in input)
  _.flatten(get_data)

module.exports = (robot) ->
  robot.respond /truckstopsf\s?(!|details|deets)?/i, (res) ->
    d = new Date()
    utc = d.getTime() + (d.getTimezoneOffset() * 60000)
    pstDate = new Date(utc + (3600000*-8));
    today = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'][pstDate.getDay()]

    if today is 'Sunday' or today is 'Saturday'
      res.send "Sorry, the trucks aren't there on weekend"
    else
      res.http("http://www.truckstopsf.com/").get() (err, _, body) ->
        return res.send "Sorry, the trucks are out of gas or something." if err
        show_details = res.match[1]?
        body = body.replace(/\r|\n/g, ' ')
{'fraction_non_alphanumeric': 0.14565826330532214, 'fraction_numerical': 0.012004801920768308, 'mean_word_length': 3.4169611307420493, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2989579', 'n_tokens_mistral': 897, 'n_tokens_neox': 847, 'n_words': 239}