アプリのランキングを取得するスクリプトを書いてみました。
<?php
$targetAppIds = array(
'id834802911',
'id443904275',
);
$feed = file_get_contents('https://itunes.apple.com/jp/rss/topfreeapplications/limit=100/xml');
$rss = simplexml_load_string($feed);
$result = array();
foreach($rss->entry as $val) {
$ranking++;
$title = $val->title;
$url = $val->id;
foreach ($targetAppIds as $targetUrl) {
if (strpos($url, $targetUrl) !== false) {
$result[] = array(
'app_name' => (string)$title,
'ranking' => $ranking);
}
}
}
foreach ($result as $val) {
echo sprintf("【%s位】%s\n", $val['ranking'], $val['app_name']);
}