Accessing CKAN data from PHP
February 23, 2010
, posted under
php
drupal
ckan
open dataI’ve been working on a couple of open data projects recently - which has been very rewarding.
A couple of people have asked for some code so I’ve knocked up a quick version of the sort of thing I’ve been working on.
This code requires PHP 5.1 for the JSON functions but doesn’t need any extra libraries (pecl_http can give better error messages but is a bit of a pain to install).
The Notes field in packages returns output in Markdown format - you can convert this to HTMl with a parser available at http://michelf.com/projects/php-markdown
This isn’t production code so please test before using.