aerial_ruby_client 1.1.0 → 1.1.1
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 +14 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +50 -0
- data/Rakefile +2 -0
- data/aerial_ruby_client.gemspec +28 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/aerial_ruby_client.rb +42 -0
- data/lib/aerial_ruby_client/version.rb +3 -0
- data/lib/{xscreensaver_script.rb → aerial_ruby_client/xscreensaver_script.rb} +0 -0
- data/xscreensaver_example.png +0 -0
- metadata +16 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31607cb50fbf956aa55613cfb336c618ba311173
|
4
|
+
data.tar.gz: 2f86e8a6e4125e6545ce2903c713d194f06a09eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2eddf8fd0bf0d7184804b470767ed56f166b3cfa005fd4f790fc5446fcbaa03957e684a4603e91525b144332e667905ad4b5d71cb895b9307b82f4fe27106235
|
7
|
+
data.tar.gz: 3488329afc4d59c730c25d4cb1cc8d6894463f28114a407e1cec2cf112605971a1fceba77045063e4e8425fd17c89c95605e87a7abcc4718df0d44b854dab316
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 m-gb
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# AerialRubyClient
|
2
|
+
|
3
|
+
This is a gem that downloads the Aerial Apple TV videos and saves them to a given directory.
|
4
|
+
The videos will be sorted by the time of day in which they were taken.
|
5
|
+
|
6
|
+
These videos can then be used by XScreenSaver on GNU/Linux.
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
gem 'aerial_ruby_client'
|
14
|
+
```
|
15
|
+
|
16
|
+
And then execute:
|
17
|
+
|
18
|
+
$ bundle
|
19
|
+
|
20
|
+
Or install it yourself as:
|
21
|
+
|
22
|
+
$ gem install aerial_ruby_client
|
23
|
+
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
Within irb or in a ruby application, use this method with a target folder (in this example Aerial) as an argument:
|
27
|
+
```ruby
|
28
|
+
download_aerials('Aerial')
|
29
|
+
```
|
30
|
+
|
31
|
+
As a result, a new folder will be created and the videos will be downloaded into it.
|
32
|
+
The folder will also contain a Ruby script called `xscreensaver_script.rb`.
|
33
|
+
|
34
|
+
This script should be moved into `/usr/lib/xscreensaver/` and renamed `aerial`.
|
35
|
+
|
36
|
+
Finally, add the `aerial \n\` line to `~/.xscreensaver`:
|
37
|
+

|
38
|
+
|
39
|
+
Note: this gem can be reused periodically to fetch the latest videos from Apple.
|
40
|
+
If a video already exists in the target folder, it will be skipped.
|
41
|
+
|
42
|
+
Enjoy your new screensaver!
|
43
|
+
|
44
|
+
## Contributing
|
45
|
+
|
46
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/m-gb/aerial_ruby_client.
|
47
|
+
|
48
|
+
## License
|
49
|
+
|
50
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "aerial_ruby_client/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "aerial_ruby_client"
|
8
|
+
spec.version = AerialRubyClient::VERSION
|
9
|
+
spec.authors = ["m-gb"]
|
10
|
+
spec.email = ["maya.goldberg90@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = "Aerial Apple TV video downloader"
|
13
|
+
spec.description = "A simple gem that downloads the Aerial Apple TV videos and saves them to a given directory."
|
14
|
+
spec.homepage = "http://rubygems.org/gems/aerial_ruby_client"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.required_ruby_version = '>= 2.4.0'
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_dependency "httparty", "~> 0.15.6"
|
27
|
+
spec.add_dependency "json", "~> 2.1"
|
28
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "aerial_ruby_client"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'aerial_ruby_client/version'
|
4
|
+
|
5
|
+
require 'httparty'
|
6
|
+
require 'json'
|
7
|
+
require 'open-uri'
|
8
|
+
require 'fileutils'
|
9
|
+
|
10
|
+
module AerialRubyClient
|
11
|
+
def download_aerials(foldername)
|
12
|
+
aerialdir = File.join(Dir.home, foldername)
|
13
|
+
#=> /home/username/foldername
|
14
|
+
|
15
|
+
Dir.mkdir(aerialdir) unless Dir.exists?(aerialdir)
|
16
|
+
|
17
|
+
url = 'http://a1.phobos.apple.com/us/r1000/000/Features/atv/' +
|
18
|
+
'AutumnResources/videos/entries.json'
|
19
|
+
|
20
|
+
response = HTTParty.get(url).to_s
|
21
|
+
parsed = JSON.parse(response)
|
22
|
+
parsed.each do |item|
|
23
|
+
item['assets'].each do |asset|
|
24
|
+
filename = asset['timeOfDay'] + '-' + asset['id'] + '.mov'
|
25
|
+
filepath = File.join(aerialdir, filename)
|
26
|
+
if File.exists?(filepath)
|
27
|
+
puts "File #{filename} already exists, skipping..."
|
28
|
+
else
|
29
|
+
puts "Downloading #{filename} to #{aerialdir}"
|
30
|
+
open(asset['url']) do |u|
|
31
|
+
File.open(filepath, 'wb') { |f| f.write(u.read) }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
puts 'Finished processing all URLs!'
|
38
|
+
|
39
|
+
# Copies the xscreensaver script to the target folder.
|
40
|
+
FileUtils.cp("#{__dir__}/aerial_ruby_client/xscreensaver_script.rb", aerialdir)
|
41
|
+
end
|
42
|
+
end
|
File without changes
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aerial_ruby_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- m-gb
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -17,7 +17,7 @@ dependencies:
|
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.16'
|
20
|
-
type: :
|
20
|
+
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
@@ -31,7 +31,7 @@ dependencies:
|
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
|
-
type: :
|
34
|
+
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
@@ -74,7 +74,18 @@ executables: []
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
-
-
|
77
|
+
- ".gitignore"
|
78
|
+
- Gemfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- aerial_ruby_client.gemspec
|
83
|
+
- bin/console
|
84
|
+
- bin/setup
|
85
|
+
- lib/aerial_ruby_client.rb
|
86
|
+
- lib/aerial_ruby_client/version.rb
|
87
|
+
- lib/aerial_ruby_client/xscreensaver_script.rb
|
88
|
+
- xscreensaver_example.png
|
78
89
|
homepage: http://rubygems.org/gems/aerial_ruby_client
|
79
90
|
licenses:
|
80
91
|
- MIT
|