Re: Extracting Data

19 views
Skip to first unread message
Message has been deleted

william dutton

unread,
Jul 8, 2022, 5:25:00 PMJul 8
to CKAN Development Discussions, greg-...@slasmail.com
The coming back is in json format, which is why you need to decide it. Then it’s in an object structure and can be read.

For html / js examples you can check out

And

On Friday, 8 July 2022 at 10:37:37 am UTC+10 greg-...@slasmail.com wrote:
Newbie, Sorry to ask a stupid question but I have spent weeks researching, trying and failing to extract some data. I am trying to teach my high school students to extract data via API calls via a web page, which I can do for some sources of data but when it comes to CKAN databases I fail. (I can do it in VB.NET but my school wants me to teach HTML/PHP etc)
I can get the data, but how do I extract it into a table or an array of data?
This is the basics of what I have done.

<!doctype html>
<html lang="en">
<head>
<title>Camping Sites</title>
</head>
<body>
<?php
$url = 'https://www.data.qld.gov.au/api/3/action/datastore_search?resource_id=90ddea45-2d5b-4149-9c98-3ecc51379e00';

$request=curl_init($url);

curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);

$result=curl_exec($request);

curl_close($request);

$response = json_decode($result, true);
//var_dump($response); // print array THIS WORKS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
print_r($response)


?>
</body>
</html>
Reply all
Reply to author
Forward
0 new messages