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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 782db6c2e1ec0b7a53a72e9373491f4725f2ce8c3d317abdeedc90daa50771e0
4
- data.tar.gz: b6d258109dd50cd3f3700464250e6d401e0bf2b3a7aa76231132c1107fc6ac54
3
+ metadata.gz: bcc06a69b5b0feb94b18b6b2f047f89ccda05fb3df4200d2dc122e69357398a8
4
+ data.tar.gz: fafe15331ddb4dda4538d1906a5a274858207926d22a771eb02ecfc8085e81b6
5
5
  SHA512:
6
- metadata.gz: 95fbe479dac89ecb7cd6df431e1b527f6fca12569fdb5f67aa07e2ad314c95e80d010ac124a066cf2fa90a92a79f34c9cd0832c1cc0b06b9ade8c5e17f1338df
7
- data.tar.gz: b4839f333ab5bfb36c940bb934f18de6edc0d4980efd3937a536b333593ed89bffdc9428a4766039ec5705ea917be9277bab2c00bd5c75d9dabd68bdbcfee178
6
+ metadata.gz: 8306ffb40fbfc6db4a45f250a83ecacdc4004eee74e134728948315e078fd55c47a2e1ae067f255b17b324678fc778077260b02cce740472894a78b258177f51
7
+ data.tar.gz: 98a397375f9d2b0584f080a41a82a057dfc6c51abf85e5c7c082d62a3f1bdc8558b0cbe5f073b9ee7a8bc6abf00e90c147554b44d44b72db4426c0d313b82188
data/.gitignore CHANGED
@@ -10,4 +10,5 @@
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
12
 
13
- .vscode
13
+ .vscode
14
+ /resource/test.mp4
@@ -2,4 +2,7 @@ sudo: false
2
2
  language: ruby
3
3
  rvm:
4
4
  - 2.4.4
5
- before_install: gem install bundler -v 1.16.2
5
+ before_install:
6
+ - gem install bundler -v 1.16.2
7
+ - bundle install
8
+ script: bundle exec rake spec
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- twitch-clipr (0.1.0)
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
- ```ruby
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
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Twitch
2
2
  module Clipr
3
- VERSION = "0.1.1"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
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.1.1
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.7
110
+ rubygems_version: 2.7.6
110
111
  signing_key:
111
112
  specification_version: 4
112
113
  summary: Twitch Clipr API Client