Hallo,
ich versuche vergeblich die JSON Daten von
http://de.wiktionary.org/w/api.php?a...al&format=json
auszulesen. Leider möchte das Script einfach nicht funktionieren.
Hat von euch evtl. jemand einen Tipp? Vielen Dank im Voraus!
Mein Script:
ich versuche vergeblich die JSON Daten von
http://de.wiktionary.org/w/api.php?a...al&format=json
auszulesen. Leider möchte das Script einfach nicht funktionieren.
Hat von euch evtl. jemand einen Tipp? Vielen Dank im Voraus!
Mein Script:
PHP-Code:
$url = 'http://de.wiktionary.org/w/api.php?action=parse&prop=wikitext&page=Karneval&format=json';
$curl = curl_init();
$headers = array();
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
$json = curl_exec($curl);
curl_close($curl);
$data = json_decode($json);
if(!empty($data->list[0]->parse)) {
$titel = $data->list[0]->title;
echo "Titel: ".$titel;
}
Kommentar