Class: Deliver::ItunesSearchApi
- Inherits:
-
Object
- Object
- Deliver::ItunesSearchApi
- Defined in:
- lib/deliver/itunes_search_api.rb
Overview
A wrapper around the Apple iTunes Search API to access app information like the app identifier of an app.
Class Method Summary collapse
-
.fetch(id) ⇒ Hash
Fetch all information you can get from a specific AppleID of an app.
-
.fetch_bundle_identifier(id) ⇒ String
This method only fetches the bundle identifier of a given app.
- .fetch_by_identifier(app_identifier) ⇒ Object
Class Method Details
.fetch(id) ⇒ Hash
Fetch all information you can get from a specific AppleID of an app
19 20 21 22 |
# File 'lib/deliver/itunes_search_api.rb', line 19 def self.fetch(id) # Example: https://itunes.apple.com/lookup?id=284882215 fetch_url("https://itunes.apple.com/lookup?id=#{id.to_s}") end |
.fetch_bundle_identifier(id) ⇒ String
This method only fetches the bundle identifier of a given app
33 34 35 |
# File 'lib/deliver/itunes_search_api.rb', line 33 def self.fetch_bundle_identifier(id) self.fetch(id)['bundleId'] end |
.fetch_by_identifier(app_identifier) ⇒ Object
24 25 26 27 |
# File 'lib/deliver/itunes_search_api.rb', line 24 def self.fetch_by_identifier(app_identifier) # Example: http://itunes.apple.com/lookup?bundleId=net.sunapps.1 fetch_url("https://itunes.apple.com/lookup?bundleId=#{app_identifier}") end |