$appsDir . $json->version->uuid . '-download.json'
)
);
+
$apkDownloadUrl = $downloadJson->app->downloadLink;
+ /*
+ if (isset($json->premium) && $json->premium) {
+ $apkDownloadUrl = null;
+ }
+ */
+
+ $internetArchiveUrl = $json->stouyapi->{'internet-archive'} ?? null;
+
$pushUrl = $GLOBALS['pushToMyOuyaUrl']
. '?game=' . urlencode($json->apk->package);
$product = buildProduct($gamePromoted);
}
+ $iaUrl = null;
+ if (isset($game->latestRelease->url)
+ && substr($game->latestRelease->url, 0, 29) == 'https://archive.org/download/'
+ ) {
+ $iaUrl = dirname($game->latestRelease->url) . '/';
+ }
+
// http://cweiske.de/ouya-store-api-docs.htm#get-https-devs-ouya-tv-api-v1-details
return [
'type' => 'Game',
'promotedProduct' => $product,
'buttons' => $buttons,
+
+ 'stouyapi' => [
+ 'internet-archive' => $iaUrl,
+ ]
];
}
<section class="buttons">
<h2>Links</h2>
+ <?php if ($apkDownloadUrl): ?>
<div>
<a href="<?= $apkDownloadUrl ?>">Download .apk</a>
<p>
<?= gmdate('Y-m-d', $json->version->publishedAt) ?>
</p>
</div>
+ <?php endif ?>
+ <?php if ($internetArchiveUrl): ?>
+ <div>
+ <a href="<?= $internetArchiveUrl ?>">Internet Archive page</a>
+ </div>
+ <?php endif ?>
<div>
<form method="post" action="<?= htmlspecialchars($pushUrl) ?>" id="push" onsubmit="pushToMyOuya();return false;">
<button name="push" type="submit" class="push-to-my-ouya">