From: Maxious Date: Mon, 11 Feb 2013 04:01:14 +0000 Subject: beginning of export merge X-Git-Url: http://maxious.lambdacomplex.org/git/?p=disclosr.git&a=commitdiff&h=9c58159563f81ffc5ef77d816bea2ff4a8621c4f --- beginning of export merge Former-commit-id: 121a09aa3f9417f0512b4cb138190070dc9da890 --- --- a/documents/datagov-export.py +++ b/documents/datagov-export.py @@ -119,7 +119,7 @@ print doc.id if doc.value['url'] != "http://data.gov.au/data/": # Collect the package metadata. - pkg_name = name_munge(doc.value['metadata']['DCTERMS.Title'][:100]) + pkg_name = doc.value['url'].replace("http://data.gov.au/dataset/",'').replace('/',''); _ tags = [] if len(doc.value['metadata']["Keywords / Tags"]) > 0: if hasattr(doc.value['metadata']["Keywords / Tags"], '__iter__'): --- /dev/null +++ b/documents/datagov-merge.php @@ -1,1 +1,26 @@ +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
\n"; +} +?> +