movie-garnish 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f5f50918a17c9d0d0da09a7cc45009810a259170
4
+ data.tar.gz: c16ec69be72cfbf62bb45d23c1f43a1b79c359a4
5
+ SHA512:
6
+ metadata.gz: a472e1e6b812ce7bee911a5cd6b1b0f5ea8e8e580f6ed23ea7cbdccb8a0ab756fffa299786e763c24c0fc8acbfef5d2a5b0781175243e142ab840d4c90cfa648
7
+ data.tar.gz: 3641de677a7c60fe700e412359ea0f62150b5f728fdc1dbebdc4e48ff5d17c2f4751e462459799ddaf1125f338d57c591060499af9de57871f2b64e1ddd0f37a
data/.gitignore ADDED
@@ -0,0 +1,19 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ .idea
7
+ .idea/*
8
+ Gemfile.lock
9
+ InstalledFiles
10
+ _yardoc
11
+ coverage
12
+ doc/
13
+ lib/bundler/man
14
+ pkg
15
+ rdoc
16
+ spec/reports
17
+ test/tmp
18
+ test/version_tmp
19
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in movie-garnish-garnish.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 cparratto
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # MovieGarnish
2
+
3
+ A command line tool for encoding movies with meta data from imdb
4
+
5
+ ## Installation
6
+
7
+ $ brew install AtomicParsley
8
+ $ gem install movie-garnish
9
+
10
+ ## Usage
11
+
12
+ mg-cli imdb --video=~/Desktop/some-movie.mp4 --title="Movie Title"
13
+
14
+ # or if the video file is properly names
15
+
16
+ mg-cli imdb --video=~/Desktop/some-movie.mp4
17
+
18
+
19
+ ## Contributing
20
+
21
+ 1. Fork it
22
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
23
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
24
+ 4. Push to the branch (`git push origin my-new-feature`)
25
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/mg-cli.rb ADDED
@@ -0,0 +1,43 @@
1
+ require 'rubygems'
2
+ require 'thor'
3
+ require 'atomic-parsley-ruby'
4
+ require 'imdb'
5
+
6
+ class MGCLI < Thor
7
+ desc "imdb", "Encodes video with attributes from imdb."
8
+ method_option :video, :type => :string, :required => true
9
+ method_option :title, :type => :string, :required => false
10
+ def imdb
11
+ search_term = options[:title]
12
+ search_term ||= File.basename(options[:video], ".*")
13
+
14
+ searched = Imdb::Search.new(search_term)
15
+ movie = searched.movies.first
16
+
17
+ if movie.nil?
18
+ puts "Could not find any #{search_term}"
19
+ else
20
+ img_name = File.basename(movie.poster)
21
+
22
+ open(movie.poster) {|f|
23
+ File.open(img_name,"wb") do |file|
24
+ file.puts f.read
25
+ end
26
+ }
27
+
28
+ media = AtomicParsleyRuby::Media.new(File.expand_path(options[:video]))
29
+
30
+ media.encode do |config|
31
+ config.title movie.title
32
+ #config.year DateTime.parse(movie.release_date).year
33
+ config.genre movie.genres.first
34
+ config.artist movie.cast_members.join(", ")
35
+ config.description movie.plot
36
+ config.artwork img_name
37
+ end
38
+
39
+ end
40
+ end
41
+ end
42
+
43
+ MGCLI.start
@@ -0,0 +1,6 @@
1
+ require "movie-garnish/version"
2
+
3
+
4
+ module MovieGarnish
5
+ # Your code goes here...
6
+ end
@@ -0,0 +1,3 @@
1
+ module MovieGarnish
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'movie-garnish/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "movie-garnish"
8
+ spec.version = MovieGarnish::VERSION
9
+ spec.authors = ["cparratto"]
10
+ spec.email = ["cparratto@pnmac.com"]
11
+ spec.description = %q{Auto tags movies with imdb meta data.}
12
+ spec.summary = %q{Combines the atomic-parsley-ruby api with the ruby imdb api}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(spec|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "thor"
22
+ spec.add_dependency "imdb"
23
+ spec.add_dependency "atomic-parsley-ruby"
24
+
25
+ spec.add_development_dependency "bundler", "~> 1.3"
26
+ spec.add_development_dependency "rake"
27
+ spec.add_development_dependency "rspec"
28
+ end
metadata ADDED
@@ -0,0 +1,139 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: movie-garnish
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - cparratto
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-07-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: imdb
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: atomic-parsley-ruby
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '1.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: Auto tags movies with imdb meta data.
98
+ email:
99
+ - cparratto@pnmac.com
100
+ executables:
101
+ - mg-cli.rb
102
+ extensions: []
103
+ extra_rdoc_files: []
104
+ files:
105
+ - .gitignore
106
+ - Gemfile
107
+ - LICENSE.txt
108
+ - MV5BMTQwMDU4MDI3MV5BMl5BanBnXkFtZTcwMjU1NDgyOQ@@.jpg
109
+ - README.md
110
+ - Rakefile
111
+ - bin/mg-cli.rb
112
+ - lib/movie-garnish.rb
113
+ - lib/movie-garnish/version.rb
114
+ - movie-garnish.gemspec
115
+ homepage: ''
116
+ licenses:
117
+ - MIT
118
+ metadata: {}
119
+ post_install_message:
120
+ rdoc_options: []
121
+ require_paths:
122
+ - lib
123
+ required_ruby_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ requirements: []
134
+ rubyforge_project:
135
+ rubygems_version: 2.0.3
136
+ signing_key:
137
+ specification_version: 4
138
+ summary: Combines the atomic-parsley-ruby api with the ruby imdb api
139
+ test_files: []