Something went wrong. Try again.
A nerdy way to tell time on Android/iOS 🕓
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
{% if site.ios_app_id %}
<script>
$(function() {
var apiURL = "https://itunes.apple.com/lookup?id={{ site.ios_app_id }}&country={{ site.ios_app_country }}&callback=?";
$.getJSON(apiURL, function(json) {
if (json.results && json.results.length) {
console.info("Image strings loaded from Apple API."); var appInfo = json.results[0];
// Set favicon $('link[rel="shortcut icon"]').attr("href", appInfo.artworkUrl512);
// Set page title using the iOS app ID if it is not set manually in _config.yml var $pageTitle = $(".pageTitle"); if ($.trim($($pageTitle).text()).length == 0) { $($pageTitle).html(appInfo.trackName); }
// Set large app icon using the iOS app ID if it is not set manually in _config.yml var $appIconLarge = $(".appIconLarge"); if (!$appIconLarge.attr('src')) { $($appIconLarge).attr("src", appInfo.artworkUrl512); }
// Set header app icon using the iOS app ID if it is not set manually in _config.yml var $appIconHeader = $(".headerIcon"); if (!$appIconHeader.attr('src')) { $($appIconHeader).attr("src", appInfo.artworkUrl512); }
// Set app name using the iOS app ID if it is not set manually in _config.yml var $appName = $(".appName"); if ($.trim($($appName).text()).length == 0) { $($appName).html(appInfo.trackName); }
// Set the name displayed in the header if it is not set manually in _config.yml var $headerName = $(".headerName"); if ($.trim($($headerName).text()).length == 0) { $($headerName).html(appInfo.trackName); }
// Set price using the iOS app ID if it is not set manually in _config.yml var $appPrice = $(".appPrice"); if ($.trim($($appPrice).text()).length == 0) { $($appPrice).html(appInfo.formattedPrice); }
// Set App Store link using the iOS app ID if it is not set manually in _config.yml var $appStoreLink = $(".appStoreLink"); if ($.trim($appStoreLink.attr('href')).length == 0) { $($appStoreLink).attr("href", appInfo.trackViewUrl); }
console.info(appInfo);
} }); });
</script>
{% endif %}