nicoscraper 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +189 -90
- data/VERSION +1 -1
- data/index.html +0 -0
- data/lib/connector.rb +5 -2
- data/lib/converter.rb +7 -3
- data/lib/movie.rb +312 -91
- data/lib/mylist.rb +110 -16
- data/lib/namespace.rb +3 -0
- data/lib/parser.rb +14 -4
- data/lib/searcher.rb +108 -22
- data/nicoscraper.gemspec +4 -6
- data/test/movie_spec.rb +50 -9
- metadata +4 -6
- data/README.rdoc +0 -19
- data/lib/nicos.rb +0 -9
- data/lib/nicoscraper.rb +0 -6
data/test/movie_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
$:.unshift File.dirname(__FILE__) + "/../lib"
|
3
3
|
|
4
|
-
require '
|
4
|
+
require 'nicoscraper'
|
5
5
|
|
6
6
|
describe Nicos::Movie, "After executiton of 'getInfo' method" do
|
7
7
|
before(:all) do
|
@@ -55,10 +55,10 @@ describe Nicos::Movie, "when access with non-existent video_id" do
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
describe Nicos::Mylist, "After executiton of '
|
58
|
+
describe Nicos::Mylist, "After executiton of 'getInfo' method" do
|
59
59
|
before(:all) do
|
60
60
|
@mylist = Nicos::Mylist.new(15196568)
|
61
|
-
@mylist.
|
61
|
+
@mylist.getInfo
|
62
62
|
puts @mylist
|
63
63
|
end
|
64
64
|
|
@@ -88,13 +88,54 @@ describe Nicos::Mylist, "After executiton of 'getInfoLt' method" do
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
|
-
describe "When execute '
|
91
|
+
describe "When execute 'Nicos::Searcher::ByTag.execute' method " +
|
92
|
+
"and return a string except \"continue\" in this block" do
|
93
|
+
before(:all) do
|
94
|
+
searcher = Nicos::Searcher::ByTag.new()
|
95
|
+
@count = 0
|
96
|
+
|
97
|
+
searcher.execute("ゆっくり実況プレイpart1リンク", "post_old", nil) { |result|
|
98
|
+
@count += 1
|
99
|
+
"not continue"
|
100
|
+
}
|
101
|
+
end
|
102
|
+
|
103
|
+
it "should end only one access." do
|
104
|
+
@count.should == 1
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
describe "When execute 'Nicos::Searcher::ByTag.execute' method " +
|
109
|
+
"and return a string except \"continue\" in this block" do
|
110
|
+
before(:all) do
|
111
|
+
searcher = Nicos::Searcher::ByTag.new()
|
112
|
+
@count = 0
|
113
|
+
|
114
|
+
searcher.execute("ゆっくり実況プレイpart1リンク", "post_old", nil) { |result|
|
115
|
+
@count += 1
|
116
|
+
nil
|
117
|
+
}
|
118
|
+
end
|
119
|
+
|
120
|
+
it "should end only one access." do
|
121
|
+
@count.should == 1
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
describe "When execute 'Nicos::Searcher::ByTag.execute' method " +
|
92
126
|
"passing following argument" do
|
93
127
|
before(:all) do
|
94
|
-
searcher = Nicos::Searcher::
|
128
|
+
searcher = Nicos::Searcher::ByTag.new()
|
129
|
+
count = 0
|
130
|
+
|
95
131
|
searcher.execute("ゆっくり実況プレイpart1リンク", "post_old", nil) { |result|
|
96
132
|
@result = result
|
133
|
+
|
134
|
+
count += 1
|
135
|
+
puts count
|
136
|
+
"continue" unless count >= 3
|
97
137
|
}
|
138
|
+
puts "end"
|
98
139
|
end
|
99
140
|
|
100
141
|
it "should have Array of movie objects." do
|
@@ -107,13 +148,13 @@ describe "When execute 'SearchByTagLt.execute' method " +
|
|
107
148
|
|
108
149
|
@result[0].video_id .should_not be_nil
|
109
150
|
@result[0].title .should_not be_nil
|
110
|
-
@result[0].
|
111
|
-
@result[0].
|
151
|
+
@result[0].create_time .should_not be_nil
|
152
|
+
@result[0].update_time .should_not be_nil
|
112
153
|
#@result[0].memo .should_not be_nil
|
113
154
|
@result[0].description .should_not be_nil
|
114
155
|
@result[0].thumbnail_url.should_not be_nil
|
115
|
-
@result[0].
|
116
|
-
@result[0].
|
156
|
+
@result[0].create_time .should_not be_nil
|
157
|
+
@result[0].update_time .should_not be_nil
|
117
158
|
@result[0].length .should_not be_nil
|
118
159
|
|
119
160
|
@result[0].view_counter .should_not be_nil
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: nicoscraper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Masami Yonehara
|
@@ -87,22 +87,20 @@ extensions: []
|
|
87
87
|
extra_rdoc_files:
|
88
88
|
- LICENSE.txt
|
89
89
|
- README.md
|
90
|
-
- README.rdoc
|
91
90
|
files:
|
92
91
|
- .document
|
93
92
|
- Gemfile
|
94
93
|
- Gemfile.lock
|
95
94
|
- LICENSE.txt
|
96
95
|
- README.md
|
97
|
-
- README.rdoc
|
98
96
|
- Rakefile
|
99
97
|
- VERSION
|
98
|
+
- index.html
|
100
99
|
- lib/connector.rb
|
101
100
|
- lib/converter.rb
|
102
101
|
- lib/movie.rb
|
103
102
|
- lib/mylist.rb
|
104
|
-
- lib/
|
105
|
-
- lib/nicoscraper.rb
|
103
|
+
- lib/namespace.rb
|
106
104
|
- lib/parser.rb
|
107
105
|
- lib/searcher.rb
|
108
106
|
- nicoscraper.gemspec
|
@@ -120,7 +118,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
120
118
|
requirements:
|
121
119
|
- - ">="
|
122
120
|
- !ruby/object:Gem::Version
|
123
|
-
hash:
|
121
|
+
hash: 893829155072320695
|
124
122
|
segments:
|
125
123
|
- 0
|
126
124
|
version: "0"
|
data/README.rdoc
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
= nicoscraper
|
2
|
-
|
3
|
-
Description goes here.
|
4
|
-
|
5
|
-
== Contributing to nicoscraper
|
6
|
-
|
7
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
8
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
9
|
-
* Fork the project
|
10
|
-
* Start a feature/bugfix branch
|
11
|
-
* Commit and push until you are happy with your contribution
|
12
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
-
|
15
|
-
== Copyright
|
16
|
-
|
17
|
-
Copyright (c) 2011 Masami Yonehara. See LICENSE.txt for
|
18
|
-
further details.
|
19
|
-
|
data/lib/nicos.rb
DELETED