<commit_before>require 'net/http'
require 'uri'
require 'pry'
require 'rexml/document'
require 'json'



module Lita
  module Handlers
    class Wotd < Handler
      route(/wotd/, :wotd, command: true, help: {
        'wotd' => 'returns the word of the day from dictionary.com'
      })

      def wotd(response)
        response.reply(the_word)
      end

      private
      def the_word
        "#{extract_the_word} - dictionary.com"
      end

      def extract_the_word
        xml_data = api_call.body
        doc      = REXML::Document.new(xml_data)
        doc.get_elements('//description').last.get_text
      end

      def uri
        URI.parse 'http://dictionary.reference.com/wordoftheday/wotd.rss'
      end

      def api_call
        Net::HTTP.get_response(uri)<commit_msg>Remove cruft from initial development<commit_after>require 'net/http'
require 'uri'
require 'rexml/document'

module Lita
  module Handlers
    class Wotd < Handler
      route(/wotd/, :wotd, command: true, help: {
        'wotd' => 'returns the word of the day from dictionary.com'
      })

      def wotd(response)
        response.reply(the_word)
      end

      private
      def the_word
        "#{extract_the_word} - dictionary.com"
      end

      def extract_the_word
        xml_data = api_call.body
        doc      = REXML::Document.new(xml_data)
        doc.get_elements('//description').last.get_text
      end

      def uri
        URI.parse 'http://dictionary.reference.com/wordoftheday/wotd.rss'
      end

      def api_call
        Net::HTTP.get_response(uri)
{'fraction_non_alphanumeric': 0.09929980903882878, 'fraction_numerical': 0.0, 'mean_word_length': 2.2546583850931676, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '6312028', 'n_tokens_mistral': 517, 'n_tokens_neox': 501, 'n_words': 113}