File: freebase.php

package info (click to toggle)
php-httpful 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 388 kB
  • sloc: php: 1,677; xml: 20; makefile: 11
file content (12 lines) | stat: -rw-r--r-- 421 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
<?php
/**
 * Grab some The Dead Weather albums from Freebase
 */
require('Httpful/autoload.php');

$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";
$response = \Httpful\Request::get($uri)
    ->expectsJson()
    ->sendIt();

echo 'The Dead Weather has ' . count($response->body->result->album) . " albums.\n";