<commit_before># frozen_string_literal: true

#  cbsg.rb
#  Author: <NAME>
#  ------------------------
#  A Cinch plugin that grabs generated corporate bullshit for yossarian-bot.
#  ------------------------
#  This code is licensed by William Woodruff under the MIT License.
#  http://opensource.org/licenses/MIT

require "nokogiri"
require "open-uri"

require_relative "yossarian_plugin"

class CBSG < YossarianPlugin
  include Cinch::Plugin
  use_blacklist

  URL = "http://cbsg.sourceforge.io/cgi-bin/live"

  def usage
    "!cbsg - Spew some corporate bullshit."
  end

  def match?(cmd)
    cmd =~ /^(!)?cbsg$/
  end

  match /cbsg$/, method: :cbsg

  def cbsg(m)
    page = Nokogiri::HTML(open(URL).read)

    m.reply page.css("li").first.text, true
  rescue Exception => e
    m.reply e.to_s, true
  end<commit_msg>CBSG: http -> https (again)<commit_after># frozen_string_literal: true

#  cbsg.rb
#  Author: <NAME>
#  ------------------------
#  A Cinch plugin that grabs generated corporate bullshit for yossarian-bot.
#  ------------------------
#  This code is licensed by William Woodruff under the MIT License.
#  http://opensource.org/licenses/MIT

require "nokogiri"
require "open-uri"

require_relative "yossarian_plugin"

class CBSG < YossarianPlugin
  include Cinch::Plugin
  use_blacklist

  URL = "https://cbsg.sourceforge.io/cgi-bin/live"

  def usage
    "!cbsg - Spew some corporate bullshit."
  end

  def match?(cmd)
    cmd =~ /^(!)?cbsg$/
  end

  match /cbsg$/, method: :cbsg

  def cbsg(m)
    page = Nokogiri::HTML(open(URL).read)

    m.reply page.css("li").first.text, true
  rescue Exception => e
    m.reply e.to_s, true
  end
{'fraction_non_alphanumeric': 0.1739915713425647, 'fraction_numerical': 0.0, 'mean_word_length': 2.66079295154185, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 1, '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': '4774992', 'n_tokens_mistral': 600, 'n_tokens_neox': 579, 'n_words': 148}