app_store_info 1.0.0 → 1.0.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 +1 -0
- data/.travis.yml +2 -0
- data/README.md +55 -5
- data/lib/app_store_info/app.rb +3 -2
- data/lib/app_store_info/regions.rb +2 -1
- data/lib/app_store_info/version.rb +1 -1
- data/lib/app_store_info.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0b0050fc08b2d1862909ccab9dfddee394a735c0
|
|
4
|
+
data.tar.gz: 90546fd08bdb5673ffd93e3f53ae445d9474b5a4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 89163dd9da0430aaff1e4f000aec73ce8891c337a3f50d184a8d00ddc66c0074acc37f12a5bd9d4709a706d7fdccf3527c88045ba927baeca0a3be28d4b9ae63
|
|
7
|
+
data.tar.gz: 112b10887926332f345c7bfc7150ac1cf13d104d3e7ea63621198e161931665ce498999ef05cdb971322bb9b4157291b83dbeba80c0496ad9d1e2f7603c80a20
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
[](https://travis-ci.org/rikas/app_store_info)
|
|
2
|
+
|
|
1
3
|
# AppStoreInfo
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
Get details about any app in the Apple App Store. This gem uses iTunes lookup method to get information about apps. (i.e. https://itunes.apple.com/us/lookup?id=343200656).
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
Compatible with ruby >= 1.9.3
|
|
6
8
|
|
|
7
9
|
## Installation
|
|
8
10
|
|
|
@@ -22,7 +24,56 @@ Or install it yourself as:
|
|
|
22
24
|
|
|
23
25
|
## Usage
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
You first have to read the app details, using the store URL or directly with the ID:
|
|
28
|
+
|
|
29
|
+
```ruby
|
|
30
|
+
app = AppStoreInfo.read_url('https://itunes.apple.com/gb/app/angry-birds/id343200656?mt=8')
|
|
31
|
+
app = AppStoreInfo.read(343200656)
|
|
32
|
+
app = AppStoreInfo.read(343200656, 'gb') # You can give a particular region or it will use 'us'
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Then you have some attributes that can be read easily:
|
|
36
|
+
|
|
37
|
+
```ruby
|
|
38
|
+
app.id # => 343200656
|
|
39
|
+
app.name # => "Angry Birds"
|
|
40
|
+
app.url # => "http://www.angrybirds.com/"
|
|
41
|
+
app.average_user_rating # => 4.5
|
|
42
|
+
app.user_rating_count # => 222131
|
|
43
|
+
app.genre_ids # => ["6014", "7003", "6016", "7001"]
|
|
44
|
+
app.price # => 0.79
|
|
45
|
+
app.currency # => "GBP"
|
|
46
|
+
app.supported_devices # => ["iPhone-3GS", "iPhone4", "iPodTouchFourthGen", ...]
|
|
47
|
+
app.company # => "Rovio Entertainment Ltd"
|
|
48
|
+
app.description # => "Use the unique powers of the Angry Birds to destroy ...
|
|
49
|
+
app.minimum_os_version # => "6.0"
|
|
50
|
+
app.features # => ["gameCenter"]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
You can also check if the app is Universal:
|
|
54
|
+
|
|
55
|
+
```ruby
|
|
56
|
+
app.universal? # => false
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Last, you can check the details about the latest version of the app:
|
|
60
|
+
```ruby
|
|
61
|
+
current_version = app.current_version
|
|
62
|
+
|
|
63
|
+
current_version.average_user_rating # => 4.0
|
|
64
|
+
current_version.user_rating_count # => 191
|
|
65
|
+
current_version.number # => "5.2.0"
|
|
66
|
+
current_version.release_notes # => "We popped some pesky bugs!"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
If you need to get the genre names there's an helper method for that:
|
|
70
|
+
```ruby
|
|
71
|
+
app.genre_names # => ["Games", "Action", "Arcade", "Entertainment"]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Keep in mind that the information can be localized if you request for a particular region
|
|
75
|
+
information. Ratings, currency, price etc. can change.
|
|
76
|
+
|
|
26
77
|
|
|
27
78
|
## Development
|
|
28
79
|
|
|
@@ -32,10 +83,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
32
83
|
|
|
33
84
|
## Contributing
|
|
34
85
|
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
86
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/rikas/app_store_info.
|
|
36
87
|
|
|
37
88
|
|
|
38
89
|
## License
|
|
39
90
|
|
|
40
91
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
|
41
|
-
|
data/lib/app_store_info/app.rb
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require 'app_store_info/json_accessors'
|
|
2
|
+
require 'ostruct'
|
|
2
3
|
|
|
3
4
|
module AppStoreInfo
|
|
4
5
|
class App
|
|
@@ -6,7 +7,7 @@ module AppStoreInfo
|
|
|
6
7
|
|
|
7
8
|
attr_reader :current_version
|
|
8
9
|
|
|
9
|
-
json_accessors id: 'trackId', name: 'trackCensoredName',
|
|
10
|
+
json_accessors id: 'trackId', name: 'trackCensoredName', url: 'sellerUrl',
|
|
10
11
|
average_user_rating: 'averageUserRating', user_rating_count: 'userRatingCount',
|
|
11
12
|
genre_ids: 'genreIds', price: 'price', currency: 'currency',
|
|
12
13
|
supported_devices: 'supportedDevices', company: 'artistName',
|
|
@@ -26,7 +27,7 @@ module AppStoreInfo
|
|
|
26
27
|
end
|
|
27
28
|
|
|
28
29
|
def genre_names
|
|
29
|
-
@genre_ids.map { |genre| GENRES[genre.to_i] }
|
|
30
|
+
@genre_ids.map { |genre| AppStoreInfo::GENRES[genre.to_i] }
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
def store_icon_url
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# coding: utf-8
|
|
1
2
|
module AppStoreInfo
|
|
2
3
|
class Regions
|
|
3
4
|
# All the available regions (taken from https://developer.apple.com/library/ios/documentation/
|
|
@@ -22,7 +23,7 @@ module AppStoreInfo
|
|
|
22
23
|
'IS' => 'Iceland', 'IT' => 'Italy', 'JM' => 'Jamaica', 'JO' => 'Jordan', 'JP' => 'Japan',
|
|
23
24
|
'KE' => 'Kenya', 'KG' => 'Kyrgyzstan', 'KH' => 'Cambodia', 'KN' => 'St. Kitts and Nevis',
|
|
24
25
|
'KR' => 'Republic Of Korea', 'KW' => 'Kuwait', 'KY' => 'Cayman Islands',
|
|
25
|
-
'KZ' => 'Kazakstan', 'LA' =>
|
|
26
|
+
'KZ' => 'Kazakstan', 'LA' => "Lao People's Democratic Republic", 'LB' => 'Lebanon',
|
|
26
27
|
'LC' => 'St. Lucia', 'LK' => 'Sri Lanka', 'LR' => 'Liberia', 'LT' => 'Lithuania',
|
|
27
28
|
'LU' => 'Luxembourg', 'LV' => 'Latvia', 'MD' => 'Republic Of Moldova', 'MG' => 'Madagascar',
|
|
28
29
|
'MK' => 'Macedonia', 'ML' => 'Mali', 'MN' => 'Mongolia', 'MO' => 'Macau',
|
data/lib/app_store_info.rb
CHANGED