gource master
[disclosr.git] / documents / datagov-merge.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
 
include_once("../include/common.inc.php");
 
 
setlocale(LC_CTYPE, 'C');
 
$db = $server->get_db('disclosr-documents');
$datasets = Array();
try {
    $rows = $db->get_view("app", "datasets", null, true)->rows;
 
    foreach ($rows as $row) {
        //print_r($row);
        if ($row->value->url != "http://data.gov.au/data/")
        $datasets[str_replace(Array("http://data.gov.au/dataset/","/"),"",$row->value->url)] = $row->id;
    }
} catch (SetteeRestClientException $e) {
    setteErrorHandler($e);
}
ksort($datasets);
foreach ($datasets as $datasetname => $datasetkey) {
    print "$datasetname => $datasetkey<br>\n";
}
?>