A step-by-step guide to building your the first Freebase PHP application.
This is an update of the Freebase documentation ’4.6. albumlist.php: A Metaweb-enabled web application in PHP’ which currently has some bugs.
- Follow the steps in Getting started with Freebase and PHP
- Once you’ve confirmed that you can access Freebase using PHP, download this tarball contaning metaweb.php , albumlist.php , JSON.php to your webserver.
- Replace the dummy cookie in albumlist.php with your own (see Getting Started for details)
- View albumlist.php through your webserver. It should look like this.
Congratulations on building your first Freebase app in PHP
Exercises for the reader:
- Try making the band name search less sensitive. For example ‘the beatles’ is OK but ‘beatles’ currently gives no results.
Hint: read “Pattern Matching in Queries” - Add a band picture
Hint: “/common/topic/image”:[{}], - Add more info about each album
Hint: “album”:[{ "*":[{}] }],
Tip: The best way to develop queries is to use the Query Builder and then the Query Editor. Only once you’ve got the query working should you translate it into PHP.