twicas_stream 1.1.1 → 1.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 431b96ece0e9f78b23280df634aad1f2adba3767
4
- data.tar.gz: 85b5faf76044f7916c3c028b8a2e211732e64d5e
3
+ metadata.gz: 5662ec6c489c009b1b71b2a9e860000b5ca92b89
4
+ data.tar.gz: 0ce1a545d0105013d63da36b6e9518f7ded718bc
5
5
  SHA512:
6
- metadata.gz: 48b1da24ef9b1103c87750731f0277b74e4a8ac5a3dcf6dd8299ba16212e82ab4a0425724b6998757bfbee07b185ae13e414a05d71333ea034a09312e056a5b0
7
- data.tar.gz: 70da8a7811004f5e303ee0c4c8bc4483510a8a78d60dcbdc2ebb778c722466f4c656bf8ab11699120226d23cfef3f22cb7ad32373d2120f07c06861059d7459d
6
+ metadata.gz: 2dc78eafac69d2224ff7f45066b7f2d9e90a222b0b8d814aac5468c9112b832536eee73f0541a007f39bc7cb905b89a3c98c73d243a9fc636f80c4ec520c7b4e
7
+ data.tar.gz: 6db259451b0978e2015cdadbe0a00b36fe21947139b8b2967ed507667cd805015fc58a7e3173298926978a54dc00de4f62b47663119662578ae2af02ddc37500
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## v1.2.0
2
+ [full changelog](http://github.com/ysato5654/twicas_stream/compare/v1.1.1...v1.2.0)
3
+
4
+ * change request interface
5
+ * Get Comments
6
+ - define the minimum value of slice_id
7
+ * change response data
8
+ * Get User Info
9
+ - add supporter_count and supporting_count
10
+ * the following value of User object are deprecated, and all are always '0'
11
+ - created
12
+ - supporter_count
13
+ - supporting_count
14
+
1
15
  ## v1.1.1
2
16
  [full changelog](http://github.com/ysato5654/twicas_stream/compare/v1.1.0...v1.1.1)
3
17
 
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # twicas_stream
6
6
 
7
- [twicas_stream](https://rubygems.org/gems/twicas_stream) provides simple Ruby access to [TwitCasting](https://twitcasting.tv/) API.
7
+ [twicas_stream](https://rubygems.org/gems/twicas_stream) provides simple Ruby access to [TwitCasting](https://twitcasting.tv/) APIv2(β).
8
8
 
9
9
  ## Installation
10
10
 
@@ -119,6 +119,76 @@ Current version supports following requests.
119
119
 
120
120
  (*) 'POST/DELETE/PUT' HTTP method. Current version supports 'GET' method only.
121
121
 
122
+ ## Response Data Structure
123
+
124
+ Response data of 'Get User Info' is as below.
125
+
126
+ ```rb
127
+ {
128
+ :supporter_count => 10,
129
+ :supporting_count => 24,
130
+ :user => {
131
+ :id => "182224938",
132
+ :screen_id => "twitcasting_jp",
133
+ :name => "ツイキャス公式",
134
+ :image => "http://202-234-44-53.moi.st/image3s/pbs.twimg.com/profile_images/613625726512705536/GLlBoXcS_normal.png",
135
+ :profile => "ツイキャスの公式アカウントです。ツイキャスに関するお知らせなどを投稿します。なお、お問い合わせは https://t.co/4gCf7XVm7N までお願いします。公式Facebookページhttps://t.co/bxYVwpzTJB\n公式Instagram\nhttps://t.co/Bm2O2J2Kfs",
136
+ :level => 24,
137
+ :last_movie_id => "189037369",
138
+ :is_live => false,
139
+ :supporter_count => 0,
140
+ :supporting_count => 0,
141
+ :created => 0
142
+ }
143
+ }
144
+ ```
145
+
146
+ 'Get Movie Info' is as below.
147
+
148
+ ```rb
149
+ {
150
+ :movie => {
151
+ :id => "189037369",
152
+ :user_id => "182224938",
153
+ :title => "ライブ #189037369",
154
+ :subtitle => "ライブ配信中!",
155
+ :last_owner_comment => "もいもい",
156
+ :category => "girls_jcjk_jp",
157
+ :link => "http://twitcasting.tv/twitcasting_jp/movie/189037369",
158
+ :is_live => false,
159
+ :is_recorded => false,
160
+ :comment_count => 2124,
161
+ :large_thumbnail => "http://202-230-12-92.twitcasting.tv/image3/image.twitcasting.tv/image55_1/39/7b/0b447b39-1.jpg",
162
+ :small_thumbnail => "http://202-230-12-92.twitcasting.tv/image3/image.twitcasting.tv/image55_1/39/7b/0b447b39-1-s.jpg",
163
+ :country => "jp",
164
+ :duration => 1186,
165
+ :created => 1438500282,
166
+ :is_collabo => false,
167
+ :is_protected => false,
168
+ :max_view_count => 1675,
169
+ :current_view_count => 20848,
170
+ :total_view_count => 20848,
171
+ :hls_url => "http://twitcasting.tv/twitcasting_jp/metastream.m3u8/?video=1"
172
+ },
173
+ :broadcaster => {
174
+ :id => "182224938",
175
+ :screen_id => "twitcasting_jp",
176
+ :name => "ツイキャス公式",
177
+ :image => "http://202-234-44-53.moi.st/image3s/pbs.twimg.com/profile_images/613625726512705536/GLlBoXcS_normal.png",
178
+ :profile => "ツイキャスの公式アカウントです。ツイキャスに関するお知らせなどを投稿します。なお、お問い合わせは https://t.co/4gCf7XVm7N までお願いします。公式Facebookページ:ttps://t.co/bxYVwpzTJB\n公式Instagram\nhttps://t.co/Bm2O2J2Kfs",
179
+ :level => 24,
180
+ :last_movie_id => "189037369",
181
+ :is_live => true,
182
+ :supporter_count => 0,
183
+ :supporting_count => 0,
184
+ :created => 0
185
+ },
186
+ :tags => ["人気", "コンティニュー中", "レベル40+", "初見さん大歓迎", "まったり", "雑談"]
187
+ }
188
+ ```
189
+
190
+ For others response data structure, please refer to [API Documentation (APIv2)](http://apiv2-doc.twitcasting.tv/).
191
+
122
192
  ---
123
193
 
124
194
  ## Development
@@ -246,6 +316,7 @@ end
246
316
 
247
317
  ```
248
318
  /
319
+ ├─ /bin
249
320
  ├─ /config
250
321
  │ └─ access_token.txt
251
322
  ├─ /examples
@@ -276,6 +347,7 @@ end
276
347
  │ │ ├─ user.rb
277
348
  │ │ └─ version.rb
278
349
  │ └─ twicas_stream.rb
350
+ ├─ /pkg
279
351
  ├─ /spec
280
352
  │ ├─ /twicas_stream
281
353
  │ │ ├─ category_spec.rb
@@ -23,9 +23,9 @@ module TwicasStream
23
23
  # :level => 24,
24
24
  # :last_movie_id => "189037369",
25
25
  # :is_live => false,
26
- # :supporter_count => 10,
27
- # :supporting_count => 24,
28
- # :created => 1282620640
26
+ # :supporter_count => 0,
27
+ # :supporting_count => 0,
28
+ # :created => 0
29
29
  # },
30
30
  # :created => 1479579471
31
31
  # },
@@ -48,6 +48,8 @@ module TwicasStream
48
48
 
49
49
  DEFAULT_SLICE_ID = 'none'
50
50
 
51
+ LOWER_SLICE_ID = 1
52
+
51
53
  def initialize movie_id, offset = DEFAULT_OFFSET, limit = DEFAULT_LIMIT, slice_id = DEFAULT_SLICE_ID
52
54
  @response = Hash.new
53
55
  param = Hash.new
@@ -56,6 +58,16 @@ module TwicasStream
56
58
  STDERR.puts "#{__FILE__}:#{__LINE__}:Warning: out of limitation. limitation range is #{LOWER_LIMIT} ~ #{UPPER_LIMIT}."
57
59
  end
58
60
 
61
+ if slice_id.kind_of?(Integer)
62
+ if slice_id < LOWER_SLICE_ID
63
+ STDERR.puts "#{__FILE__}:#{__LINE__}:Warning: out of limitation. slice id (comment id) should be over than #{LOWER_SLICE_ID}."
64
+ end
65
+ else
66
+ unless slice_id == DEFAULT_SLICE_ID
67
+ STDERR.puts "#{__FILE__}:#{__LINE__}:Error: invalid parameter. default is '#{DEFAULT_SLICE_ID}'."
68
+ end
69
+ end
70
+
59
71
  param['offset'] = offset
60
72
  param['limit'] = limit
61
73
  param['slice_id'] = slice_id unless slice_id == DEFAULT_SLICE_ID
@@ -41,9 +41,9 @@ module TwicasStream
41
41
  # :level => 24,
42
42
  # :last_movie_id => "189037369",
43
43
  # :is_live => true,
44
- # :supporter_count => 10,
45
- # :supporting_count => 24,
46
- # :created => 1282620640
44
+ # :supporter_count => 0,
45
+ # :supporting_count => 0,
46
+ # :created => 0
47
47
  # },
48
48
  # :tags => ["人気", "コンティニュー中", "レベル40+", "初見さん大歓迎", "まったり", "雑談"]
49
49
  # }
@@ -19,9 +19,9 @@ module TwicasStream
19
19
  # :level => 24,
20
20
  # :last_movie_id => "189037369",
21
21
  # :is_live => true,
22
- # :supporter_count => 10,
23
- # :supporting_count => 24,
24
- # :created => 1282620640
22
+ # :supporter_count => 0,
23
+ # :supporting_count => 0,
24
+ # :created => 0
25
25
  # },
26
26
  # {
27
27
  # :id => "2880417757",
@@ -32,9 +32,9 @@ module TwicasStream
32
32
  # :level => 24,
33
33
  # :last_movie_id => "323387579",
34
34
  # :is_live => false,
35
- # :supporter_count => 10,
36
- # :supporting_count => 24,
37
- # :created => 1414474646
35
+ # :supporter_count => 0,
36
+ # :supporting_count => 0,
37
+ # :created => 0
38
38
  # },
39
39
  # :
40
40
  # :
@@ -16,9 +16,9 @@ module TwicasStream
16
16
  :level => elements['level'],
17
17
  :last_movie_id => elements['last_movie_id'],
18
18
  :is_live => elements['is_live'],
19
- :supporter_count => elements['supporter_count'],
20
- :supporting_count => elements['supporting_count'],
21
- :created => elements['created']
19
+ :supporter_count => elements['supporter_count'], # deprecated (2018/09/03's change log)
20
+ :supporting_count => elements['supporting_count'], # deprecated (2018/09/03's change log)
21
+ :created => elements['created'] # deprecated (2018/08/03's change log)
22
22
  }
23
23
  end
24
24
  end
@@ -8,6 +8,23 @@ module TwicasStream
8
8
  module User
9
9
  class GetUserInfo
10
10
  attr_reader :response
11
+ # {
12
+ # :supporter_count => 10,
13
+ # :supporting_count => 24,
14
+ # :user => {
15
+ # :id => "182224938",
16
+ # :screen_id => "twitcasting_jp",
17
+ # :name => "ツイキャス公式",
18
+ # :image => "http://202-234-44-53.moi.st/image3s/pbs.twimg.com/profile_images/613625726512705536/GLlBoXcS_normal.png",
19
+ # :profile => "ツイキャスの公式アカウントです。ツイキャスに関するお知らせなどを投稿します。なお、お問い合わせは https://t.co/4gCf7XVm7N までお願いします。公式Facebookページ:ttps://t.co/bxYVwpzTJB\n公式Instagram\nhttps://t.co/Bm2O2J2Kfs",
20
+ # :level => 24,
21
+ # :last_movie_id => "466324920",
22
+ # :is_live => false,
23
+ # :supporter_count => 0,
24
+ # :supporting_count => 0,
25
+ # :created => 0
26
+ # }
27
+ # }
11
28
 
12
29
  PREFIX_URL = 'users'
13
30
 
@@ -23,6 +40,28 @@ module TwicasStream
23
40
 
24
41
  class VerifyCredentials
25
42
  attr_reader :response
43
+ # {
44
+ # :app => {
45
+ # :client_id => "182224938.d37f58350925d568e2db24719fe86f11c4d14e0461429e8b5da732fcb1917b6e",
46
+ # :name => "サンプルアプリケーション",
47
+ # :owner_user_id => "182224938"
48
+ # },
49
+ # :supporter_count => 10,
50
+ # :supporting_count => 24,
51
+ # :user => {
52
+ # :id => "182224938",
53
+ # :screen_id => "twitcasting_jp",
54
+ # :name => "ツイキャス公式",
55
+ # :image => "http://202-234-44-53.moi.st/image3s/pbs.twimg.com/profile_images/613625726512705536/GLlBoXcS_normal.png",
56
+ # :profile => "ツイキャスの公式アカウントです。ツイキャスに関するお知らせなどを投稿します。なお、お問い合わせは https://t.co/4gCf7XVm7N までお願いします。公式Facebookページ:ttps://t.co/bxYVwpzTJB\n公式Instagram\nhttps://t.co/Bm2O2J2Kfs",
57
+ # :level => 24,
58
+ # :last_movie_id => "466324920",
59
+ # :is_live => false,
60
+ # :supporter_count => 0,
61
+ # :supporting_count => 0,
62
+ # :created => 0
63
+ # }
64
+ # }
26
65
 
27
66
  PREFIX_URL = 'verify_credentials'
28
67
 
@@ -2,5 +2,5 @@
2
2
  # coding: utf-8
3
3
 
4
4
  module TwicasStream
5
- VERSION = '1.1.1'
5
+ VERSION = '1.2.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twicas_stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuya Sato
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-06 00:00:00.000000000 Z
11
+ date: 2018-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport