Skip to content

Commit 6b914ae

Browse files
committed
App Store API integration
1 parent dbac310 commit 6b914ae

File tree

5 files changed

+39
-9
lines changed

5 files changed

+39
-9
lines changed

_config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ app_description : Wherever some that and kiwi that well
77
one aside canny one preparatory up less therefore
88
hello oh amid goodness checked.
99
app_price : 4.99
10-
ios_app_id : 912209541
10+
ios_app_id :
1111
android_app_id :
1212

1313
# Icon, screenshot and header image
14-
app_icon : /assets/appicon-1024px.png
15-
app_video : /assets/video.mp4
16-
app_screenshot : /assets/screenshot.png
17-
header_image : /assets/headerimage.png
14+
app_icon : ../assets/appicon-1024px.png # Will automatically populate if you have set the iOS app id.
15+
app_video : # ../assets/video.mp4 # Uncomment and replace with path to app preview video. Optimal resolutions: 1242x2688 or 1125x2436.
16+
app_screenshot : ../assets/screenshot.png # Will automatically populate if you have set the iOS app id.
17+
header_image : ../assets/headerimage.png # Replace with custom background image or link to background image.
1818

1919
# Social Links
2020
facebook_username :

_includes/appstoreimages.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
2+
3+
{% if site.ios_app_id %}
4+
5+
<script>
6+
7+
$(function() {
8+
9+
var apiURL = "https://itunes.apple.com/lookup?id={{ site.ios_app_id }}&callback=?";
10+
11+
$.getJSON(apiURL, function(json) {
12+
13+
if (json.results && json.results.length) {
14+
15+
console.info("Image strings loaded from Apple API.");
16+
var appInfo = json.results[0];
17+
18+
$(".headerIcon").attr("src", appInfo.artworkUrl512);
19+
$(".appIconLarge").attr("src", appInfo.artworkUrl512);
20+
$(".iphoneScreen").attr("src", appInfo.screenshotUrls[0]);
21+
22+
}
23+
});
24+
});
25+
26+
</script>
27+
28+
{% endif %}

_includes/head.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
99
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
1010
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
11+
1112
</head>

_includes/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</clipPath>
1010
</defs>
1111
</svg>
12-
<img class="headerIcon" src="/assets/appicon-1024px.png">
12+
<img class="headerIcon" src="{{ site.app_icon }}">
1313
</div>
1414
<p>{{ site.app_name }}</p>
1515
</div>

index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
</svg>
2222
{% if site.app_video %}
2323
<div class="videoContainer">
24-
<video poster="/assets/Screenshot.png" autoplay="autoplay" controls="controls">
24+
<video autoplay="autoplay" controls="controls">
2525
<source src="{{ site.app_video }}" type="video/mp4">
2626
</video>
2727
</div>
2828
{% else %}
29-
<img class="iphoneScreen" src="site.app_screenshot">
29+
<img class="iphoneScreen" src="{{ site.app_screenshot }}">
3030
{% endif %}
3131
</div>
3232
<div class="appInfo">
@@ -38,7 +38,7 @@
3838
</clipPath>
3939
</defs>
4040
</svg>
41-
<img class="appIconLarge" src="/assets/appicon-1024px.png">
41+
<img class="appIconLarge" src="{{ site.app_icon }}">
4242
</div>
4343
<div class="appNamePriceContainer">
4444
<h1 class="appName">
@@ -60,6 +60,7 @@ <h2 class="appPrice">
6060
</div>
6161
{% include features.html %}
6262
{% include footer.html %}
63+
{% include appstoreimages.html %}
6364
</div>
6465
</div>
6566
</div>

0 commit comments

Comments
 (0)