nicoapi 0.0.4.1 → 0.0.6
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/Gemfile +0 -2
- data/Gemfile.lock +1 -2
- data/README.md +4 -4
- data/lib/nicoapi/base.rb +3 -2
- data/lib/nicoapi/getthumbinfo.rb +2 -2
- data/lib/nicoapi/http_client.rb +3 -4
- data/lib/nicoapi/tag_search.rb +2 -2
- data/lib/nicoapi/version.rb +1 -1
- data/lib/nicoapi/video_array.rb +4 -3
- data/lib/nicoapi.rb +7 -10
- data/nicoapi.gemspec +1 -1
- data/spec/getthumbinfo_spec.rb +2 -3
- data/spec/tag_search_spec.rb +5 -3
- data/spec/video_array_spec.rb +3 -4
- metadata +2 -5
- data/lib/nicoapi/mylist.rb +0 -31
- data/spec/mylist_spec.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a55070e52bd1ba3b43715c130aa183412f409bf8
|
4
|
+
data.tar.gz: a41bb5eeed230f137c98cbdee457213eb8c7cdf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfed0747d94957ae7cd76eb1a2c48c1722299cd2a6e2e192d6476e4591fdf75d901f5b59045626317ddc506c59e22f2d007443640225ff4658003cbb982dbdbb
|
7
|
+
data.tar.gz: 26297ac2b634cd0f3b3ce504ec8bfe86ce099b473ca14de21a8754c2ef2864854f567651d2e66749831d46ead1ea18eeffdb345d1f2cbdc5cd7f1bab0af4f279
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
[](http://travis-ci.org/hdemon/nicoapi-core)
|
2
2
|
|
3
|
-
#
|
3
|
+
# Nicoapi::Core
|
4
4
|
|
5
5
|
TODO: Write a gem description
|
6
6
|
|
@@ -8,7 +8,7 @@ TODO: Write a gem description
|
|
8
8
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
|
-
gem '
|
11
|
+
gem 'nicoapi-core'
|
12
12
|
|
13
13
|
And then execute:
|
14
14
|
|
@@ -16,7 +16,7 @@ And then execute:
|
|
16
16
|
|
17
17
|
Or install it yourself as:
|
18
18
|
|
19
|
-
$ gem install
|
19
|
+
$ gem install nicoapi-core
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
data/lib/nicoapi/base.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'nicoapi/http_client'
|
2
2
|
|
3
3
|
|
4
4
|
module NicoAPI
|
@@ -25,9 +25,10 @@ module NicoAPI
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def get
|
28
|
-
http_client = NicoAPI::HttpClient.
|
28
|
+
http_client = NicoAPI::HttpClient.new
|
29
29
|
http_client.set_params uri.to_s
|
30
30
|
http_client.get
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
34
|
+
|
data/lib/nicoapi/getthumbinfo.rb
CHANGED
data/lib/nicoapi/http_client.rb
CHANGED
data/lib/nicoapi/tag_search.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'active_support/core_ext'
|
2
|
-
require '
|
2
|
+
require 'nicoapi/base'
|
3
3
|
|
4
4
|
|
5
5
|
module NicoAPI
|
6
6
|
class TagSearch
|
7
7
|
include NicoAPI::Base
|
8
8
|
|
9
|
-
def
|
9
|
+
def initialize(tag: tag, sort: sort, order: order, page: page)
|
10
10
|
@dynamic_segment = tag
|
11
11
|
@params_array = params_array(sort, order, page)
|
12
12
|
end
|
data/lib/nicoapi/version.rb
CHANGED
data/lib/nicoapi/video_array.rb
CHANGED
@@ -1,13 +1,14 @@
|
|
1
|
-
require '
|
1
|
+
require 'nicoapi/base'
|
2
2
|
|
3
3
|
|
4
4
|
module NicoAPI
|
5
5
|
class VideoArray
|
6
6
|
include NicoAPI::Base
|
7
7
|
|
8
|
-
def
|
8
|
+
def initialize(video_id_array)
|
9
|
+
@video_id_array = video_id_array
|
9
10
|
@dynamic_segment = ''
|
10
|
-
@params_array = params_array video_id_array
|
11
|
+
@params_array = params_array @video_id_array
|
11
12
|
end
|
12
13
|
|
13
14
|
private
|
data/lib/nicoapi.rb
CHANGED
@@ -1,26 +1,23 @@
|
|
1
|
-
require
|
1
|
+
require 'nicoapi/version'
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
3
|
+
require 'nicoapi/getthumbinfo'
|
4
|
+
require 'nicoapi/tag_search'
|
5
|
+
require 'nicoapi/video_array'
|
6
6
|
|
7
7
|
|
8
8
|
module NicoAPI
|
9
9
|
def getthumbinfo(video_id)
|
10
|
-
instance = NicoAPI::GetThumbInfo.new
|
11
|
-
instance.set video_id
|
10
|
+
instance = NicoAPI::GetThumbInfo.new video_id
|
12
11
|
instance.get
|
13
12
|
end
|
14
13
|
|
15
14
|
def video_array(video_id_array)
|
16
|
-
instance = NicoAPI::VideoArray.new
|
17
|
-
instance.set video_id_array
|
15
|
+
instance = NicoAPI::VideoArray.new video_id_array
|
18
16
|
instance.get
|
19
17
|
end
|
20
18
|
|
21
19
|
def tag_search(tag: tag, sort: sort, order: order, page: page)
|
22
|
-
instance = NicoAPI::TagSearch.new
|
23
|
-
instance.set tag: tag, sort: sort, order: order, page: page
|
20
|
+
instance = NicoAPI::TagSearch.new tag: tag, sort: sort, order: order, page: page
|
24
21
|
instance.get
|
25
22
|
end
|
26
23
|
|
data/nicoapi.gemspec
CHANGED
data/spec/getthumbinfo_spec.rb
CHANGED
data/spec/tag_search_spec.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
-
require '
|
1
|
+
require 'nicoapi/tag_search'
|
2
2
|
|
3
3
|
|
4
4
|
describe "tag_search" do
|
5
5
|
before do
|
6
|
-
@instance = NicoAPI::TagSearch.new
|
7
|
-
|
6
|
+
@instance = NicoAPI::TagSearch.new tag: 'ゆっくり実況プレイ',
|
7
|
+
sort: :published_at,
|
8
|
+
order: :asc,
|
9
|
+
page: 1
|
8
10
|
end
|
9
11
|
|
10
12
|
describe "uri" do
|
data/spec/video_array_spec.rb
CHANGED
@@ -1,10 +1,9 @@
|
|
1
|
-
require '
|
1
|
+
require 'nicoapi/video_array'
|
2
2
|
|
3
3
|
|
4
4
|
describe "VideoArray" do
|
5
5
|
before do
|
6
|
-
@instance = NicoAPI::VideoArray.new
|
7
|
-
@instance.set ['sm9', 'sm14']
|
6
|
+
@instance = NicoAPI::VideoArray.new ['sm9', 'sm14']
|
8
7
|
end
|
9
8
|
|
10
9
|
describe "uri" do
|
@@ -13,4 +12,4 @@ describe "VideoArray" do
|
|
13
12
|
expect(subject).to match /http:\/\/i\.nicovideo\.jp\/v3\/video\.array\?v=((sm\d|nm\d),{0,}){1,}/
|
14
13
|
}
|
15
14
|
end
|
16
|
-
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nicoapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
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-08-
|
11
|
+
date: 2013-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -142,13 +142,11 @@ files:
|
|
142
142
|
- lib/nicoapi/getthumbinfo.rb
|
143
143
|
- lib/nicoapi/hash_mapper.rb
|
144
144
|
- lib/nicoapi/http_client.rb
|
145
|
-
- lib/nicoapi/mylist.rb
|
146
145
|
- lib/nicoapi/tag_search.rb
|
147
146
|
- lib/nicoapi/version.rb
|
148
147
|
- lib/nicoapi/video_array.rb
|
149
148
|
- nicoapi.gemspec
|
150
149
|
- spec/getthumbinfo_spec.rb
|
151
|
-
- spec/mylist_spec.rb
|
152
150
|
- spec/spec_helper.rb
|
153
151
|
- spec/tag_search_spec.rb
|
154
152
|
- spec/video_array_spec.rb
|
@@ -178,7 +176,6 @@ specification_version: 4
|
|
178
176
|
summary: niconico low level api library
|
179
177
|
test_files:
|
180
178
|
- spec/getthumbinfo_spec.rb
|
181
|
-
- spec/mylist_spec.rb
|
182
179
|
- spec/spec_helper.rb
|
183
180
|
- spec/tag_search_spec.rb
|
184
181
|
- spec/video_array_spec.rb
|
data/lib/nicoapi/mylist.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
require 'active_support/core_ext'
|
2
|
-
require 'NicoAPI/base'
|
3
|
-
|
4
|
-
|
5
|
-
module NicoAPI
|
6
|
-
class Mylist
|
7
|
-
include NicoAPI::Base
|
8
|
-
|
9
|
-
def set(mylist_id: mylist_id)
|
10
|
-
@dynamic_segment = mylist_id
|
11
|
-
@params_array = params_array
|
12
|
-
end
|
13
|
-
|
14
|
-
private
|
15
|
-
def host
|
16
|
-
'www.nicovideo.jp'
|
17
|
-
end
|
18
|
-
|
19
|
-
def static_segment
|
20
|
-
'mylist'
|
21
|
-
end
|
22
|
-
|
23
|
-
def params_array
|
24
|
-
[format]
|
25
|
-
end
|
26
|
-
|
27
|
-
def format
|
28
|
-
"rss=2.0"
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
data/spec/mylist_spec.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'NicoAPI/mylist'
|
2
|
-
|
3
|
-
|
4
|
-
describe "mylist" do
|
5
|
-
before do
|
6
|
-
@instance = NicoAPI::Mylist.new
|
7
|
-
@instance.set mylist_id: "12345678"
|
8
|
-
end
|
9
|
-
|
10
|
-
describe "uri" do
|
11
|
-
subject { @instance.uri }
|
12
|
-
|
13
|
-
specify { expect(subject).to match /http:\/\/www\.nicovideo\.jp\/mylist/ }
|
14
|
-
|
15
|
-
specify { expect(subject).to match /12345678/ }
|
16
|
-
specify { expect(subject).to match /rss\=2\.0/ }
|
17
|
-
end
|
18
|
-
end
|