'; $path_base = dirname( __FILE__ ); $today = date( 'Ymd' ); //$countryID = 143462; //$countryID = intval( $appreview_countrycode ); $countryID = strtolower( $appreview_countrycode ); //$ranking = $path_base . '/result/ranking.' . $today . '.html'; $ranking = $path_base . '/result/' . $appreview_mediatype . '_' . $countryID . '_' . $appreview_genre . '.' . $today . '.html'; if ( isset( $_GET['mode'] ) && $_GET['mode'] == 'reload' ) { } else if ( file_exists( $ranking ) ) { $result = file_get_contents( $ranking ); if ( strlen( $linkshareId ) == 11 && strpos( $result, $linkshareId ) === false ) { } else { echo $result; exit; } } $fp = fopen( $ranking, 'wt' ); //$requestBeforeUri = "http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/toppaidapplications/sf="; //$requestBeforeUri = "http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/" . $appreview_mediatype . "/sf="; $requestBeforeUri = "http://itunes.apple.com/" . $countryID . "/rss/" . $appreview_mediatype . "/sf="; //$requestAfterUri = "/limit=100/xml"; //$requestAfterUri = "/limit=" . intval( $appreview_limit ) . "/xml"; if ( $appreview_genre == '99999' ) { $requestAfterUri = "/limit=" . intval( $appreview_limit ) . "/xml"; } else { $requestAfterUri = "/limit=" . intval( $appreview_limit ) . "/genre=" . intval( $appreview_genre ) . "/xml"; } //$request = $requestBeforeUri . $countryID . $requestAfterUri; $request = $requestBeforeUri . $requestAfterUri; $rss = fetch_rss($request); $title = $rss->channel['title']; $output = '