seize 1.0.2 → 1.0.3
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/README.md +3 -3
- data/bin/seize +1 -1
- data/lib/seize/commands.rb +8 -8
- data/lib/seize/twitch.rb +2 -2
- data/lib/seize/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3691c196493e1867610c41bd6b1b4185c0d4e3dd
|
4
|
+
data.tar.gz: b733c6aec7e6780e842f668ed2724dc04cf13042
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 592b8bc235deec6dceb446eca9bdd7f3c3eac1d464e840d91b68fd4cf8b48755419b22ece01260f0cf1eb4403ccabdc0c013baf17e103abb854b39f17e4aff83
|
7
|
+
data.tar.gz: 9bfd5c50642b7e048f10c5a739b675e7643494e105a3e741296dafa9aa0cccb36a14df439c076f0d7e7dfac4137e202f24e333940a16c812d8800094e63645a2
|
data/README.md
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
<img src='https://cloud.githubusercontent.com/assets/9126138/16828648/ef17e534-494e-11e6-9716-ff95d2e40d67.png'>
|
4
4
|
|
5
|
-
Seize is a CLI for [twitch.tv](http://twitch.tv). It can do a few things, including listing the top channels that are currently live and checking the status of a single
|
5
|
+
Seize is a CLI for [twitch.tv](http://twitch.tv). It can do a few things, including listing the top channels that are currently live and checking the status of a single channel. Seize also provides a simple interface into [livestreamer](https://github.com/chrippa/livestreamer) so that watching a stream from the terminal is quick and easy.
|
6
6
|
|
7
7
|
## Example Usage
|
8
8
|
|
9
|
-
`$ seize list` will list the top
|
9
|
+
`$ seize list` will list the top channels currently live on twitch.tv
|
10
10
|
|
11
|
-
By default Seize will list the 25 most popular
|
11
|
+
By default Seize will list the 25 most popular channels. This number can be increased or decreased with an optional number argument `--number`.
|
12
12
|
|
13
13
|
`$ seize list --number 50`
|
14
14
|
|
data/bin/seize
CHANGED
@@ -16,7 +16,7 @@ Options:
|
|
16
16
|
--quality=<value> Livestreamer quality. [default: best]'
|
17
17
|
|
18
18
|
begin
|
19
|
-
args = Docopt.docopt(doc, {:
|
19
|
+
args = Docopt.docopt(doc, { version: Seize::VERSION })
|
20
20
|
if args['watch']
|
21
21
|
Seize.watch(args['<channel>'], args['--quality'])
|
22
22
|
elsif args['list']
|
data/lib/seize/commands.rb
CHANGED
@@ -22,19 +22,19 @@ module Seize
|
|
22
22
|
line = '-' * line_length << "\n"
|
23
23
|
result << line
|
24
24
|
result << row_template % {
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
25
|
+
number: '#',
|
26
|
+
name: 'channel',
|
27
|
+
viewers: 'viewers',
|
28
|
+
game: 'game'
|
29
29
|
}
|
30
30
|
result << line
|
31
31
|
streams = Seize::Twitch.get_streams(limit: number)['streams']
|
32
32
|
streams.each_with_index do |stream, i|
|
33
33
|
result << row_template % {
|
34
|
-
:
|
35
|
-
:
|
36
|
-
:
|
37
|
-
:
|
34
|
+
number: "#{i+1}.",
|
35
|
+
name: Seize::Utils.truncate(stream['channel']['name'], name_length),
|
36
|
+
viewers: Seize::Utils.commaize(stream['viewers']),
|
37
|
+
game: Seize::Utils.truncate(stream['game'], game_length)
|
38
38
|
}
|
39
39
|
end
|
40
40
|
puts result
|
data/lib/seize/twitch.rb
CHANGED
@@ -9,7 +9,7 @@ module Seize
|
|
9
9
|
# TODO support games paramater
|
10
10
|
def self.get_streams(limit: nil)
|
11
11
|
streams_response = RestClient.get("#{BASE_URL}/streams", {
|
12
|
-
:
|
12
|
+
params: { limit: limit }, headers: HEADERS,
|
13
13
|
})
|
14
14
|
JSON.parse(streams_response)
|
15
15
|
end
|
@@ -18,7 +18,7 @@ module Seize
|
|
18
18
|
begin
|
19
19
|
channel_response = RestClient.get(
|
20
20
|
"#{BASE_URL}/streams/#{channel_name}",
|
21
|
-
{ :
|
21
|
+
{ headers: HEADERS })
|
22
22
|
JSON.parse(channel_response)
|
23
23
|
rescue RestClient::NotFound
|
24
24
|
nil
|
data/lib/seize/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Spencer Wood
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07
|
11
|
+
date: 2016-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docopt
|