Carte interactive

Carte interactive de Rognac

Qualité de l'air

Indice de qualité de l'air

 

{source}

<?php

$API_key = 'AIzaSyAaEI3h-0l_EpOzRPWHRnTgzSO6p_HgUfY'; // Remplacez par votre clé API
$channelID = 'UC5PbRFhnnrkzc4zvE92fe_w'; // Remplacez par votre identifiant Youtube
$maxResults = 10;
$playlistId = 'PLp1CD5uNCLiT0nk_a9EIjpdBa7gD4rysb'; // id playlist ici CONSEILS MUNICIPAUX

// Faire un Appel API pour récuperer la liste des vidéos en format Json
$myQuery = "https://www.googleapis.com/youtube/v3/search?key=$API_key&channelId=$channelID&part=snippet,id&order=date&maxResults=$maxResults";

https://www.googleapis.com/youtube/v3/search?key=AIzaSyAaEI3h-0l_EpOzRPWHRnTgzSO6p_HgUfY&list=PLp1CD5uNCLiT0nk_a9EIjpdBa7gD4rysb
$ch = curl_init();

curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $myQuery);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);

curl_close($ch);

$data = json_decode($response);

$decoded= json_decode(json_encode($data), true);


// Run a loop to display list of videos
foreach ($decoded['items'] as $items)
{
$id = $items['id']['videoId'];
$title= $items['snippet']['title'];
$description = $items['snippet']['description'];
$thumbnail = $items['snippet']['thumbnails']['medium']['url'];
if(!empty($id)) {
?>
<div class="col-md-6" style="background-color: #192525;
margin-left: auto;
margin-right: auto; border-width: 1em;">
<div class="videoWrap controllles">

<div class="play_video" style="vertical-align: middle; border-width: 1em;">
<a class="video_popup" href="/<?php echo "https://www.youtube.com/watch?v=".$id; ?>"><img src="/<?php echo $thumbnail; ?>" alt="<?php echo $post->post_title; ?>" width="300"><i class="fa fa-play-circle" style="color: azure; font-size: 2.73em;"></i></a>
</div>
</div>
<div style="text-align: justify; text-decoration-color: ">
<h3 style="color: #ffffff;"><?php echo $title; ?></h3>
<p style="color: #ffffff;"><?php echo $description; ?></p>
</div>
</div>
<?php
}
}
?>

 

{/source}