<commit_before># Description:
#   LGTM!
#
# Dependencies:
#   "cheerio": "0.17.0"
#
# Commands:
#   hubot reply <query> -- Respond an image from tiqav.com
#
# Author:
#   yulii

cheerio = require('cheerio')

module.exports = (robot) ->

  # Looks good to me!
  robot.hear /lgtm/i, (msg) ->
    msg.http("http://www.lgtm.in/g")
      .get() (err, res, body) ->
        $ = cheerio.load(body)
        msg.send $('#imageUrl').attr('value')

  # GET an image from tiqav
  robot.respond /reply\s+(.+)?/i, (msg) ->
    msg.http("http://api.tiqav.com/search/random.json")
      .query(q: msg.match[1])
      .get() (err, res, body) ->
        if err
          msg.send "tiqav says: #{err}"
          return

        content = JSON.parse(body)
        size    = content.length
        if size <= 0<commit_msg>fix lgtm<commit_after># Description:
#   LGTM!
#
# Commands:
#   hubot reply <query> -- Respond an image from tiqav.com
#
# Author:
#   yulii

cheerio = require('cheerio')

module.exports = (robot) ->

  # Looks good to me!
  robot.hear /lgtm/i, (msg) ->
    robot.http("http://www.lgtm.in/g")
      .get() (err, res, body) ->
        if res.statusCode is 302
          robot.http(res.headers.location)
            .get() (err, res, body) ->
              $ = cheerio.load(body)
              msg.send $('#imageUrl').attr('value')

  # GET an image from tiqav
  robot.respond /reply\s+(.+)?/i, (msg) ->
    robot.http("http://api.tiqav.com/search/random.json")
      .query(q: msg.match[1])
      .get() (err, res, body) ->
        if err
          msg.send "tiqav says: #{err}"
          return

        content = JSON.parse(body)
        size    = content.length
        if size <= 0
{'fraction_non_alphanumeric': 0.17912218268090155, 'fraction_numerical': 0.006524317912218268, 'mean_word_length': 2.0672727272727274, 'pattern_counts': {'":': 1, '<': 7, '<?xml version=': 0, '>': 16, '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': '6301614', 'n_tokens_mistral': 639, 'n_tokens_neox': 628, 'n_words': 136}