Created
September 27, 2012 06:26
-
-
Save zaru/3792501 to your computer and use it in GitHub Desktop.
iPhoneAppStoreの検索クエリ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//検索キーワード | |
$keyword = 'アプリ'; | |
$uri = 'http://ax.search.itunes.apple.com/WebObjects/MZSearch.woa/wa/search?term=' . urlencode($keyword) . '&media=software'; | |
$context = stream_context_create(array('http' => array( | |
'method' => 'GET', | |
'header' => | |
'User-Agent: iTunes-iPhone/4.2.1 (2; 8GB)' . "\r\n" | |
. 'X-Apple-Store-Front: 143462-9,2' . "\r\n" | |
, | |
))); | |
$data = file_get_contents($uri, false, $context); | |
echo $data; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
iPhoneのAppStoreにiPhoneのふりして検索クエリを投げる方法。
headerのX-Apple-Store-Frontで国やストアの選択ができる。
返ってくるのはXMLデータ。