yayimdbs 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +4 -0
  2. data/lib/yay_imdbs.rb +4 -3
  3. metadata +3 -3
data/README.md CHANGED
@@ -43,6 +43,10 @@ Examples
43
43
  ruby-1.9.2-preview3 > YayImdbs.scrap_movie_info('0411008')[:episodes].first
44
44
  => {"series"=>1, "episode"=>1, "title"=>"Pilot: Part 1", "date"=>Wed, 22 Sep 2004, "plot"=>"Forty-eight survivors of an airline flight originating from Australia, bound for the U.S., which crash-lands onto an unknown island 1000 miles off course, struggle to figure out a way to survive, why trying to find a way to be rescued."}
45
45
 
46
+ Contributors
47
+ ------------
48
+ [luisramalho](https://github.com/luisramalho)
49
+
46
50
  Licence
47
51
  -------
48
52
  MIT
data/lib/yay_imdbs.rb CHANGED
@@ -138,10 +138,11 @@ class YayImdbs
138
138
  raw_key = h4.inner_text
139
139
  key = raw_key.sub(':', '').strip.downcase
140
140
  value = div.inner_text[((div.inner_text =~ /#{Regexp.escape(raw_key)}/) + raw_key.length).. -1]
141
- value = value.gsub(/\302\240\302\273/u, '').strip.gsub(/(See more)|(see all)|(See all certifications)|(See full summary)$/, '').strip
142
-
141
+ value = value.gsub(/\302\240\302\273/u, '').strip.gsub(/(See more)|(see all)|(See all certifications)|(Add\/edit official sites)|(See full summary)$/, '').strip
143
142
  symbol_key = key.downcase.gsub(/[^a-zA-Z0-9 ]/, '').gsub(/\s/, '_').to_sym
144
-
143
+ if symbol_key == :official_sites
144
+ value = div.inner_html.match(/href=\"(.*?)\"/)[1]
145
+ end
145
146
  yield symbol_key, value
146
147
  end
147
148
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 2
9
- version: 0.2.2
8
+ - 3
9
+ version: 0.2.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sam Cavenagh
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-03-07 00:00:00 +11:00
17
+ date: 2011-07-28 00:00:00 +10:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency