<commit_before># Description:
#   hubotに亀の写真を拾ってきてもらう
#
# Commands:
#   hubot turtle me - Queries Google Images for turtle and returns a random top result.

# Hubotのスクリプトはモジュールとして記述し，
# Hubot起動時にrequireされてexportした関数が呼び出されます

module.exports = (robot) ->
  robot.respond /turtle me/i, (msg) ->
    turtleMe msg, (url) ->
      msg.send url



turtleMe = (msg, cb) ->
  q = v: '1.0', rsz: '8', q: 'turtle', safe: 'active', imgsz: 'medium|large'
  msg.http('http://ajax.googleapis.com/ajax/services/search/images')
    .query(q)
    .get() (err, res, body) ->
      images = JSON.parse(body)
      images = images.responseData?.results
      if images?.length > 0
        image = msg.random images
        cb "#{image.unescapedUrl}#.png"
<commit_msg>Revert "Fix command name  =>"<commit_after># Description:
#   hubotに亀の写真を拾ってきてもらう
#
# Commands:
#   hubot turtleme - Queries Google Images for turtle and returns a random top result.

# Hubotのスクリプトはモジュールとして記述し，
# Hubot起動時にrequireされてexportした関数が呼び出されます

module.exports = (robot) ->
  robot.respond /turtleme/i, (msg) ->
    turtleMe msg, (url) ->
      msg.send url



turtleMe = (msg, cb) ->
  q = v: '1.0', rsz: '8', q: 'turtle', safe: 'active', imgsz: 'medium|large'
  msg.http('http://ajax.googleapis.com/ajax/services/search/images')
    .query(q)
    .get() (err, res, body) ->
      images = JSON.parse(body)
      images = images.responseData?.results
      if images?.length > 0
        image = msg.random images
        cb "#{image.unescapedUrl}#.png"

{'fraction_non_alphanumeric': 0.14873837981407703, 'fraction_numerical': 0.005312084993359893, 'mean_word_length': 3.14010989010989, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, 'https://': 0, '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': '5360367', 'n_tokens_mistral': 632, 'n_tokens_neox': 593, 'n_words': 128}