kinopoisk_parser 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/kinopoisk_parser.gemspec +1 -1
- data/lib/kinopoisk/movie.rb +1 -1
- data/lib/kinopoisk/person.rb +1 -1
- data/lib/kinopoisk_parser.rb +2 -2
- data/spec/kinopoisk/movie_spec.rb +4 -4
- data/spec/kinopoisk/person_spec.rb +2 -2
- data/spec/spec_helper.rb +6 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e56c2aead71c161dcf774ec7922462ce05eaf013
|
4
|
+
data.tar.gz: 5cf48abed4e93df9f0f3e1be871714235bd86555
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9d094cf5c798f8b361ecdf60e65d3001d0913da828685075a3cb91f6033dff8b0426437cf6f5786fa6d9615313e9d68e719ef21f674d084ba84f169502e5ea0
|
7
|
+
data.tar.gz: 7a633600b10a91bc67637e69d01f3b1139945d5bdcfda9230d49491707cf65a8f89008faba1002966849bd8303b591b06b0c5915cb0ef6889dcc47af438cabbb
|
data/kinopoisk_parser.gemspec
CHANGED
data/lib/kinopoisk/movie.rb
CHANGED
data/lib/kinopoisk/person.rb
CHANGED
data/lib/kinopoisk_parser.rb
CHANGED
@@ -5,14 +5,14 @@ require 'kinopoisk/search'
|
|
5
5
|
require 'kinopoisk/person'
|
6
6
|
|
7
7
|
module Kinopoisk
|
8
|
-
SEARCH_URL = '
|
8
|
+
SEARCH_URL = 'https://www.kinopoisk.ru/index.php?kp_query='
|
9
9
|
|
10
10
|
NotFound = Class.new StandardError
|
11
11
|
Denied = Class.new StandardError
|
12
12
|
|
13
13
|
# Headers are needed to mimic proper request so kinopoisk won't block it
|
14
14
|
def self.fetch(url)
|
15
|
-
HTTPClient.new.get url, nil, { 'User-Agent'=>'a', 'Accept-Encoding'=>'a' }
|
15
|
+
HTTPClient.new.get url, nil, { follow_redirect: true, 'User-Agent'=>'a', 'Accept-Encoding'=>'a' }
|
16
16
|
end
|
17
17
|
|
18
18
|
# Returns a nokogiri document or an error if fetch response status is not 200
|
@@ -5,12 +5,12 @@ describe Kinopoisk::Movie, vcr: { cassette_name: 'movies' } do
|
|
5
5
|
let(:dexter) { Kinopoisk::Movie.new 277537 }
|
6
6
|
let(:avatar) { Kinopoisk::Movie.new 251733 }
|
7
7
|
|
8
|
-
it { dexter.url.should eq('
|
8
|
+
it { dexter.url.should eq('https://www.kinopoisk.ru/film/277537/') }
|
9
9
|
it { dexter.title.should eq('Декстер') }
|
10
10
|
it { dexter.title_en.should eq('Dexter') }
|
11
11
|
|
12
|
-
it { dexter.poster.should eq('
|
13
|
-
it { dexter.poster_big.should eq('
|
12
|
+
it { dexter.poster.should eq('https://st.kp.yandex.net/images/film_iphone/iphone360_277537.jpg') }
|
13
|
+
it { dexter.poster_big.should eq('https://st.kp.yandex.net/images/film_big/277537.jpg') }
|
14
14
|
|
15
15
|
it { dexter.year.should eq(2006) }
|
16
16
|
it { dexter.countries.should eq(['США']) }
|
@@ -47,7 +47,7 @@ describe Kinopoisk::Movie, vcr: { cassette_name: 'movies' } do
|
|
47
47
|
end
|
48
48
|
|
49
49
|
it 'should raise error if nothing found' do
|
50
|
-
expect { Kinopoisk::Movie.new(111111111).title }.to raise_error
|
50
|
+
expect { Kinopoisk::Movie.new(111111111).title }.to raise_error Kinopoisk::NotFound
|
51
51
|
end
|
52
52
|
|
53
53
|
context 'by title' do
|
@@ -5,11 +5,11 @@ describe Kinopoisk::Person, vcr: { cassette_name: 'people' } do
|
|
5
5
|
let(:person) { Kinopoisk::Person.new 13180 }
|
6
6
|
|
7
7
|
it 'should return right url' do
|
8
|
-
person.url.should eq('
|
8
|
+
person.url.should eq('https://www.kinopoisk.ru/name/13180/')
|
9
9
|
end
|
10
10
|
|
11
11
|
it { person.best_movies.should include('Карты, деньги, два ствола', 'Братья по оружию') }
|
12
|
-
it { person.poster.should eq('
|
12
|
+
it { person.poster.should eq('https://st.kp.yandex.net/images/actor_iphone/iphone360_13180.jpg') }
|
13
13
|
it { person.career.should eq(['Актер', 'Режиссер', 'Сценарист', 'Продюсер']) }
|
14
14
|
it { person.genres.should eq(['драма', 'комедия', 'криминал']) }
|
15
15
|
it { person.partner.should eq('Далия Ибельхауптайте') }
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kinopoisk_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RavWar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
139
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.4
|
140
|
+
rubygems_version: 2.6.4
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: Easily search and access information on kinopoisk.ru
|
@@ -146,4 +146,3 @@ test_files:
|
|
146
146
|
- spec/kinopoisk/person_spec.rb
|
147
147
|
- spec/kinopoisk/search_spec.rb
|
148
148
|
- spec/spec_helper.rb
|
149
|
-
has_rdoc:
|