nicoquery 0.1.6.1 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/nicoquery/api/base.rb +6 -9
- data/lib/nicoquery/crawler/bulk_scraping.rb +2 -2
- data/lib/nicoquery/object/movie.rb +54 -25
- data/lib/nicoquery/object/mylist.rb +8 -4
- data/lib/nicoquery/object/tag_search.rb +2 -2
- data/lib/nicoquery/object_mapper/getthumbinfo.rb +16 -0
- data/lib/nicoquery/object_mapper/video_array.rb +8 -0
- data/lib/nicoquery/version.rb +1 -1
- data/spec/fixture/getthumbinfo_community.rb +7 -0
- data/spec/fixture/getthumbinfo_notfound.rb +13 -0
- data/spec/fixture/video_array_community.rb +9 -0
- data/spec/object/movie_spec.rb +77 -6
- data/spec/object/mylist_spec.rb +22 -6
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 892894c341bcd1e2a22b5483cdd92a4fa403e04c
|
4
|
+
data.tar.gz: aac4c5d4c0922f346d6edb4952b0361eabb71bf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b307defe02cbee30fe4e253bfbf67c6a320a5507e8ae9ec700008c1d81a88207de01a0cdd55d38a7fccddc5fbbd51bbd9ddb88bd4846d260fcb39a7b27a8aa60
|
7
|
+
data.tar.gz: fa01f1f31a6b5200d74be4612c46ca2cc65ed7ab785c725d09ad5d19ecaa738e0bd59145329042d2f3a72a8051356411ab96691c98851b9fbfffe737adc998c4
|
data/Gemfile.lock
CHANGED
data/lib/nicoquery/api/base.rb
CHANGED
@@ -29,16 +29,13 @@ module NicoQuery
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def get
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
response
|
37
|
-
when 403
|
38
|
-
@forbidden = true
|
39
|
-
response
|
40
|
-
end
|
32
|
+
res = nil
|
33
|
+
|
34
|
+
RestClient.get uri.to_s do |response|
|
35
|
+
res = response
|
41
36
|
end
|
37
|
+
|
38
|
+
{ body: res.to_s, headers: res.headers, status_code: res.code }
|
42
39
|
end
|
43
40
|
end
|
44
41
|
end
|
@@ -10,8 +10,8 @@ module NicoQuery
|
|
10
10
|
module BulkScraping
|
11
11
|
def execute(id_array, &block)
|
12
12
|
@movies = []
|
13
|
-
|
14
|
-
@hash = NicoQuery::ObjectMapper::VideoArray.new
|
13
|
+
response = (NicoQuery::Api::VideoArray.new id_array).get
|
14
|
+
@hash = NicoQuery::ObjectMapper::VideoArray.new response[:body]
|
15
15
|
|
16
16
|
@hash.movies.each do |movie|
|
17
17
|
m = NicoQuery::Object::Movie.new movie.video_id
|
@@ -8,8 +8,6 @@ module NicoQuery
|
|
8
8
|
attr_reader :video_id
|
9
9
|
|
10
10
|
[
|
11
|
-
'deleted?',
|
12
|
-
|
13
11
|
'title',
|
14
12
|
'url',
|
15
13
|
'thread_id',
|
@@ -21,15 +19,11 @@ module NicoQuery
|
|
21
19
|
].each do |field_name|
|
22
20
|
define_method(field_name) do
|
23
21
|
source =
|
24
|
-
@source[
|
25
|
-
@source[
|
26
|
-
@source[
|
27
|
-
@source[
|
28
|
-
Proc.new
|
29
|
-
source = (NicoQuery::Api::GetThumbInfo.new(@video_id || @thread_id)).get
|
30
|
-
set_getthumbinfo_source(NicoQuery::ObjectMapper::GetThumbInfo.new source)
|
31
|
-
end.call
|
32
|
-
|
22
|
+
@source[:mylist_rss].presence ||
|
23
|
+
@source[:tag_search_rss].presence ||
|
24
|
+
@source[:video_array].presence ||
|
25
|
+
@source[:getthumbinfo].presence ||
|
26
|
+
Proc.new { get_and_set_getthumbinfo_source; @source[:getthumbinfo] }.call
|
33
27
|
source.send field_name
|
34
28
|
end
|
35
29
|
end
|
@@ -47,40 +41,75 @@ module NicoQuery
|
|
47
41
|
].each do |field_name|
|
48
42
|
define_method(field_name) do
|
49
43
|
source =
|
50
|
-
@source[
|
51
|
-
@source[
|
52
|
-
Proc.new
|
53
|
-
source = (NicoQuery::Api::GetThumbInfo.new(@video_id || @thread_id)).get
|
54
|
-
set_getthumbinfo_source(NicoQuery::ObjectMapper::GetThumbInfo.new source)
|
55
|
-
end.call
|
44
|
+
@source[:getthumbinfo].presence ||
|
45
|
+
@source[:video_array].presence ||
|
46
|
+
Proc.new { get_and_set_getthumbinfo_source; @source[:getthumbinfo] }.call
|
56
47
|
|
57
48
|
source.send field_name
|
58
49
|
end
|
59
50
|
end
|
60
51
|
|
61
|
-
def initialize(
|
52
|
+
def initialize(video_id_or_thread_id)
|
62
53
|
@source = {}
|
63
|
-
|
64
|
-
|
54
|
+
@response = {}
|
55
|
+
|
56
|
+
if video_id_or_thread_id.to_s.match(/sm|nm/)
|
57
|
+
@video_id = video_id_or_thread_id
|
65
58
|
else
|
66
|
-
@thread_id =
|
59
|
+
@thread_id = video_id_or_thread_id
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def available?
|
64
|
+
[exist?, !deleted?].all?
|
65
|
+
end
|
66
|
+
|
67
|
+
def community?
|
68
|
+
unless @source[:video_array].present?
|
69
|
+
get_and_set_video_array_source
|
70
|
+
end
|
71
|
+
@source[:video_array].community?
|
72
|
+
end
|
73
|
+
|
74
|
+
def deleted?
|
75
|
+
unless @source[:getthumbinfo].present?
|
76
|
+
get_and_set_getthumbinfo_source
|
77
|
+
end
|
78
|
+
@source[:getthumbinfo].deleted?
|
79
|
+
end
|
80
|
+
|
81
|
+
def exist?
|
82
|
+
unless @source[:getthumbinfo].present?
|
83
|
+
get_and_set_getthumbinfo_source
|
67
84
|
end
|
85
|
+
@source[:getthumbinfo].exist?
|
68
86
|
end
|
69
87
|
|
70
88
|
def set_getthumbinfo_source(source_object)
|
71
|
-
@source[
|
89
|
+
@source[:getthumbinfo] ||= source_object
|
72
90
|
end
|
73
91
|
|
74
92
|
def set_mylist_rss_source(source_object)
|
75
|
-
@source[
|
93
|
+
@source[:mylist_rss] ||= source_object
|
76
94
|
end
|
77
95
|
|
78
96
|
def set_tag_search_rss_source(source_object)
|
79
|
-
@source[
|
97
|
+
@source[:tag_search_rss] ||= source_object
|
80
98
|
end
|
81
99
|
|
82
100
|
def set_video_array_source(source_object)
|
83
|
-
@source[
|
101
|
+
@source[:video_array] ||= source_object
|
102
|
+
end
|
103
|
+
|
104
|
+
def get_and_set_getthumbinfo_source
|
105
|
+
@response[:getthumbinfo] = (NicoQuery::Api::GetThumbInfo.new(@video_id || @thread_id)).get
|
106
|
+
set_getthumbinfo_source(NicoQuery::ObjectMapper::GetThumbInfo.new @response[:getthumbinfo][:body])
|
107
|
+
end
|
108
|
+
|
109
|
+
def get_and_set_video_array_source
|
110
|
+
@response[:video_array] = (NicoQuery::Api::VideoArray.new([@video_id || @thread_id])).get
|
111
|
+
parsed = (NicoQuery::ObjectMapper::VideoArray.new @response[:video_array][:body])
|
112
|
+
set_video_array_source parsed.movies[0]
|
84
113
|
end
|
85
114
|
end
|
86
115
|
end
|
@@ -24,8 +24,8 @@ module NicoQuery
|
|
24
24
|
def initialize(mylist_id)
|
25
25
|
@movies = []
|
26
26
|
@mylist_id = mylist_id
|
27
|
-
@
|
28
|
-
@hash = NicoQuery::ObjectMapper::MylistRSS.new @
|
27
|
+
@response = (NicoQuery::Api::MylistRSS.new mylist_id).get
|
28
|
+
@hash = NicoQuery::ObjectMapper::MylistRSS.new @response[:body]
|
29
29
|
|
30
30
|
return if @hash.items.nil?
|
31
31
|
@hash.items.map do |item|
|
@@ -36,11 +36,15 @@ module NicoQuery
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def available?
|
39
|
-
[!forbidden?].all?
|
39
|
+
[exist?, !forbidden?].all?
|
40
40
|
end
|
41
41
|
|
42
42
|
def forbidden?
|
43
|
-
@
|
43
|
+
@response[:status_code] == 403
|
44
|
+
end
|
45
|
+
|
46
|
+
def exist?
|
47
|
+
@response[:status_code] != 404
|
44
48
|
end
|
45
49
|
end
|
46
50
|
end
|
@@ -22,8 +22,8 @@ module NicoQuery
|
|
22
22
|
|
23
23
|
def initialize(tag: tag, sort: sort, order: order, page: page)
|
24
24
|
@movies = []
|
25
|
-
|
26
|
-
@hash = NicoQuery::ObjectMapper::TagSearchRss.new
|
25
|
+
response = (NicoQuery::Api::TagSearchRss.new(tag: tag, sort: sort, order: order, page: page)).get
|
26
|
+
@hash = NicoQuery::ObjectMapper::TagSearchRss.new response[:body]
|
27
27
|
|
28
28
|
@hash.items.map do |item|
|
29
29
|
movie = NicoQuery::Object::Movie.new item.video_id
|
@@ -20,6 +20,22 @@ module NicoQuery
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
def community?
|
24
|
+
if @parsed_xml['nicovideo_thumb_response']["error"].presence
|
25
|
+
@parsed_xml['nicovideo_thumb_response']["error"].presence["code"].presence == "COMMUNITY"
|
26
|
+
else
|
27
|
+
false
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def exist?
|
32
|
+
if @parsed_xml['nicovideo_thumb_response']["error"].presence
|
33
|
+
@parsed_xml['nicovideo_thumb_response']["error"].presence["code"].presence != "NOT_FOUND"
|
34
|
+
else
|
35
|
+
false
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
23
39
|
def video_id
|
24
40
|
return nil if @hash == nil
|
25
41
|
@hash['video_id']
|
@@ -31,6 +31,10 @@ module NicoQuery
|
|
31
31
|
@hash = parsed_xml
|
32
32
|
end
|
33
33
|
|
34
|
+
def community?
|
35
|
+
@hash['thread']['community_id'].present?
|
36
|
+
end
|
37
|
+
|
34
38
|
def video_id
|
35
39
|
@hash['video']['id']
|
36
40
|
end
|
@@ -84,6 +88,10 @@ module NicoQuery
|
|
84
88
|
@hash['video']['size_low'].to_i
|
85
89
|
end
|
86
90
|
|
91
|
+
def community_id
|
92
|
+
@hash['thread']['community_id'].to_i
|
93
|
+
end
|
94
|
+
|
87
95
|
def tags
|
88
96
|
@hash['tags']['tag_info'].each_with_object([]) do |tag, array|
|
89
97
|
array << { text: tag['tag'] }
|
data/lib/nicoquery/version.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
module Fixture
|
2
|
+
def self.getthumbinfo_notfound
|
3
|
+
<<-EOS
|
4
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
5
|
+
<nicovideo_thumb_response status="fail">
|
6
|
+
<error>
|
7
|
+
<code>NOT_FOUND</code>
|
8
|
+
<description>not found or invalid</description>
|
9
|
+
</error>
|
10
|
+
</nicovideo_thumb_response>
|
11
|
+
EOS
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module Fixture
|
2
|
+
def self.video_array_community
|
3
|
+
<<-EOS
|
4
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
5
|
+
<nicovideo_video_response status="ok"><count>1</count><video_info><video><id>sm19642625</id><deleted>0</deleted><title>BW2ランダムフリー戦記外伝・とうふサラダ抗争・前半【VSひややっこ氏】</title><description>最終回?ナンノコトカナー。今回はフレ戦の模様を余すことなくお送りいたします!<br />試験的にゆっくりさんを導入!前半は、2試合目までの内容となっております<br />相手様視点:【sm19641464】<br /><br /><br />とぅいったー https://twitter.com/musabe2 動画投稿の情報はこちらで!<br />前回【sm19479023】 マイリスト【mylist/32528876】 後半【sm19643040】</description><length_in_seconds>1118</length_in_seconds><size_low>55446451</size_low><movie_type>mp4</movie_type><thumbnail_url>http://tn-skr2.smilevideo.jp/smile?i=19642625</thumbnail_url><upload_time/><first_retrieve>2012-12-22T21:24:18+09:00</first_retrieve><default_thread>1356179058</default_thread><view_counter>493</view_counter><mylist_counter>1</mylist_counter><option_flag_ichiba>0</option_flag_ichiba><option_flag_community>0</option_flag_community><option_flag_domestic>0</option_flag_domestic><option_flag_comment_type>0</option_flag_comment_type><option_flag_adult>0</option_flag_adult><option_flag_mobile>0</option_flag_mobile><option_flag_economy_mp4>1</option_flag_economy_mp4><option_flag_middle_video>0</option_flag_middle_video><option_flag_mobile_ng_apple>0</option_flag_mobile_ng_apple></video><thread><id>1356179347</id><public>1</public><num_res>14</num_res><community_id>1233029</community_id></thread><tags><tag_info><tag>ゲーム</tag><area>jp</area></tag_info><tag_info><tag>ポケモンBW2</tag><area>jp</area></tag_info><tag_info><tag>ポケモンBW2対戦リンク</tag><area>jp</area></tag_info><tag_info><tag>ロズレイド</tag><area>jp</area></tag_info><tag_info><tag>ゆっくり実況プレイ</tag><area>jp</area></tag_info><tag_info><tag>ぬるぽvsガッ</tag><area>jp</area></tag_info><tag_info><tag>ゆっくりスボミー</tag><area>jp</area></tag_info></tags></video_info></nicovideo_video_response>
|
6
|
+
EOS
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
data/spec/object/movie_spec.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
require 'nicoquery/object/movie'
|
2
2
|
require 'fixture/getthumbinfo_deleted'
|
3
|
+
require 'fixture/getthumbinfo_community'
|
4
|
+
require 'fixture/video_array_community'
|
5
|
+
require 'fixture/getthumbinfo_notfound'
|
3
6
|
require 'webmock/rspec'
|
4
7
|
|
5
8
|
|
@@ -15,10 +18,8 @@ describe "NicoQuery::Object::Movie" do
|
|
15
18
|
subject { @movie }
|
16
19
|
|
17
20
|
describe "#deleted?" do
|
18
|
-
subject { @movie.deleted? }
|
19
|
-
|
20
21
|
it "returns false" do
|
21
|
-
expect(subject).to be_false
|
22
|
+
expect(subject.deleted?).to be_false
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
@@ -61,7 +62,7 @@ describe "NicoQuery::Object::Movie" do
|
|
61
62
|
end
|
62
63
|
end
|
63
64
|
|
64
|
-
context "when specified
|
65
|
+
context "when specified thread id and this movie is exist" do
|
65
66
|
before do
|
66
67
|
# thread_id:1173108780 == video_id:sm9
|
67
68
|
@movie = NicoQuery::Object::Movie.new(1173108780)
|
@@ -78,6 +79,7 @@ describe "NicoQuery::Object::Movie" do
|
|
78
79
|
|
79
80
|
context "when specified movie is deleted" do
|
80
81
|
before do
|
82
|
+
WebMock.enable!
|
81
83
|
WebMock.stub_request(:get, "http://ext.nicovideo.jp/api/getthumbinfo/sm999999?").
|
82
84
|
with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'User-Agent'=>'Ruby'}).
|
83
85
|
to_return(:status => 200, :body => Fixture.getthumbinfo_deleted, :headers => {})
|
@@ -85,13 +87,51 @@ describe "NicoQuery::Object::Movie" do
|
|
85
87
|
@movie = NicoQuery::Object::Movie.new('sm999999')
|
86
88
|
end
|
87
89
|
|
90
|
+
after do
|
91
|
+
WebMock.disable!
|
92
|
+
end
|
93
|
+
|
88
94
|
subject { @movie }
|
89
95
|
|
90
96
|
describe "#deleted?" do
|
91
|
-
|
97
|
+
it "returns true" do
|
98
|
+
expect(subject.deleted?).to be_true
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
describe "getter methods" do
|
103
|
+
specify "all returns nil" do
|
104
|
+
expect(subject.title).to be_nil
|
105
|
+
expect(subject.url).to be_nil
|
106
|
+
expect(subject.view_counter).to be_nil
|
107
|
+
expect(subject.tags).to be_nil
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
context "when specified movie belongs to community" do
|
113
|
+
before do
|
114
|
+
WebMock.enable!
|
115
|
+
WebMock.stub_request(:get, "http://ext.nicovideo.jp/api/getthumbinfo/sm99999901?").
|
116
|
+
with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'User-Agent'=>'Ruby'}).
|
117
|
+
to_return(:status => 200, :body => Fixture.getthumbinfo_community, :headers => {})
|
118
|
+
|
119
|
+
WebMock.stub_request(:get, "http://i.nicovideo.jp/v3/video.array?v=sm99999901").
|
120
|
+
with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'User-Agent'=>'Ruby'}).
|
121
|
+
to_return(:status => 200, :body => Fixture.video_array_community, :headers => {})
|
122
|
+
|
123
|
+
@movie = NicoQuery::Object::Movie.new('sm99999901')
|
124
|
+
end
|
125
|
+
|
126
|
+
after do
|
127
|
+
WebMock.disable!
|
128
|
+
end
|
129
|
+
|
130
|
+
subject { @movie }
|
92
131
|
|
132
|
+
describe "#community?" do
|
93
133
|
it "returns true" do
|
94
|
-
expect(subject).to be_true
|
134
|
+
expect(subject.community?).to be_true
|
95
135
|
end
|
96
136
|
end
|
97
137
|
|
@@ -103,6 +143,37 @@ describe "NicoQuery::Object::Movie" do
|
|
103
143
|
expect(subject.tags).to be_nil
|
104
144
|
end
|
105
145
|
end
|
146
|
+
end
|
147
|
+
|
148
|
+
context "when specified movie doesn't exist" do
|
149
|
+
before do
|
150
|
+
WebMock.enable!
|
151
|
+
WebMock.stub_request(:get, "http://ext.nicovideo.jp/api/getthumbinfo/sm99999901?").
|
152
|
+
with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'User-Agent'=>'Ruby'}).
|
153
|
+
to_return(:status => 200, :body => Fixture.getthumbinfo_notfound, :headers => {})
|
154
|
+
|
155
|
+
@movie = NicoQuery::Object::Movie.new('sm99999901')
|
156
|
+
end
|
157
|
+
|
158
|
+
after do
|
159
|
+
WebMock.disable!
|
160
|
+
end
|
161
|
+
|
162
|
+
subject { @movie }
|
106
163
|
|
164
|
+
describe "#exist?" do
|
165
|
+
it "returns false" do
|
166
|
+
expect(subject.exist?).to be_false
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
describe "getter methods" do
|
171
|
+
specify "all returns nil" do
|
172
|
+
expect(subject.title).to be_nil
|
173
|
+
expect(subject.url).to be_nil
|
174
|
+
expect(subject.view_counter).to be_nil
|
175
|
+
expect(subject.tags).to be_nil
|
176
|
+
end
|
177
|
+
end
|
107
178
|
end
|
108
179
|
end
|
data/spec/object/mylist_spec.rb
CHANGED
@@ -11,41 +11,51 @@ describe "NicoQuery::Object::Mylist" do
|
|
11
11
|
@mylist = NicoQuery::Object::Mylist.new(38369702)
|
12
12
|
end
|
13
13
|
|
14
|
+
subject { @mylist }
|
15
|
+
|
14
16
|
describe "movies" do
|
15
17
|
it "returns movie instances" do
|
16
|
-
expect(
|
17
|
-
expect(
|
18
|
+
expect(subject.movies).to be_an_instance_of Array
|
19
|
+
expect(subject.movies[0]).to be_an_instance_of NicoQuery::Object::Movie
|
18
20
|
end
|
19
21
|
end
|
20
22
|
|
21
23
|
describe "title" do
|
22
|
-
subject { @mylist }
|
23
24
|
it "returns string of title" do
|
24
25
|
expect(subject.title).to eq "to_test"
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
28
29
|
describe "url" do
|
29
|
-
subject { @mylist }
|
30
30
|
it "returns string of url" do
|
31
31
|
expect(subject.url).to eq "http://www.nicovideo.jp/mylist/38369702"
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
35
|
describe "mylist_id" do
|
36
|
-
subject { @mylist }
|
37
36
|
it "returns number of mylist_id" do
|
38
37
|
expect(subject.mylist_id).to eq 38369702
|
39
38
|
end
|
40
39
|
end
|
41
40
|
|
42
41
|
describe "description" do
|
43
|
-
subject { @mylist }
|
44
42
|
it "returns string of title" do
|
45
43
|
# mylistのrssでは、descriptionの全文取得はできず、頭から256文字までしか取得できない。
|
46
44
|
expect(subject.description).to eq "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam cursus. Morbi ut mi. Nullam enim leo, egestas id, condimentum at, laoreet mattis, massa. Sed eleifend nonummy diam. Praesent mauris ante, elementum et, bibendum at, posuere sit amet, nibh. Duis "
|
47
45
|
end
|
48
46
|
end
|
47
|
+
|
48
|
+
describe "#available?" do
|
49
|
+
it "returns true" do
|
50
|
+
expect(subject.available?).to be_true
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe "#exist?" do
|
55
|
+
it "returns true" do
|
56
|
+
expect(subject.exist?).to be_true
|
57
|
+
end
|
58
|
+
end
|
49
59
|
end
|
50
60
|
|
51
61
|
context "when access for specified mylist is forbidden" do
|
@@ -75,6 +85,12 @@ describe "NicoQuery::Object::Mylist" do
|
|
75
85
|
end
|
76
86
|
end
|
77
87
|
|
88
|
+
describe "#exist?" do
|
89
|
+
it "returns true" do
|
90
|
+
expect(subject.exist?).to be_true
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
78
94
|
describe "getter methods" do
|
79
95
|
specify "all returns nil" do
|
80
96
|
# タイトルだけは非公開でも取得できる?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nicoquery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masami Yonehara
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -253,7 +253,9 @@ files:
|
|
253
253
|
- spec/api/video_array_spec.rb
|
254
254
|
- spec/crawler/bulk_scraping_spec.rb
|
255
255
|
- spec/crawler/tag_search_spec.rb
|
256
|
+
- spec/fixture/getthumbinfo_community.rb
|
256
257
|
- spec/fixture/getthumbinfo_deleted.rb
|
258
|
+
- spec/fixture/getthumbinfo_notfound.rb
|
257
259
|
- spec/fixture/getthumbinfo_sm20415650.rb
|
258
260
|
- spec/fixture/mylist_rss_18266317.rb
|
259
261
|
- spec/fixture/mylist_rss_403.rb
|
@@ -261,6 +263,7 @@ files:
|
|
261
263
|
- spec/fixture/tag_search_403.rb
|
262
264
|
- spec/fixture/tag_search_item.rb
|
263
265
|
- spec/fixture/tag_search_meta.rb
|
266
|
+
- spec/fixture/video_array_community.rb
|
264
267
|
- spec/fixture/video_array_sm20415650_sm9.rb
|
265
268
|
- spec/nicoquery_spec.rb
|
266
269
|
- spec/object/movie_spec.rb
|
@@ -301,7 +304,9 @@ test_files:
|
|
301
304
|
- spec/api/video_array_spec.rb
|
302
305
|
- spec/crawler/bulk_scraping_spec.rb
|
303
306
|
- spec/crawler/tag_search_spec.rb
|
307
|
+
- spec/fixture/getthumbinfo_community.rb
|
304
308
|
- spec/fixture/getthumbinfo_deleted.rb
|
309
|
+
- spec/fixture/getthumbinfo_notfound.rb
|
305
310
|
- spec/fixture/getthumbinfo_sm20415650.rb
|
306
311
|
- spec/fixture/mylist_rss_18266317.rb
|
307
312
|
- spec/fixture/mylist_rss_403.rb
|
@@ -309,6 +314,7 @@ test_files:
|
|
309
314
|
- spec/fixture/tag_search_403.rb
|
310
315
|
- spec/fixture/tag_search_item.rb
|
311
316
|
- spec/fixture/tag_search_meta.rb
|
317
|
+
- spec/fixture/video_array_community.rb
|
312
318
|
- spec/fixture/video_array_sm20415650_sm9.rb
|
313
319
|
- spec/nicoquery_spec.rb
|
314
320
|
- spec/object/movie_spec.rb
|