Skip to content

Instantly share code, notes, and snippets.

@breyten

breyten/nos.php Secret

Created June 28, 2013 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save breyten/63a2d851b59863775541 to your computer and use it in GitHub Desktop.
Save breyten/63a2d851b59863775541 to your computer and use it in GitHub Desktop.
Get the latest videos on NOS
<html>
<head>
<title>Open NOS</title>
</head>
<body>
<h1>Open NOS</h1>
<?php
$api_key = '61e8287ccd66ff81700fe01d250cb34c';
$output = file_get_contents("http://open.nos.nl/v1/latest/video/key/$api_key/output/json/category/nieuws/");
//echo $output;
$data = json_decode($output);
foreach($data->latest_video as $video) {
print '<div class="item">';
print '<h2>'. $video->title .'</h2>';
print $video->embedcode;
print "</div>";
}
//var_dump($data);
?>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment