Class: Cinch::Plugins::IMDb

Inherits:
Object
  • Object
show all
Includes:
Cinch::Plugin
Defined in:
lib/cinch/plugins/imdb.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ IMDb

Returns a new instance of IMDb.



8
9
10
11
12
13
# File 'lib/cinch/plugins/imdb.rb', line 8

def initialize(*args)
  super

  @imdb = FilmBuff::IMDb.new
  @imdb.locale = config[:locale] if config[:locale]
end

Instance Method Details

#execute(m, title) ⇒ Object



16
17
18
19
20
21
# File 'lib/cinch/plugins/imdb.rb', line 16

def execute(m, title)
  movie = @imdb.find_by_title(title)

  m.reply "#{movie.title} - #{movie.rating}/10 - " <<
    "http://www.imdb.com/title/#{movie.imdb_id}"
end