Skip to content

Instantly share code, notes, and snippets.

@KartikTalwar
Created October 25, 2012 17:30
Show Gist options
  • Save KartikTalwar/3954181 to your computer and use it in GitHub Desktop.
Save KartikTalwar/3954181 to your computer and use it in GitHub Desktop.
API Dissertation
<?php
$url = 'http://api.uwaterloo.ca/public/v1/?key=apikey&';
$url .= 'service=publicationdetails&q='.$_GET['q'];
$get = json_decode(file_get_contents($url))->response->data;
$data['title'] = $get->Title;
$data['authors'] = $get->Authors;
$data['approved'] = $get->Approved;
$data['abstract'] = $get->Abstract;
$data['program'] = $get->Program;
$data['dept'] = $get->Department;
$data['degree'] = $get->Degree;
$data['file'] = $get->File;
$data['url'] = $get->URL;
foreach($data as $k => $v)
{
echo "<h4>".strtoupper($k)."</h4>";
echo "<h3 class='blue'>$v</h3>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment