shangrila 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -1
- data/bin/anime-api +5 -1
- data/lib/shangrila/sana.rb +2 -1
- data/lib/shangrila/sora.rb +4 -4
- data/lib/shangrila/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 743586030befdeadefa543c1f2d90799e1658282
|
4
|
+
data.tar.gz: 6022cac914f2ca32da6b6850d667c5613227741a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bc527c867fb2806309dd8573323496ccf332ddd9aadc97a22d92164801657986dde8faea220845221a8616197ce77b33c989746bbf6a38d55c4ece3b6f66d6f
|
7
|
+
data.tar.gz: 14daac15063a0757e7df2791ceafd76aecaba2f62a0fa3c55383bee82c27755da3187c77c8bf3147a59370f2259b84005d04f36c78b5fcddb1bf2f8867335141
|
data/README.md
CHANGED
@@ -8,7 +8,19 @@ or Gemfile
|
|
8
8
|
|
9
9
|
``gem 'shangrila'``
|
10
10
|
|
11
|
-
##
|
11
|
+
## anime-api command
|
12
|
+
|
13
|
+
```
|
14
|
+
shell$ anime-api -h
|
15
|
+
Usage: anime-api [options]
|
16
|
+
-c COURS anime cours..1=winter or 2=spring or 3=summer or 4=autumn
|
17
|
+
-y YEAR year...2014 <= ?
|
18
|
+
-s connect standby_server. default=moemoe.tokyo standby=api.tv-anime.biz
|
19
|
+
|
20
|
+
shell$ anime-api -y 2016 -c 4 | jq .
|
21
|
+
```
|
22
|
+
|
23
|
+
## gem Usage
|
12
24
|
|
13
25
|
### Master API
|
14
26
|
|
data/bin/anime-api
CHANGED
data/lib/shangrila/sana.rb
CHANGED
@@ -8,7 +8,8 @@ module Shangrila
|
|
8
8
|
class Sana
|
9
9
|
URL = 'http://api.moemoe.tokyo/anime/v1/twitter'
|
10
10
|
|
11
|
-
def initialize
|
11
|
+
def initialize(hostname = 'api.moemoe.tokyo')
|
12
|
+
@url = "http://#{hostname}/anime/v1/master"
|
12
13
|
end
|
13
14
|
|
14
15
|
# @param [Array] accounts データ取得対象のアニメTwitter公式アカウント
|
data/lib/shangrila/sora.rb
CHANGED
@@ -6,16 +6,16 @@ require 'httpclient'
|
|
6
6
|
module Shangrila
|
7
7
|
|
8
8
|
class Sora
|
9
|
-
URL = 'http://api.moemoe.tokyo/anime/v1/master'
|
10
9
|
|
11
|
-
def initialize
|
10
|
+
def initialize(hostname = 'api.moemoe.tokyo')
|
11
|
+
@url = "http://#{hostname}/anime/v1/master"
|
12
12
|
end
|
13
13
|
|
14
14
|
# @param [Int] year データ取得対象のアニメの年
|
15
15
|
# @param [Int] cours データ取得対象のアニメの年のクール番号 1-4
|
16
16
|
# @return [JSON] アニメのマスターデータすべて
|
17
17
|
def get_master_data_raw(year, cours)
|
18
|
-
response = HTTPClient.get(sprintf("%s/%s/%s",
|
18
|
+
response = HTTPClient.get(sprintf("%s/%s/%s", @url, year, cours))
|
19
19
|
response.body
|
20
20
|
end
|
21
21
|
|
@@ -23,7 +23,7 @@ module Shangrila
|
|
23
23
|
# @param [Int] cours データ取得対象のアニメの年のクール番号 1-4
|
24
24
|
# @return [JSON->RubyHash] アニメのマスターデータすべて
|
25
25
|
def get_master_data(year, cours)
|
26
|
-
response = HTTPClient.get(sprintf("%s/%s/%s",
|
26
|
+
response = HTTPClient.get(sprintf("%s/%s/%s", @url, year, cours))
|
27
27
|
JSON.load(response.body)
|
28
28
|
end
|
29
29
|
|
data/lib/shangrila/version.rb
CHANGED