allocine 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.md
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,23 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+ doc
21
+ .yardoc
22
+
23
+ ## PROJECT::SPECIFIC
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Jordan Bracco
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,61 @@
1
+ Allocine
2
+ ---------
3
+
4
+ Parseur d'[Allocine][6] pour récupérer des informations sur les films et séries.
5
+
6
+ ## Installation
7
+
8
+ Dépendances:
9
+
10
+ (sudo) gem install activesupport vegas sinatra
11
+
12
+ Dépendances optionnelles (mais recommandées, nécessite `curl`)
13
+
14
+ (sudo) gem install curb zlib
15
+
16
+ Via RubyGems:
17
+
18
+ (sudo) gem sources -r http://gemcutter.org
19
+ (sudo) gem install allocine
20
+
21
+ Ou via git:
22
+
23
+ $ git clone git://github.com/Florian95/allocine.git
24
+
25
+ ## Utilisation
26
+
27
+ ### Recherche
28
+
29
+ Les recherches s’effectuent avec `Allocine.find_movie` et `Allocine.find_show`, et renvoie un Hash de l’ID Allocine et du titre exact.
30
+
31
+ ### Récupérer les informations d'un film
32
+
33
+ `Allocine::Movie.new(ID)`
34
+
35
+ ### Récupérer les informations d'une série
36
+
37
+ `Allocine::Show.new(ID)`
38
+
39
+ Voir la [documentation complète][3].
40
+
41
+ ## Frontend web
42
+
43
+ Une petite application Sinatra est fournie. Pour la démarrer,
44
+
45
+ - [Homepage][1]
46
+ - [Source Code][2]
47
+ - [Documentation][3]
48
+ - [Issues][4]
49
+ - [Try it live!][5]
50
+
51
+ Mis a disposition sous licence MIT. (c) 2008 Jordan Bracco[7], Florian Lamache[8], Sunny Ripert[9].
52
+
53
+ [1]: http://webs.github.com/allocine
54
+ [2]: http://github.com/webs/allocine
55
+ [3]: http://yardoc.org/docs/webs-allocine
56
+ [4]: http://github.com/webs/allocine/issues
57
+ [5]: http://allocine.heroku.com
58
+ [6]: http://allocine.fr
59
+ [7]: http://github.com/webs
60
+ [8]: http://github.com/florian95
61
+ [9]: http://github.com/sunny
data/Rakefile ADDED
@@ -0,0 +1,63 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "allocine"
8
+ gem.summary = %Q{Parser for Allocine.fr}
9
+ gem.description = %Q{Get data about movies and shows on allocine.fr}
10
+ gem.email = "jordan@bracco.name"
11
+ gem.homepage = "http://github.com/florian95/allocine"
12
+ gem.authors = ["Jordan Bracco", "Florian Lamache", "Sunny Ripert"]
13
+ #gem.rubyforge_project = "allocine"
14
+ gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
15
+ gem.add_dependency("activesupport", ["> 0.0.0"])
16
+ end
17
+ Jeweler::GemcutterTasks.new
18
+ # Jeweler::RubyforgeTasks.new do |rubyforge|
19
+ # rubyforge.doc_task = "rdoc"
20
+ # end
21
+ rescue LoadError
22
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
23
+ end
24
+
25
+ require 'spec/rake/spectask'
26
+ Spec::Rake::SpecTask.new(:spec) do |spec|
27
+ spec.libs << 'lib' << 'spec'
28
+ spec.spec_opts = ['--color', '--format nested']
29
+ spec.ruby_opts = ['-rrubygems']
30
+ spec.spec_files = FileList['spec/**/*_spec.rb']
31
+ end
32
+
33
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
34
+ spec.libs << 'lib' << 'spec'
35
+ spec.pattern = 'spec/**/*_spec.rb'
36
+ spec.ruby_opts = ['-rrubygems']
37
+ spec.rcov = true
38
+ end
39
+
40
+ task :spec => :check_dependencies
41
+
42
+ task :default => :spec
43
+
44
+ require 'rake/rdoctask'
45
+ Rake::RDocTask.new do |rdoc|
46
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
47
+
48
+ rdoc.rdoc_dir = 'rdoc'
49
+ rdoc.title = "allocine #{version}"
50
+ rdoc.rdoc_files.include('README*')
51
+ rdoc.rdoc_files.include('lib/**/*.rb')
52
+ end
53
+
54
+ begin
55
+ require 'yard'
56
+ YARD::Rake::YardocTask.new do |t|
57
+ t.files = ['lib/**/*.rb']
58
+ end
59
+ rescue LoadError
60
+ task :yardoc do
61
+ abort "YARD is not available. In order to run YARD, you must: sudo gem install yard (or use rdoc: `rake rdoc`)"
62
+ end
63
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.4.0
data/allocine.gemspec ADDED
@@ -0,0 +1,66 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{allocine}
8
+ s.version = "0.4.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Jordan Bracco", "Florian Lamache", "Sunny Ripert"]
12
+ s.date = %q{2009-11-19}
13
+ s.description = %q{Get data about movies and shows on allocine.fr}
14
+ s.email = %q{jordan@bracco.name}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.md",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "allocine.gemspec",
27
+ "lib/allocine.rb",
28
+ "lib/allocine/movie.rb",
29
+ "lib/allocine/show.rb",
30
+ "lib/allocine/web.rb",
31
+ "lib/allocine/web/curb.rb",
32
+ "lib/allocine/web/open_uri.rb",
33
+ "spec/allocine_spec.rb",
34
+ "spec/helper.rb",
35
+ "spec/movie_spec.rb",
36
+ "spec/show_spec.rb"
37
+ ]
38
+ s.homepage = %q{http://github.com/florian95/allocine}
39
+ s.rdoc_options = ["--charset=UTF-8"]
40
+ s.require_paths = ["lib"]
41
+ s.rubygems_version = %q{1.3.5}
42
+ s.summary = %q{Parser for Allocine.fr}
43
+ s.test_files = [
44
+ "spec/allocine_spec.rb",
45
+ "spec/helper.rb",
46
+ "spec/movie_spec.rb",
47
+ "spec/show_spec.rb"
48
+ ]
49
+
50
+ if s.respond_to? :specification_version then
51
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
52
+ s.specification_version = 3
53
+
54
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
55
+ s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
56
+ s.add_runtime_dependency(%q<activesupport>, ["> 0.0.0"])
57
+ else
58
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
59
+ s.add_dependency(%q<activesupport>, ["> 0.0.0"])
60
+ end
61
+ else
62
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
63
+ s.add_dependency(%q<activesupport>, ["> 0.0.0"])
64
+ end
65
+ end
66
+
@@ -0,0 +1,70 @@
1
+ module Allocine
2
+ class Movie
3
+ attr_accessor :title, :directors, :trailer, :press_rate, :nat, :genres, :out_date, :duree, :production_date, :original_title, :actors, :synopsis, :image, :interdit
4
+
5
+ def self.find(search)
6
+ search = ActiveSupport::Multibyte.proxy_class.new(search.to_s).mb_chars.normalize(:kd).gsub(/[^\x00-\x7F]/n,'').downcase.to_s.
7
+ downcase.
8
+ gsub(/[\W]/u, ' ').
9
+ gsub(/\s[a-z]{1}\s/, ' ').
10
+ strip.
11
+ gsub(/-\z/u, '').
12
+ gsub(' ', '+').
13
+ gsub('2nd', '2').
14
+ to_s
15
+ data = Allocine::Web.new(MOVIE_SEARCH_URL % search).data.gsub(/\r|\n|\t|\s{2,}/,"")
16
+ movies = Array.new
17
+ while data =~ /<a href='\/film\/fichefilm_gen_cfilm=(\d+).html'><imgsrc='.*?'alt='(.*?)' \/><\/a>/i
18
+ id, name = $1, $2
19
+ data.gsub!("<a href='/film/fichefilm_gen_cfilm=#{id}.html'>", "")
20
+ name.gsub!(/<(.+?)>/,'')
21
+ movies << [id, name]
22
+ end
23
+ movies = searchGoogle(search, movies.collect{|m| m[0]}) + movies
24
+
25
+ return movies
26
+ end
27
+
28
+ def self.searchGoogle(search, movies)
29
+ data = Allocine::Web.new("http://www.google.fr/search?hl=fr&q=site:allocine.fr+#{search}").data #.gsub(/\r|\n|\t/,"")
30
+ matches = Array.new
31
+ data.scan(/fichefilm_gen_cfilm=([0-9]*).html/) do |m|
32
+ matches << [m.first, "#{search} - Found by Google"] unless movies.include? m.first
33
+ end
34
+ return matches.uniq
35
+ end
36
+
37
+ def self.lucky_find(search)
38
+ results = find(search)
39
+ new(results.first)
40
+ end
41
+
42
+ def initialize(id, debug=false)
43
+ regexps = {
44
+ :title => '<div class="titlebar"><h1>(.*?)<\/h1>',
45
+ :directors => 'Réalisé par <span .*?><a .*?>(.*?)<\/a><\/span>',
46
+ :nat => 'Long-métrage(.*?)\.',
47
+ :genres => 'Genre : (.*?)<br\/>',
48
+ :out_date => 'Date de sortie cinéma : <span .*?><a .*?>(.*?)<\/a><\/span>',
49
+ :duree => 'Durée :(.*?) min',
50
+ :production_date => 'Année de production : <a .*?>(.*?)<\/a><br \/>',
51
+ :original_title => 'Titre original : <span .*?><em>(.*?)<\/em><\/span>',
52
+ :actors => 'Avec (.*?), <a class=',
53
+ :synopsis => '<p><span class="bold">Synopsis : </span>(.*?)</p>',
54
+ :image => '<div class="poster"><em class="imagecontainer"><a .*?><img src=\'(.*?)\'alt=".*?"title=".*?"\/><img .*?><\/a><\/em>',
55
+ :press_rate => '<p class="withstars"><a href=\'/film/revuedepresse_gen_cfilm=[0-9]*?.html\'><img .*? /></a><span class="moreinfo">\((.*?)\)</span></p></div>',
56
+ :trailer => "<li class=\"\"><a href=\"\/video\/player_gen_cmedia=(.*?)&cfilm=#{id}\.html\">Bandes-annonces<\/a><\/li>"
57
+ }
58
+ data = Allocine::Web.new(MOVIE_DETAIL_URL % id).data.gsub(/\r|\n|\t/,"")
59
+ regexps.each do |reg|
60
+ print "#{reg[0]}: " if debug
61
+ r = data.scan Regexp.new(reg[1], Regexp::MULTILINE)
62
+ r = r.first.to_s.strip
63
+ r.gsub!(/<.*?>/, '')
64
+ r.strip!
65
+ self.instance_variable_set("@#{reg[0]}", r)
66
+ print "#{r}\n" if debug
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,55 @@
1
+ module Allocine
2
+ class Show
3
+ attr_accessor :title, :created_by, :producters, :nat, :genres, :duree, :original_title, :actors, :synopsis, :image
4
+
5
+ def self.find(search)
6
+ search.gsub!(' ', '+')
7
+ str = Allocine::Web.new(SHOW_SEARCH_URL % search).data
8
+ shows = {}
9
+ while str =~ /<a href='\/series\/ficheserie_gen_cserie=(\d+).html'>(.*?)<\/a>/mi
10
+ id, name = $1, $2
11
+ unless name =~ /<img(.*?)/
12
+ str.gsub!("<a href=\'/series/ficheserie_gen_cserie=#{id}.html\'>#{name}</a>", "")
13
+ name.gsub!(/<(.+?)>/,'')
14
+ name.strip!
15
+ shows[id] = name
16
+ else
17
+ str.gsub!("<a href=\'/series/ficheserie_gen_cserie=#{id}.html\'>#{name}</a>", "")
18
+ end
19
+ end
20
+
21
+ shows
22
+ end
23
+
24
+ def self.lucky_find(search)
25
+ results = find(search)
26
+ new(results.first)
27
+ end
28
+
29
+ def initialize(id, debug=false)
30
+ #TODO : New Regex for new version.
31
+ regexps = {
32
+ :title => '<title>(.*?)<\/title>',
33
+ :created_by => '<h4>Série créée par <a .*?>(.*?)</a>',
34
+ :producters => '<h4>Producteurs : (.*?)</h4>',
35
+ :nat => '<span style=\'font-weight:bold\'>Nationalité</span> : (.*?)</h5>',
36
+ :genres => '<span style=\'font-weight:bold\'>Genre</span> : (.*?)&nbsp;&nbsp;',
37
+ :duree => '<span style=\'font-weight:bold\'>Format</span> : (.+?).&nbsp;',
38
+ :original_title => '<h4><b>Titre original : </b></h4><h4 style="color:#D20000"><b>(.*?)</b></h4>',
39
+ :actors => '<h4>Avec : (.*?)&nbsp;&nbsp;',
40
+ :synopsis => '<h5><span style=\'font-weight:bold\'>Synopsis</span>&nbsp;&nbsp;&nbsp;.*?<br />(.*?)</h5>',
41
+ :image => '<td><div id=\'divM\' .*?><img src=\'(.*?)\' style=\'border:1px solid black;.*?>',
42
+ }
43
+ data = Allocine::Web.new(SHOW_DETAIL_URL % id).data.gsub(/\r|\n|\t/,"")
44
+ regexps.each do |reg|
45
+ print "#{reg[0]}: " if debug
46
+ r = data.scan Regexp.new(reg[1], Regexp::MULTILINE)
47
+ r = r.first.to_s.strip
48
+ r.gsub!(' - AlloCiné', '')
49
+ r.gsub!(/<.*?>/, '')
50
+ self.instance_variable_set("@#{reg[0]}", r)
51
+ print "#{r}\n" if debug
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,42 @@
1
+ module Allocine
2
+ module WebCurb
3
+ def download(urls)
4
+ url_queue = [*urls]
5
+ multi = Curl::Multi.new
6
+ responses = {}
7
+ url_queue.each do |url|
8
+ easy = Curl::Easy.new(url) do |curl|
9
+ curl.follow_location = true
10
+ curl.on_success do |c|
11
+ responses[url] = decode_content(c)
12
+ end
13
+ curl.on_failure do |c, err|
14
+ responses[url] = c.response_code
15
+ end
16
+ end
17
+ multi.add(easy)
18
+ end
19
+ multi.perform
20
+ urls.is_a?(String) ? responses.values.first : responses
21
+ end
22
+
23
+ def decode_content(c)
24
+ if c.header_str.match(/Content-Encoding: gzip/)
25
+ begin
26
+ gz = Zlib::GzipReader.new(StringIO.new(c.body_str))
27
+ xml = gz.read
28
+ gz.close
29
+ rescue Zlib::GzipFile::Error
30
+ # Maybe this is not gzipped?
31
+ xml = c.body_str
32
+ end
33
+ elsif c.header_str.match(/Content-Encoding: deflate/)
34
+ xml = Zlib::Inflate.inflate(c.body_str)
35
+ else
36
+ xml = c.body_str
37
+ end
38
+ xml
39
+ end
40
+
41
+ end
42
+ end
@@ -0,0 +1,11 @@
1
+ module Allocine
2
+ module WebOpenUri
3
+ def download(urls)
4
+ responses = {}
5
+ [*urls].each do |url|
6
+ responses[url] = open(url).read.to_s
7
+ end
8
+ urls.is_a?(String) ? responses.values.first : responses
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,8 @@
1
+ module Allocine
2
+ class Web
3
+ attr_reader :data
4
+ def initialize(urls)
5
+ @data = download(urls)
6
+ end
7
+ end
8
+ end
data/lib/allocine.rb ADDED
@@ -0,0 +1,44 @@
1
+ $:.unshift File.dirname(__FILE__)
2
+
3
+ require 'activesupport'
4
+
5
+ %w{allocine/web allocine/movie allocine/show}.each do |lib|
6
+ require lib
7
+ end
8
+
9
+ begin
10
+ require 'curb'
11
+ require 'zlib'
12
+ require 'allocine/web/curb'
13
+ Allocine::Web.send(:include, Allocine::WebCurb)
14
+ rescue LoadError
15
+ require 'open-uri'
16
+ require 'allocine/web/open_uri'
17
+ Allocine::Web.send(:include, Allocine::WebOpenUri)
18
+ end
19
+
20
+ module Allocine
21
+ MOVIE_SEARCH_URL = "http://www.allocine.fr/recherche/1/?q=%s"
22
+ MOVIE_DETAIL_URL = "http://www.allocine.fr/film/fichefilm_gen_cfilm=%s.html"
23
+ SHOW_SEARCH_URL = "http://www.allocine.fr/recherche/6/?q=%s"
24
+ SHOW_DETAIL_URL = "http://www.allocine.fr/series/ficheserie_gen_cserie=%s.html"
25
+
26
+ # Make a search on movies
27
+ def self.find_movie(search)
28
+ Allocine::Movie.find(search)
29
+ end
30
+
31
+ # Make a search on shows
32
+ def self.find_show(search)
33
+ Allocine::Show.find(search)
34
+ end
35
+
36
+ # Returns the first result
37
+ def self.lucky_movie(search)
38
+ Allocine::Movie.lucky_find(search)
39
+ end
40
+
41
+ def self.lucky_show(search)
42
+ Allocine::Show.lucky_find(search)
43
+ end
44
+ end
@@ -0,0 +1,19 @@
1
+ require 'helper'
2
+
3
+ describe "Allocine" do
4
+ it "find movie" do
5
+ Allocine.find_movie('Plan 9').size.should == 2
6
+ end
7
+
8
+ it "find show" do
9
+ Allocine.find_show('XFiles').should == {"182"=>"X-Files : Aux fronti\303\250res du r\303\251el", "223"=>"Lost"}
10
+ end
11
+
12
+ it "lucky movie" do
13
+ Allocine.lucky_movie('Les pirates de la Silicon Valley').is_a?(Allocine::Movie).should == true
14
+ end
15
+
16
+ it "lucky show" do
17
+ Allocine.lucky_show('Stargate').is_a?(Allocine::Show).should == true
18
+ end
19
+ end
data/spec/helper.rb ADDED
@@ -0,0 +1,9 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ require 'allocine'
4
+ require 'spec'
5
+ require 'spec/autorun'
6
+
7
+ Spec::Runner.configure do |config|
8
+
9
+ end
@@ -0,0 +1,51 @@
1
+ require 'helper'
2
+
3
+ describe "Allocine Movie (Star Trek - 4854)" do
4
+
5
+ before(:each) { @movie = Allocine::Movie.new('4854') }
6
+
7
+ it 'should have a title' do
8
+ @movie.title.should == "Star Trek : Premier contact"
9
+ end
10
+
11
+ it 'should have a synopsis' do
12
+ @movie.synopsis.should == "De m\303\251chants extraterrestres, les Borgs, complotent contre les habitants de la Terre. Ils mettent au point une machination diabolique pour d\303\251truire l'humanit\303\251."
13
+ end
14
+
15
+ it 'should have an original title' do
16
+ @movie.original_title.should == "Star Trek: First Contact"
17
+ end
18
+
19
+ it 'should have a nationality' do
20
+ @movie.nat.should == "am\303\251ricain"
21
+ end
22
+
23
+ it 'should have a picture' do
24
+ @movie.image.should_not be nil
25
+ end
26
+
27
+ it 'should have a genre' do
28
+ @movie.genres.should == "Science fiction"
29
+ end
30
+
31
+ it 'should have a director' do
32
+ @movie.directors.should == "Jonathan Frakes"
33
+ end
34
+
35
+ it 'should have a duration' do
36
+ @movie.duree.should == "1h52"
37
+ end
38
+
39
+ it 'should have actors' do
40
+ @movie.actors.should == "Jonathan Frakes, Patrick Stewart, Brent Spiner"
41
+ end
42
+
43
+ it 'should have an out date' do
44
+ @movie.out_date.should == "5 mars 1997"
45
+ end
46
+
47
+ it 'should have a production date' do
48
+ @movie.production_date.should == "1996"
49
+ end
50
+
51
+ end
data/spec/show_spec.rb ADDED
@@ -0,0 +1,42 @@
1
+ require 'helper'
2
+
3
+ describe "Allocine Show (Enterprise - 109)" do
4
+
5
+ before(:each) { @show = Allocine::Show.new('109') }
6
+
7
+ it 'should have a title' do
8
+ @show.title.should == "Enterprise"
9
+ end
10
+
11
+ it 'should have producters' do
12
+ @show.producters.should == "J.P. Farrell, Antoinette Stella"
13
+ end
14
+
15
+ it 'should have a genre' do
16
+ @show.genres.should == "Fantastique"
17
+ end
18
+
19
+ it 'should have an image' do
20
+ @show.image.should == "http://a69.g.akamai.net/n/69/10688/v1/img5.allocine.fr/acmedia/medias/nmedia/18/35/64/59/18415355.jpg"
21
+ end
22
+
23
+ it 'should have a creator' do
24
+ @show.created_by.should == "Rick Berman"
25
+ end
26
+
27
+ it 'should have actors' do
28
+ @show.actors.should == "Dominic Keating, Scott Bakula"
29
+ end
30
+
31
+ it 'should have a nationality' do
32
+ @show.nat.should == "Am\303\251ricaine"
33
+ end
34
+
35
+ it 'should have a synopsis' do
36
+ @show.synopsis.should == "Le premier vaisseau terrien Enterprise, dirig\303\251 par le capitaine Jonathan Archer, part \303\240 la d\303\251couverte de mondes nouveaux, de nouvelles formes de vie et de civilisations diff\303\251rentes.Note : L'histoire se d\303\251roule 100 ans avant les aventures du capitaine Kirk dans la s\303\251rie originale Star Trek."
37
+ end
38
+
39
+ it 'should have a duree' do
40
+ @show.duree.should == "42 mn" # \o/
41
+ end
42
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: allocine
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.0
5
+ platform: ruby
6
+ authors:
7
+ - Jordan Bracco
8
+ - Florian Lamache
9
+ - Sunny Ripert
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+
14
+ date: 2009-11-19 00:00:00 +01:00
15
+ default_executable:
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ name: thoughtbot-shoulda
19
+ type: :development
20
+ version_requirement:
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: "0"
26
+ version:
27
+ - !ruby/object:Gem::Dependency
28
+ name: activesupport
29
+ type: :runtime
30
+ version_requirement:
31
+ version_requirements: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">"
34
+ - !ruby/object:Gem::Version
35
+ version: 0.0.0
36
+ version:
37
+ description: Get data about movies and shows on allocine.fr
38
+ email: jordan@bracco.name
39
+ executables: []
40
+
41
+ extensions: []
42
+
43
+ extra_rdoc_files:
44
+ - LICENSE
45
+ - README.md
46
+ files:
47
+ - .document
48
+ - .gitignore
49
+ - LICENSE
50
+ - README.md
51
+ - Rakefile
52
+ - VERSION
53
+ - allocine.gemspec
54
+ - lib/allocine.rb
55
+ - lib/allocine/movie.rb
56
+ - lib/allocine/show.rb
57
+ - lib/allocine/web.rb
58
+ - lib/allocine/web/curb.rb
59
+ - lib/allocine/web/open_uri.rb
60
+ - spec/allocine_spec.rb
61
+ - spec/helper.rb
62
+ - spec/movie_spec.rb
63
+ - spec/show_spec.rb
64
+ has_rdoc: true
65
+ homepage: http://github.com/florian95/allocine
66
+ licenses: []
67
+
68
+ post_install_message:
69
+ rdoc_options:
70
+ - --charset=UTF-8
71
+ require_paths:
72
+ - lib
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: "0"
78
+ version:
79
+ required_rubygems_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: "0"
84
+ version:
85
+ requirements: []
86
+
87
+ rubyforge_project:
88
+ rubygems_version: 1.3.5
89
+ signing_key:
90
+ specification_version: 3
91
+ summary: Parser for Allocine.fr
92
+ test_files:
93
+ - spec/allocine_spec.rb
94
+ - spec/helper.rb
95
+ - spec/movie_spec.rb
96
+ - spec/show_spec.rb