In qualità di Affiliato Amazon, iSpazio riceve una commissione dagli acquisti idonei senza alcun costo per voi. (info).
Questo Settembre l’iTunes Festival ritorna alla Roundhouse per uno degli eventi dal vivo più appassionanti di Londra. Più di 60 artisti si esibiranno in 30 serate consecutive di fantastica musica dal vivo.
Advertising
Il tradizionale iTunes Festival annuale ci sarà anche quest’anno e come ogni volta vanterà artisti dal calibro internazionale come Justin Timberlake, Jessie J, Thirty Seconds to Mars ed altri emergenti. L’evento si terrà a Settembre a Londra e potrà essere seguito in diretta streaming su tutti i dispositivi di Cupertino e tramite iTunes.
Ma vediamo insieme il programma ufficiale dell’evento.
Domenica 1 Settembre:Lady Gaga.
Lunedì 2 Settembre: POLIÇA e Sigur Rós.
Martedì 3 Settembre: PHOX e The Lumineers.
Mercoledì 4 Settembre: Fenech-Soler e Paramore.
Giovedì 5 Settembre: Eliza Doolittle e Rizzle Kicks.
Venerdì 6 Settembre:Palma Violets e Queens of the Stone Age.
Sabato 7 Settembre:Little Green Cars e Phoenix.
Domenica 8 Settembre: The 1975 e Bastille.
Lunedì 9 Settembre: Drenge e Arctic Monkeys.
Martedì 10 Settembre: Valerie June e Jake Bugg.
Mercoledì 11 Settembre:Jimmy Eat World e Kings of Leon.
Giovedì 12 Settembre:Tom Odell e Elton John.
Venerdì 13 Settembre:Henrik B e Avicii.
Sabato 14 Settembre: Janelle Monáe e Chic Featuring Nile Rodgers.
Domenica 15 Settembre: The Olms e Vampire Weekend.
Lunedì 16 Settembre:Bahamas e Jack Johnson.
Martedì 17 Settembre: Agnes Obel e Ludovico Einaudi.
Mercoledì 18 Settembre:The Family Rain e Thirty Seconds to Mars.
Giovedì 19 Settembre: Schoolboy Q e Kendrick Lamar.
Venerdì 20 Settembre:Skinny Girl Diet e Primal Scream.
Sabato 21 Settembre: Dan Croll, Bipolar Sunshine, Gabrielle Aplin e HAIM.
Domenica 22 Settembre: Ellie Goulding.
Lunedì 23 Settembre: Lawson e Jessie J.
Martedì 24 Settembre:Aloe Blacc e Robin Thicke.
Mercoledì 25 Settembre:NO CEREMONY/// e Pixies.
Giovedì 26 Settembre:Naughty Boy e Tinie Tempah.
Venerdì 27 Settembre: Dizzee Rascal.
Sabato 28 Settembre:John Legend.
Domenica 29 Settembre:Mikky Ekko e Justin Timberlake.
Lunedì 30 Settembre: Icona Pop, Iggy Azalea e Katy Perry.
Quale di questi artisti seguirete in Live Streaming sui dispositivi Apple?
// Logica completa dello shortcode 'app'
function appstore_shortcode_logic($atts, $content = null) { // Attributi di default
$atts = shortcode_atts(array(
'id' => '',
'img' => '',
'nome' => '',
'sottotitolo' => '',
'prezzo' => '',
'link' => '',
'store' => 'App Store',
'template' => '',
'inapp' => '',
'background' => '',
'link_icon' => '',
), $atts, 'card');
// Verifica del valore dell'attributo 'stile'
$template_class = !empty($atts['template']) ? sanitize_html_class($atts['template']) : '';
// Verifica se il file JSON della cache esiste
$cache_dir = '/srv/www/ispazio.net/www/wp-content/plugins/appstore_ispazio/app_cache/';
$cache_file = $cache_dir . "app_" . sanitize_key($atts['id']) . ".json";
// Determina se la cache è valida: JSON esiste, non scaduto E icona principale esiste sul disco
$_app_id_check = sanitize_key($atts['id']);
$_img_main_path = $cache_dir . "icon250_" . $_app_id_check . ".jpg";
$_cache_valid = file_exists($cache_file) && filesize($cache_file) > 0
&& time() - filemtime($cache_file) < 31557600
&& file_exists($_img_main_path);
if ($_cache_valid) {
$json = file_get_contents($cache_file);
} else {
// Interroga l'API di App Store e scarica il JSON utilizzando cURL
$itunes_api_base = "https://itunes.apple.com/lookup?id=" . sanitize_key($atts['id']);
$country_list = ['IT', 'US']; // puoi aggiungere altri paesi se vuoi
$json = '';
$data = [];
foreach ($country_list as $country) {
$itunes_api_url = $itunes_api_base . "&country=" . $country;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $itunes_api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));
$json = curl_exec($ch);
curl_close($ch);
$data = json_decode($json, true);
if (!empty($data['results'])) {
break; // abbiamo trovato un risultato valido, fermiamo il ciclo
}
}
if (isset($data['results'][0]['artworkUrl100'])) {
$original_image_url = $data['results'][0]['artworkUrl100'];
$new_image_url = str_replace('100x100bb.jpg', '250x250bb.jpg', $original_image_url);
// Scarica e salva l'immagine dell'artwork sul tuo server
$image_id = sanitize_key($atts['id']);
$image_path = $cache_dir . "icon250_" . $image_id . ".jpg";
file_put_contents($image_path, file_get_contents($new_image_url));
if (function_exists('ispazio_convert_to_modern')) ispazio_convert_to_modern($image_path);
// Modifica il JSON con l'URL dell'immagine dell'artwork sul tuo server
$data['results'][0]['artworkUrl100'] = "https://www.ispazio.net/wp-content/plugins/appstore_ispazio/app_cache/icon250_" . $image_id . ".jpg";
// Crea anche versione 140px per template mini (retina 2x per 70x70)
$icon140_path = $cache_dir . "icon140_" . $image_id . ".jpg";
if ( ! file_exists( $icon140_path ) && function_exists( 'imagecreatefromjpeg' ) ) {
$src_img = @imagecreatefromjpeg( $image_path );
if ( $src_img ) {
$dst_img = imagecreatetruecolor( 140, 140 );
imagecopyresampled( $dst_img, $src_img, 0, 0, 0, 0, 140, 140, imagesx( $src_img ), imagesy( $src_img ) );
imagejpeg( $dst_img, $icon140_path, 85 );
imagedestroy( $src_img );
imagedestroy( $dst_img );
if (function_exists('ispazio_convert_to_modern')) ispazio_convert_to_modern($icon140_path);
}
}
// Sostituisci anche gli URL delle prime 4 immagini degli screenshot
if (isset($data['results'][0]['screenshotUrls'])) {
$screenshotUrls = $data['results'][0]['screenshotUrls'];
$screenshotUrlsOnServer = array();
for ($i = 0; $i < min(count($screenshotUrls), 4); $i++) {
$screenshotUrl = $screenshotUrls[$i];
$screenshotFilename = basename($screenshotUrl);
$screenshotSavePath = $cache_dir . "screenshot_" . $image_id . "_" . $i . ".jpg";
// Scarica e salva l'immagine dello screenshot sul tuo server
file_put_contents($screenshotSavePath, file_get_contents($screenshotUrl));
if (function_exists('ispazio_convert_to_modern')) ispazio_convert_to_modern($screenshotSavePath);
// Modifica il JSON con l'URL dell'immagine dello screenshot sul tuo server
$screenshotUrlsOnServer[] = "https://www.ispazio.net/wp-content/plugins/appstore_ispazio/app_cache/screenshot_" . $image_id . "_" . $i . ".jpg";
}
// Aggiorna il JSON con gli URL delle immagini degli screenshot sul tuo server
$data['results'][0]['screenshotUrls'] = $screenshotUrlsOnServer;
}
}
// Salva il JSON nella cache solo se non è vuoto
if (!empty($json)) {
file_put_contents($cache_file, json_encode($data));
}
}
// Decodifica il JSON
$data = json_decode($json, true);
// Se il "nome" non è specificato nell'attributo, usa il trackName dal JSON
$nome = isset($atts['nome']) && !empty($atts['nome']) ? $atts['nome'] : ($data['results'][0]['trackName'] ?? 'Scarica da App Store');
// Se il "sottotitolo" non è specificato nell'attributo, usa artistName dal JSON
$sottotitolo = isset($atts['sottotitolo']) && !empty($atts['sottotitolo']) ? $atts['sottotitolo'] : ($data['results'][0]['artistName'] ?? '');
// Se il "prezzo" non è specificato nell'attributo, usa il formattedPrice dal JSON
$formattedPrice = !empty($data['results'][0]['formattedPrice']) ? $data['results'][0]['formattedPrice'] : null; $prezzo = !empty($atts['prezzo']) ? $atts['prezzo'] : (!empty($formattedPrice) ? $formattedPrice : (!empty(trim($content)) ? trim($content) : 'OTTIENI'));
// Se l'URL dell'immagine non è specificato nell'attributo, usa quello dal JSON
$hide_image_class = '';
$card_body_style = '';
$container_style = '';
$container_extra_class = '';
if (isset($atts['img']) && trim($atts['img']) === 'scontiamolo') {
$img = 'https://www.ispazio.net/wp-content/plugins/appstore_ispazio/app_cache/icon250_1506946624.jpg';
$container_extra_class = 'scontiamolo-mode';
} elseif (!empty($atts['img'])) {
$img = $atts['img'];
} else {
$img = $data['results'][0]['artworkUrl100'] ?? "https://www.ispazio.net/wp-content/uploads/2022/10/appstore_icon.png";
}
// Per template mini usa icon140 (70x70 retina) invece di icon250
if ( $template_class === 'mini' ) {
$img = str_replace( 'icon250_', 'icon140_', $img );
}
// Genera il link dell'app su App Store
$link = !empty($atts['link']) ? $atts['link'] : "https://apps.apple.com/it/app/id" . $atts['id'] . "?platform=iphone";
$link_icon = !empty($atts['link_icon']) ? $atts['link_icon'] : $link;
// HTML immagine con o senza effetto rotazione (in base a template)
$img_html = '';
if (!empty($img)) {
if ($template_class === 'striscia') {
$img_html = '
';
} else {
$img_html = '
';
}
}
// Costruisci l'HTML finale
// Determina il contenuto del titolo in base al template
$title_content = '';
if ($template_class === 'blackfriday') {
$title_content = '
';
} else {
$title_content = esc_html($nome);
}
// offertediprimavera usa lo stesso layout CSS di blackfriday
$css_class = $template_class;
if ($template_class === 'offertediprimavera') {
$css_class = 'blackfriday offertediprimavera';
}
$output = '
';
return $output;
}
Sai che siamo anche su Telegram? Unisciti al nostro canale iSpazio per ricevere le notifiche oppure Apple Italia per chattare con altri utenti. Scopri i migliori prodotti Tech in sconto su Amazon con il nostro canale OFFERTE iSpazio.
I commenti sono chiusi per questo articolo.
1 Commento