cinch-imdb 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ .DS_Store
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
data/README.md ADDED
@@ -0,0 +1,82 @@
1
+ # Cinch-IMDb - IMDb.com plugin
2
+
3
+ ## Description
4
+
5
+ This plugin uses the Film Buff gem to access data from IMDb.com.
6
+
7
+ ## Installation
8
+
9
+ ### RubyGems
10
+
11
+ You can install the latest Cinch-IMDb gem using RubyGems
12
+
13
+ gem install cinch-imdb
14
+
15
+ ### GitHub
16
+
17
+ Alternatively you can check out the latest code directly from Github
18
+
19
+ git clone http://github.com/sachse/cinch-imdb.git
20
+
21
+ ## Usage
22
+
23
+ Install the gem and load it in your Cinch bot:
24
+
25
+ require "cinch"
26
+ require "cinch/plugins/imdb"
27
+
28
+ bot = Cinch::Bot.new do
29
+ configure do |c|
30
+ # add all required options here
31
+ c.plugins.plugins = [Cinch::Plugins::IMDb] # optionally add more plugins
32
+ end
33
+ end
34
+
35
+ bot.start
36
+
37
+ If you want to return results in other languages this is possible as well. The supported locales are "de_DE", "en_US", "es_ES", "fr_FR", "it_IT" and "pt_PT" with "en_US" being the default.
38
+
39
+ require "cinch"
40
+ require "cinch/plugins/imdb"
41
+
42
+ bot = Cinch::Bot.new do
43
+ configure do |c|
44
+ # add all required options here
45
+ c.plugins.plugins = [Cinch::Plugins::IMDb] # optionally add more plugins
46
+ c.plugins.options[Cinch::Plugins::IMDb][:locale] = "de_DE"
47
+ end
48
+ end
49
+
50
+ bot.start
51
+
52
+ ## Commands
53
+
54
+ ### imdb
55
+
56
+ By default the bot will reply with "Title (Year) - Rating/10 - IMDb link"
57
+ e.g. "The Wizard of Oz (1939) - 8.3/10 - http://www.imdb.com/title/tt0032138"
58
+
59
+ With a German locale (de_DE) the bot would instead reply with "Das zauberhafte Land (1939) - 8.3/10 - http://www.imdb.com/title/tt0032138"
60
+
61
+ If you want to change the output format this can be done in imdb.rb
62
+ The amount of information available is dependent on the Film Buff gem, which is used for accessing IMDb.com - At the time of writing the following information is accessible:
63
+
64
+ - Title
65
+ - Tagline
66
+ - Plot
67
+ - Runtime
68
+ - Rating
69
+ - Amount of votes
70
+ - Poster URL
71
+ - Genres
72
+ - Release date
73
+ - IMDb ID
74
+
75
+ ## Authors
76
+
77
+ * [Kristoffer Sachse](https://github.com/sachse)
78
+
79
+ ## Contribute
80
+
81
+ Fork the project, implement your changes in it's own branch, and send
82
+ a pull request to me. I'll gladly consider any help or ideas.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "cinch-imdb"
5
+ s.version = "0.0.1"
6
+ s.platform = Gem::Platform::RUBY
7
+ s.authors = ["Kristoffer Sachse"]
8
+ s.email = ["kristoffer@sachse.nu"]
9
+ s.homepage = "https://github.com/sachse/cinch-imdb"
10
+ s.summary = %q{Gives Cinch IRC bots access to IMDb data}
11
+ s.description = %q{Gives Cinch IRC bots access to IMDb data}
12
+
13
+ s.rubyforge_project = "cinch-imdb"
14
+
15
+ s.add_dependency("cinch", "~> 1.0")
16
+ s.add_dependency("filmbuff")
17
+
18
+ s.files = `git ls-files`.split("\n")
19
+ s.require_paths = ["lib"]
20
+ end
@@ -0,0 +1,24 @@
1
+ require 'filmbuff'
2
+
3
+ module Cinch
4
+ module Plugins
5
+ class IMDb
6
+ include Cinch::Plugin
7
+
8
+ def initialize(*args)
9
+ super
10
+
11
+ @imdb = FilmBuff::IMDb.new
12
+ @imdb.locale = config[:locale] if config[:locale]
13
+ end
14
+
15
+ match /imdb (.+)/i
16
+ def execute(m, title)
17
+ movie = @imdb.find_by_title(title)
18
+
19
+ m.reply "#{movie.title} - #{movie.rating}/10 - " <<
20
+ "http://www.imdb.com/title/#{movie.imdb_id}"
21
+ end
22
+ end
23
+ end
24
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cinch-imdb
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Kristoffer Sachse
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-03-07 00:00:00 +01:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: cinch
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ~>
23
+ - !ruby/object:Gem::Version
24
+ version: "1.0"
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: filmbuff
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: "0"
36
+ type: :runtime
37
+ version_requirements: *id002
38
+ description: Gives Cinch IRC bots access to IMDb data
39
+ email:
40
+ - kristoffer@sachse.nu
41
+ executables: []
42
+
43
+ extensions: []
44
+
45
+ extra_rdoc_files: []
46
+
47
+ files:
48
+ - .gitignore
49
+ - Gemfile
50
+ - README.md
51
+ - Rakefile
52
+ - cinch-imdb.gemspec
53
+ - lib/cinch/plugins/imdb.rb
54
+ has_rdoc: true
55
+ homepage: https://github.com/sachse/cinch-imdb
56
+ licenses: []
57
+
58
+ post_install_message:
59
+ rdoc_options: []
60
+
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: "0"
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: "0"
75
+ requirements: []
76
+
77
+ rubyforge_project: cinch-imdb
78
+ rubygems_version: 1.6.0
79
+ signing_key:
80
+ specification_version: 3
81
+ summary: Gives Cinch IRC bots access to IMDb data
82
+ test_files: []
83
+