<commit_before>require 'google-search'

module Slacker
  class Images < Plugin

    def pattern
      /image(\s?me)?/
    end

    def respond (text, user_name, channel_name, timestamp)
      address = pattern.match(text)
      query = text[address.end(0)..text.length()]

      image = Google::Search::Image.new(:query => query).first
      'Here\'s an image of the\'' << query << "'\n" << image.uri
    end

    Bot.register(Images)
  end
end<commit_msg>seriously amazing formatting<commit_after>require 'google-search'

module Slacker
  class Images < Plugin

    def pattern
      /image(\s?me)?/
    end

    def respond (text, user_name, channel_name, timestamp)
      address = pattern.match(text)
      query = text[address.end(0)+1..text.length()]

      image = Google::Search::Image.new(:query => query).first
      'Here\'s an image of the \'' << query << "'\n" << image.uri
    end

    Bot.register(Images)
  end
end
{'fraction_non_alphanumeric': 0.14301075268817204, 'fraction_numerical': 0.0032258064516129032, 'mean_word_length': 2.879166666666667, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 5, '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': '6297816', 'n_tokens_mistral': 300, 'n_tokens_neox': 290, 'n_words': 73}