Class: Botbckt::Gooble

Inherits:
Command show all
Defined in:
lib/botbckt/commands/gooble.rb

Overview

Sends text repeatedly to Google Translate via the JSON API to garble the output. Translation starts and ends with MAIN_LANGUAGE unless a language option is passed in. If an option is present it is used as the starting language.

< user> ~gooble We the People of the United States, in Order to form a more perfect Union
< botbckt> Popular in the United States to create the completed

With language option:

< user> ~gooble --german Guten tag
< botbckt> Good day

or the short version

< user> ~gooble -de Guten tag
< botbckt> Good day

Constant Summary collapse

MAIN_LANGUAGE =
"en"
TRANSLATE_ATTEMPTS =
4
LANGUAGES =

Yeah this is wordy but it’s self documenting.

{
  "Albanian"    => "sq",
  "Arabic"      => "ar",
  "Bulgarian"   => "bg",
  "Catalan"     => "ca",
  "Chinese"     => "zh-CN",
  "Croatian"    => "hr",
  "Czech"       => "cs",
  "Danish"      => "da",
  "Dutch"       => "nl",
  "English"     => "en",
  "Estonian"    => "et",
  "Filipino"    => "tl",
  "Finnish"     => "fi",
  "French"      => "fr",
  "Galician"    => "gl",
  "German"      => "de",
  "Greek"       => "el",
  "Hebrew"      => "iw",
  "Hindi"       => "hi",
  "Hungarian"   => "hu",
  "Indonesian"  => "id",
  "Italian"     => "it",
  "Japanese"    => "ja",
  "Korean"      => "ko",
  "Latvian"     => "lv",
  "Lithuanian"  => "lt",
  "Maltese"     => "mt",
  "Norwegian"   => "no",
  "Polish"      => "pl",
  "Portuguese"  => "pt",
  "Romanian"    => "ro",
  "Russian"     => "ru",
  "Serbian"     => "sr",
  "Slovak"      => "sk",
  "Slovenian"   => "sl",
  "Spanish"     => "es",
  "Swedish"     => "sv",
  "Thai"        => "th",
  "Turkish"     => "tr",
  "Ukrainian"   => "uk",
  "Vietnamese"  => "vi"
}

Method Summary

Methods inherited from Command

#call, create!, #get, #increment!, say, #say, #set, trigger

Methods included from Utilities

#freenode_split