niconize 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -22
- data/lib/niconize/reserve.rb +3 -2
- data/lib/niconize/version.rb +1 -1
- data/niconize.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6330930034913e9083f8f61d6b8c4a4120f0440
|
4
|
+
data.tar.gz: 5509c25d2af23b21233eb8ef3b01a150c83e5266
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ab920b4a8dd7ffde15466cdd9a073154aa9ab347006e8bde31c3ff66289d15689165446a77c54bb560527c6199323ccfbced6e0dfd6a9def1cd94d99a82e700
|
7
|
+
data.tar.gz: 66d54c933abe819485473a56bb5bc9bcceae0afd2c60315ff3afeaef34adcc980fa2e1af65df2a0ba470500fff21b511744cd833908fed289b1f041291951082
|
data/README.md
CHANGED
@@ -1,29 +1,12 @@
|
|
1
1
|
# Niconize
|
2
2
|
|
3
|
-
|
3
|
+
Wrapper of mechanize for [http://www.nicovideo.jp](http://www.nicovideo.jp)
|
4
4
|
|
5
|
-
##
|
6
|
-
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
gem 'niconize'
|
5
|
+
## Feature
|
10
6
|
|
11
|
-
|
7
|
+
- Login to nicovideo
|
8
|
+
- Timeshift reserve a niconico live
|
12
9
|
|
13
|
-
|
14
|
-
|
15
|
-
Or install it yourself as:
|
10
|
+
## Installation
|
16
11
|
|
17
12
|
$ gem install niconize
|
18
|
-
|
19
|
-
## Usage
|
20
|
-
|
21
|
-
TODO: Write usage instructions here
|
22
|
-
|
23
|
-
## Contributing
|
24
|
-
|
25
|
-
1. Fork it
|
26
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
-
5. Create new Pull Request
|
data/lib/niconize/reserve.rb
CHANGED
@@ -11,6 +11,7 @@ class Niconize
|
|
11
11
|
login unless @logined
|
12
12
|
response = @agent.get("http://live.nicovideo.jp/watch/#{lv}")
|
13
13
|
|
14
|
+
raise TimeshiftError, 'This nicolive is already reserved' if response.search('a.watching_reservation_reserved')
|
14
15
|
response.search('a.watching_reservation')[0]['onclick']
|
15
16
|
end
|
16
17
|
|
@@ -24,7 +25,7 @@ class Niconize
|
|
24
25
|
'token' => token
|
25
26
|
}
|
26
27
|
response = @agent.get(URL[:reserve], query)
|
27
|
-
raise
|
28
|
+
raise TimeshiftError, 'It is the limit of the number of your reservation' unless response.at('div.reserve')
|
28
29
|
response.at('div.reserve').inner_html.scan(/ulck_[0-9]+/)[0]
|
29
30
|
end
|
30
31
|
|
@@ -42,5 +43,5 @@ class Niconize
|
|
42
43
|
response = @agent.post(URL[:reserve], data)
|
43
44
|
end
|
44
45
|
|
45
|
-
class
|
46
|
+
class TimeshiftError < StandardError; end
|
46
47
|
end
|
data/lib/niconize/version.rb
CHANGED
data/niconize.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["neoen.gsn@gmail.com"]
|
11
11
|
spec.description = %q{wrapper of mechanize for nicovideo}
|
12
12
|
spec.summary = spec.description
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/tsuwatch/niconize"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: niconize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomohiro Suwa(tsuwatch)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
@@ -68,7 +68,7 @@ files:
|
|
68
68
|
- lib/niconize/reserve.rb
|
69
69
|
- lib/niconize/version.rb
|
70
70
|
- niconize.gemspec
|
71
|
-
homepage:
|
71
|
+
homepage: https://github.com/tsuwatch/niconize
|
72
72
|
licenses:
|
73
73
|
- MIT
|
74
74
|
metadata: {}
|