Skip to content

Instantly share code, notes, and snippets.

@whyisjake
Created March 6, 2013 01:22
Show Gist options
  • Save whyisjake/5095956 to your computer and use it in GitHub Desktop.
Save whyisjake/5095956 to your computer and use it in GitHub Desktop.
Having issues getting all of the parts data from the Make: Projects API. Should be getting the type, and quantity from the response. Not seeing it here.
<?php
/**
* Trying to grab the parts quantity and the type, but they are missing.
* Check this page: http://makeprojects.com/api/0.1/guide/56 and note the parts array.
*/
header('Content-Type: text/html; charset=utf-8');
$url = 'http://makeprojects.com/api/0.1/guide/56';
$contents = file_get_contents( $url );
//echo $contents;
$json = json_decode($contents);
//print_r($json);
$parts = $json->guide->parts;
print_r($parts);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment