Sha256: 9fa46416b427b14dcd50cff753cf01fcff6f94d5087da8bbb86d9b394b9afcbc
Contents?: true
Size: 746 Bytes
Versions: 39
Compression:
Stored size: 746 Bytes
Contents
# This plugin is brought to you by aburdette/cinch-fmylife # Thank You! module Plugins class Fml include Cinch::Plugin include Cinch::Helpers enable_acl(:nobody) set( plugin_name: "FuckMyLife", help: "Get a random FML.\nUsage: `?fml`", ) match /fml/ def execute(m) m.reply fetch_random_fml, true end private def fetch_random_fml url = 'http://www.fmylife.com/random' # fml_story = Nokogiri.HTML(RestClient.get(url)).at('div.article').text.strip fml_story = Nokogiri.HTML(open(url).read).at('div.article').text.strip fml_story[/^Today, (.+) FML/] rescue => e e.message end end end # AutoLoad Bot.config.plugins.plugins.push Plugins::Fml
Version data entries
39 entries across 39 versions & 1 rubygems