I have a link to an app on Apple App Store. I need to use its data on my own webpage. To be more precise, I want to extract the app icon, its category and whether or not it is free and to add this data to my webpage. How can I do this using JavaScript?
2 Answers
Here is the PHP Script:
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $Url); curl_setopt($ch, CURLOPT_REFERER, "https://itunes.apple.com/us/app/google+/id447119634?mt=8"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozzila/1.0"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 10); $output = curl_exec($ch); curl_close($ch); $logo = explode('<div class="artwork">', $output); $logo = explode('src="', $logo[1]); $logo = explode('"', $logo[1]); $logo = $logo[0]; $category = explode('<span class="label">Category:', $output); $category = explode('">', $category[1]); $category = explode('<', $category[1]); $category = $category[0]; echo $logo; echo $category; ?>
file_get_content('http://mysite.com/page.php'), and then you'll have to parse that to get what you want.