Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. //Call Apple search
  2. $cas = curl_init('https://itunes.apple.com/lookup?id=' . $appID . '');
  3. curl_setopt($cas, CURLOPT_RETURNTRANSFER, 1);
  4. $jsonitunes = curl_exec($cas);
  5. curl_close($cas);
  6.  
  7.  
  8. //Process Apple search
  9. $arr = json_decode($jsonitunes,true);
  10.  
  11.  
  12. if ($arr['resultCount'] == '0') {
  13. //Delete obsolate apps
  14. mysqli_query($bd, "DELETE FROM appstoimport WHERE app = ".$appID."") or die(mysqli_error());
  15.  
  16. }
  17.  
  18. else {
  19.  
  20. foreach($arr['results'] as $item) {
  21.  
  22. if ($item['kind'] == 'software') {
  23. $price = $item['price'];
  24.  
  25. if ($price > 0) {
  26. $free = 0;
  27. } else {
  28. $free = 1;
  29. }
  30.  
  31.  
  32. $icon = $item['artworkUrl512'];
  33.  
  34. ...
  35.  
  36. Rest of code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement