Skip to content

Instantly share code, notes, and snippets.

@AndrejAndb
Created April 7, 2015 07:03
Show Gist options
  • Select an option

  • Save AndrejAndb/a7aee3f6dceefed2a21f to your computer and use it in GitHub Desktop.

Select an option

Save AndrejAndb/a7aee3f6dceefed2a21f to your computer and use it in GitHub Desktop.
<?php
/**
* Grab some The Dead Weather albums from Freebase
*/
require(__DIR__ . '/../bootstrap.php');
$file = realpath(__DIR__) . '/test.json';
$uri = "https://www.googleapis.com/freebase/v1/mqlread?query=%7B%22type%22:%22/music/artist%22%2C%22name%22:%22The%20Dead%20Weather%22%2C%22album%22:%5B%5D%7D";
$fp = @fopen($file, 'w');
$response = \Httpful\Request::get($uri)->addOnCurlOption(CURLOPT_FILE, $fp)->get($uri)
->sendIt();
fclose($fp);
echo file_get_contents($file);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment