twitch-clipr 0.1.1 → 1.0.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 +4 -4
- data/.gitignore +2 -1
- data/.travis.yml +4 -1
- data/Gemfile.lock +3 -1
- data/README.md +4 -1
- data/lib/twitch/clipr/client.rb +8 -0
- data/lib/twitch/clipr/version.rb +1 -1
- data/resource/.gitkeep +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bcc06a69b5b0feb94b18b6b2f047f89ccda05fb3df4200d2dc122e69357398a8
|
|
4
|
+
data.tar.gz: fafe15331ddb4dda4538d1906a5a274858207926d22a771eb02ecfc8085e81b6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8306ffb40fbfc6db4a45f250a83ecacdc4004eee74e134728948315e078fd55c47a2e1ae067f255b17b324678fc778077260b02cce740472894a78b258177f51
|
|
7
|
+
data.tar.gz: 98a397375f9d2b0584f080a41a82a057dfc6c51abf85e5c7c082d62a3f1bdc8558b0cbe5f073b9ee7a8bc6abf00e90c147554b44d44b72db4426c0d313b82188
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
twitch-clipr (0.1.
|
|
4
|
+
twitch-clipr (0.1.1)
|
|
5
5
|
faraday (~> 0.12)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -27,7 +27,9 @@ GEM
|
|
|
27
27
|
rspec-support (3.8.0)
|
|
28
28
|
|
|
29
29
|
PLATFORMS
|
|
30
|
+
ruby
|
|
30
31
|
x64-mingw32
|
|
32
|
+
x86_64-linux
|
|
31
33
|
|
|
32
34
|
DEPENDENCIES
|
|
33
35
|
bundler (~> 1.16)
|
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Add this line to your application's Gemfile:
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```
|
|
8
8
|
gem 'twitch-clipr'
|
|
9
9
|
```
|
|
10
10
|
|
|
@@ -23,8 +23,11 @@ $ gem install twitch-clipr
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
25
|
```
|
|
26
|
+
require "twitch-clipr"
|
|
27
|
+
|
|
26
28
|
client = Twitch::Clipr::Client.new()
|
|
27
29
|
download_url = client.get("https://clips.twitch.tv/JazzyTsundereReindeerAMPEnergy")
|
|
30
|
+
client.download(download_url, "/tmp/clip.mp4")
|
|
28
31
|
```
|
|
29
32
|
|
|
30
33
|
## Contributing
|
data/lib/twitch/clipr/client.rb
CHANGED
|
@@ -14,6 +14,14 @@ module Twitch
|
|
|
14
14
|
json = JSON.parse(response.body)
|
|
15
15
|
json["download_url"]
|
|
16
16
|
end
|
|
17
|
+
|
|
18
|
+
def download(download_url, destination_filepath)
|
|
19
|
+
client = Faraday.new()
|
|
20
|
+
response = client.get(download_url)
|
|
21
|
+
File.open(destination_filepath, 'wb') { |fp|
|
|
22
|
+
fp.write(response.body)
|
|
23
|
+
}
|
|
24
|
+
end
|
|
17
25
|
end
|
|
18
26
|
end
|
|
19
27
|
end
|
data/lib/twitch/clipr/version.rb
CHANGED
data/resource/.gitkeep
ADDED
|
File without changes
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: twitch-clipr
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- yoshikyoto
|
|
@@ -85,6 +85,7 @@ files:
|
|
|
85
85
|
- lib/twitch-clipr.rb
|
|
86
86
|
- lib/twitch/clipr/client.rb
|
|
87
87
|
- lib/twitch/clipr/version.rb
|
|
88
|
+
- resource/.gitkeep
|
|
88
89
|
- twitch-clipr.gemspec
|
|
89
90
|
homepage: http://www.utakata.work/
|
|
90
91
|
licenses:
|
|
@@ -106,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
106
107
|
version: '0'
|
|
107
108
|
requirements: []
|
|
108
109
|
rubyforge_project:
|
|
109
|
-
rubygems_version: 2.7.
|
|
110
|
+
rubygems_version: 2.7.6
|
|
110
111
|
signing_key:
|
|
111
112
|
specification_version: 4
|
|
112
113
|
summary: Twitch Clipr API Client
|