appscreens 0.1.0 → 0.2.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
  SHA1:
3
- metadata.gz: 03411f3d67faa484d3c00dbf1d1f12327a5d1f85
4
- data.tar.gz: df820c55dd24fb203bf6590cab1091f3e7a63232
3
+ metadata.gz: 197e1ce762e140c03b6af9ca882ea1a5dd72509d
4
+ data.tar.gz: abb0f8e0e4c017a1de8bf44f34a6a4958db3a33f
5
5
  SHA512:
6
- metadata.gz: a0d52ab615866fb4106dc94be0c6bf102b5ff2ac392af4d57929f5ce3cab242fcf79b37079144c532e1baa926db72c286cab268fd58c6cf833a1d8b8aaf23557
7
- data.tar.gz: 1dacfbc30a19a1d418979a7ec1014406f712f37fdbbee5f23677fe8098d4f3817a56133991935fe508a652dbe0d0ced066039ffe9e8cc770b9dfb80f3da6727a
6
+ metadata.gz: 7f0077f18e57d3b61e27f94cecc126971e35de247048d6ace25e74ae6921ad80bea3ac87da7499c4b58640378fc088e01465ca36aa0b130f3aae84c663732c40
7
+ data.tar.gz: 0b15b6d144237c31a48a1bb9c87b2fc454f4e4f9926a1ba42b84656579bd9031a50ac1ecfc2fee5b6a17b851e05189bdafc8411ab1b863caa5d0041401fadb60
@@ -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
 
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Appscreens
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.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-08 00:00:00.000000000 Z
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.2.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: