Guten Abend
Wie im Titel schon steht habe ich nicht sehr viel Ahnung von PHP, trotzdem probierte ich etwas aus.. Was leider nicht wirklich funktionierte. Daher möchte ich nun von Euch gerne wissen ob dieses Skript überhaupt funktionieren kann.
Hier der Code:
Code:
<?php
$url="https://api.instagram.com/v1/media/popular?access_token=143857791.3beac03.2bf4f508c1434eaaa4e9916416bc2880";
$curl = curl_init();
// Options
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url,
CURLOPT_TIMEOUT => 4
));
// Send the request & save response to $resp
$resp = curl_exec($curl);
curl_close($curl);
if($resp){
$data=json_decode($resp, true);
foreach($data['data'] as $images){
$instgramfotos = array(
'startDate' => $images['created_time'],
'headline' => $images['caption']['text'],
'text' => $images['caption']['text'],
'asset' => array(
array('media' => $images['images']['thumbnail']['url'],
'credit' => 'bal',
'caption' => 'blaa',
))
)
}}
curl_close($curl);
echo json_encode($instagramfotos);
?>
Ich hoffe Ihr könnt mir etwas weiterhelfen