Freebase PHP – albumlist – building a simple app

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.

  1. Follow the steps in Getting started with Freebase and PHP
  2. Once you’ve confirmed that you can access Freebase using PHP, download this tarball contaning metaweb.php , albumlist.php , JSON.php to your webserver.
  3. Replace the dummy cookie in albumlist.php with your own (see Getting Started for details)
  4. View albumlist.php through your webserver. It should look like this.

Congratulations on building your first Freebase app in PHP 🙂

Exercises for the reader:

  1. 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
  2. Add a band picture
    Hint: “/common/topic/image”:[{}],
  3. 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.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: