appscreens 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/appscreens +2 -1
- data/lib/appscreens/client.rb +5 -3
- data/lib/appscreens/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 197e1ce762e140c03b6af9ca882ea1a5dd72509d
|
4
|
+
data.tar.gz: abb0f8e0e4c017a1de8bf44f34a6a4958db3a33f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f0077f18e57d3b61e27f94cecc126971e35de247048d6ace25e74ae6921ad80bea3ac87da7499c4b58640378fc088e01465ca36aa0b130f3aae84c663732c40
|
7
|
+
data.tar.gz: 0b15b6d144237c31a48a1bb9c87b2fc454f4e4f9926a1ba42b84656579bd9031a50ac1ecfc2fee5b6a17b851e05189bdafc8411ab1b863caa5d0041401fadb60
|
data/bin/appscreens
CHANGED
@@ -23,6 +23,7 @@ command :grab do |c|
|
|
23
23
|
c.summary = 'Downloads the app\'s screenshots and optionally icon into a new directory named after the app.'
|
24
24
|
c.description = 'Appscreens makes it easy to download an app\'s screenshots and icon for editorial use on blogs. '
|
25
25
|
c.option '--icon', 'Download the app\'s high resolution artwork in addition to the screen shots.'
|
26
|
+
c.option '--ipad', 'Download the app\'s iPad artwork at 960x960'
|
26
27
|
|
27
28
|
c.example 'grab', 'appscreens grab 886427730'
|
28
29
|
|
@@ -36,7 +37,7 @@ command :grab do |c|
|
|
36
37
|
end
|
37
38
|
|
38
39
|
dir = FileUtils::mkdir_p("#{result["trackName"].downcase.tr(" ","_")}_screens").first
|
39
|
-
client.download_screenshots(app: result, icon: options.icon, destination: dir)
|
40
|
+
client.download_screenshots(app: result, icon: options.icon, ipad: options.ipad, destination: dir)
|
40
41
|
|
41
42
|
end
|
42
43
|
|
data/lib/appscreens/client.rb
CHANGED
@@ -6,6 +6,7 @@ module Appscreens
|
|
6
6
|
ITUNES_SEARCH_ENDPOINT = "https://itunes.apple.com/"
|
7
7
|
ITUNES_SEARCH_RESULTS_KEY = "results"
|
8
8
|
APP_SCREENSHOTS_KEY = "screenshotUrls"
|
9
|
+
APP_SCREENSHOTS_KEY_IPAD = "ipadScreenshotUrls"
|
9
10
|
APP_NAME_KEY = "trackName"
|
10
11
|
APP_ICON_KEY = "artworkUrl100"
|
11
12
|
|
@@ -22,13 +23,14 @@ module Appscreens
|
|
22
23
|
json_response_from_uri(uri)[ITUNES_SEARCH_RESULTS_KEY].first
|
23
24
|
end
|
24
25
|
|
25
|
-
def download_screenshots(app:, icon:, destination:)
|
26
|
-
screenshots = app[APP_SCREENSHOTS_KEY]
|
26
|
+
def download_screenshots(app:, icon:, ipad:, destination:)
|
27
|
+
screenshots = app[ipad ? APP_SCREENSHOTS_KEY_IPAD : APP_SCREENSHOTS_KEY]
|
27
28
|
app_name = app[APP_NAME_KEY].downcase.tr(" ","_")
|
28
29
|
|
29
30
|
screenshots.each_with_index do |screen_url, index|
|
31
|
+
screen_url = screen_url.sub('480x480', '960x960') if ipad
|
30
32
|
puts "Downloading screenshot #{index + 1} of #{screenshots.length}..."
|
31
|
-
file_name = "#{destination}/#{app_name}_#{index + 1}.jpeg"
|
33
|
+
file_name = "#{destination}/#{app_name}_#{index + 1}#{ipad ? "_ipad" : ""}.jpeg"
|
32
34
|
File.open(file_name, 'wb') { |fp| fp.write(open(screen_url).read) }
|
33
35
|
end
|
34
36
|
|
data/lib/appscreens/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appscreens
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colored
|
@@ -105,10 +105,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
107
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.4.5
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: A command-line interface for querying the App Store and downloading app screenshots.
|
112
112
|
test_files:
|
113
113
|
- spec/client_spec.rb
|
114
|
-
has_rdoc:
|