[submodule "couchdb/couchdb-lucene"] | [submodule "couchdb/couchdb-lucene"] |
path = couchdb/couchdb-lucene | path = couchdb/couchdb-lucene |
url = https://github.com/rnewson/couchdb-lucene.git | url = https://github.com/rnewson/couchdb-lucene.git |
[submodule "couchdb/settee"] | [submodule "couchdb/settee"] |
path = couchdb/settee | path = couchdb/settee |
url = https://github.com/inadarei/settee.git | url = https://github.com/inadarei/settee.git |
[submodule "lib/springy"] | [submodule "lib/springy"] |
path = lib/springy | path = lib/springy |
url = https://github.com/dhotson/springy.git | url = https://github.com/dhotson/springy.git |
[submodule "lib/php-diff"] | |
path = lib/php-diff | |
url = https://github.com/chrisboulton/php-diff.git | |
[submodule "javascripts/flot"] | |
path = javascripts/flot | |
url = https://github.com/paradoxxxzero/flot.git | |
<?php | <?php |
include_once('include/common.inc.php'); | include_once('include/common.inc.php'); |
include_header(); | include_header(); |
?> | ?> |
<div class="foundation-header"> | <div class="foundation-header"> |
<h1><a href="about.php">About/FAQ</a></h1> | <h1><a href="about.php">About/FAQ</a></h1> |
<h4 class="subheader">Lorem ipsum.</h4> | <h4 class="subheader">Lorem ipsum.</h4> |
</div> | </div> |
<h2> What is this? </h2> | <h2> What is this? </h2> |
Disclosr is a project to monitor Australian Federal Government agencies | Disclosr is a project to monitor Australian Federal Government agencies |
compliance with their <a href="http://www.oaic.gov.au/publications/other_operational/foi_policy_frequently_asked_questions.html#_Toc291837571">"proactive disclosure requirements"</a>. | compliance with their <a href="http://www.oaic.gov.au/publications/other_operational/foi_policy_frequently_asked_questions.html#_Toc291837571">"proactive disclosure requirements"</a>. |
OGRE (Open Government Realization Evaluation) is a ranking of compliance with these requirements. | OGRE (Open Government Realization Evaluation) is a ranking of compliance with these requirements. |
Prometheus is the agent which polls agency websites to assess compliance. | Prometheus is the agent which polls agency websites to assess compliance. |
<h2> Open everything </h2> | <h2> Open everything </h2> |
all documents released CC-BY 3 AU | All documents released CC-BY 3 AU |
Open source git @ | Open source git @ |
<h2>Organisational Data Sources</h2> | <h2>Organisational Data Sources</h2> |
http://www.comlaw.gov.au/Browse/Results/ByTitle/AdministrativeArrangementsOrders/Current/Ad/0 defines departments | http://www.comlaw.gov.au/Browse/Results/ByTitle/AdministrativeArrangementsOrders/Current/Ad/0 defines departments |
Agencies can be found in the Schedule to an Appropriation Bill (budget), Schedule to FMA Regulations and/or Public Service Act. | Agencies can be found in the Schedule to an Appropriation Bill (budget), Schedule to FMA Regulations and/or Public Service Act.<br> |
http://www.finance.gov.au/publications/flipchart/docs/FMACACFlipchart.pdf summarises these. view-source:https://www.tenders.gov.au/?event=public.advancedsearch.home is great for the suspended/active status | http://www.finance.gov.au/publications/flipchart/docs/FMACACFlipchart.pdf summarises these. view-source:https://www.tenders.gov.au/?event=public.advancedsearch.home is great for the suspended/active status<br> |
When defining the hierachy, this system is designed towards monitoring accountablity. Thus large agencies that have registered their own ABN | When defining the hierachy, this system is designed towards monitoring accountablity. Thus large agencies that have registered their own ABN |
and have their own accountablity mechanisms/website receive a seperate record as a child of their department. | and have their own accountablity mechanisms/website receive a seperate record as a child of their department. |
Some small agencies will choose to simply rely on their parent department's accountablity measures. | Some small agencies will choose to simply rely on their parent department's accountablity measures.<br> |
This flows through to organisation name and other/past names. A department that completely accounts for an agency will list that agency as an other child name. | This flows through to organisation name and other/past names. A department that completely accounts for an agency will list that agency as an other child name. |
As agencies themselves shift between departments, there may be scope for providing time ranges but typically the newest hierarchy will be the one recorded. | As agencies themselves shift between departments, there may be scope for providing time ranges but typically the newest hierarchy will be the one recorded. |
A department/agency name will be the newest active name assigned to that ABN. | A department/agency name will be the newest active name assigned to that ABN.<br> |
ABN information is derived from the ABR. This is the definitive umpire about which former name should be linked to which current name. | ABN information is derived from the ABR. This is the definitive umpire about which former name should be linked to which current name. |
For example "Department of Transport and Regional Services" became "Department of Infrastructure, Transport, Regional Development and Local Government" (same ABN) | For example "Department of Transport and Regional Services" became "Department of Infrastructure, Transport, Regional Development and Local Government" (same ABN) |
however it later split into "Department of Infrastructure and Transport" (same ABN) | however it later split into "Department of Infrastructure and Transport" (same ABN) |
and "Department of Regional Australia, Regional Development and Local Government" (new ABN). | and "Department of Regional Australia, Regional Development and Local Government" (new ABN).<br> |
Statistical information from http://www.apsc.gov.au/stateoftheservice/1011/statsbulletin/section1.html#t2total https://www.apsedii.gov.au/apsedii/CustomQueryx33.shtml | Statistical information from http://www.apsc.gov.au/stateoftheservice/1011/statsbulletin/section1.html#t2total https://www.apsedii.gov.au/apsedii/CustomQueryx33.shtml |
and individual annual reports. | and individual annual reports.<br> |
Webpage Assessment | <h2>Webpage Assessment</h2> |
Much due care has been put into correctly recording disclosure URLs. Typically the "About", "Corporate", "Publications" and "Sitemap" sections are checked at the very least. | Much due care has been put into correctly recording disclosure URLs. Typically the "About", "Corporate", "Publications" and "Sitemap" sections are checked at the very least. |
Occasionally it is nessicary to use a site or Google search. In several rare cases, there is a secret "Disclosure" navigation menu you can find if you find one of the mandatory publishing obligations in that category (seriously). | Occasionally it is nessicary to use a site or Google search. In several rare cases, there is a secret "Disclosure" navigation menu you can find if you find one of the mandatory publishing obligations in that category (seriously).<br> |
Some rules about leniency: | Some rules about leniency:<br> |
An empty FOI disclosure log counts, a page outlining what the FOI Act is does not. | <ul> |
A disclosure log in PDF or Word format counts :( | <li>An empty FOI disclosure log counts, a page outlining what the FOI Act is does not.</li> |
An empty File/Record list counts (although that's very minimalistic that you have no files, electronic or paper) | <li>A disclosure log in PDF or Word format counts :(</li> |
Only a current information publication scheme page counts, not a s.9 FOI Act page or an organisation chart. | <li>An empty File/Record list counts (although that's very minimalistic that you have no files, electronic or paper)</li> |
If there isn't a page easily listing all current and past Annual Reports, the most current one (html, pdf) counts. | <li>Only a current information publication scheme page counts, not a s.9 FOI Act page or an organisation chart.</li> |
Consultancy contracts might not need it's own webpage (if in Annual Report), grants/appointments might not apply to all organisations but Legal Services Expenditure (and all other obligations) does need a webpage. | <li>If there isn't a page easily listing all current and past Annual Reports, the most current one (html, pdf) counts.</li> |
<li>Consultancy contracts might not need it's own webpage (if in Annual Report), grants/appointments might not apply to all organisations but Legal Services Expenditure (and all other obligations) does need a webpage. </li> | |
<h2>Open Government Scoring</h2> | <h2>Open Government Scoring</h2> |
+1 point for every true Has... attribute | +1 point for every true Has... attribute<br> |
-1 point for every false Has... (ie. Has Not) attribute | -1 point for every false Has... (ie. Has Not) attribute</br> |
Don't like this? Make your own score, suggest a better scoring mechanism. | Don't like this? Make your own score, suggest a better scoring mechanism.</br> |
<?php | <?php |
include_footer(); | include_footer(); |
?> | ?> |
<?php | |
include_once("../include/common.inc.php"); | |
setlocale(LC_CTYPE, 'C'); | |
$headers = Array("#id", "name", "request_email", "short_name", "notes", "publication_scheme", "home_page", "tag_string"); | |
$db = $server->get_db('disclosr-agencies'); | |
$headers = Array(); | |
try { | |
$rows = $db->get_view("app", "fieldNames?group=true", null, true)->rows; | |
$dataValues = Array(); | |
foreach ($rows as $row) { | |
$headers[] = $row->key; | |
} | |
} catch (SetteeRestClientException $e) { | |
setteErrorHandler($e); | |
} | |
$fp = fopen('php://output', 'w'); | |
if ($fp && $db) { | |
header('Content-Type: text/csv; charset=utf-8'); | |
header('Content-Disposition: attachment; filename="export.' . date("c") . '.csv"'); | |
header('Pragma: no-cache'); | |
header('Expires: 0'); | |
fputcsv($fp, $headers); | |
try { | |
$agencies = $db->get_view("app", "byCanonicalName", null, true)->rows; | |
//print_r($rows); | |
foreach ($agencies as $agency) { | |
// print_r($agency); | |
if ( !isset($agency->value->status)) { | |
$row = Array(); | |
$agencyArray = object_to_array($agency->value); | |
foreach ($headers as $fieldName) { | |
if (isset($agencyArray[$fieldName])) { | |
if (is_array($agencyArray[$fieldName])) { | |
$row[] = implode(";",$agencyArray[$fieldName]); | |
} else { | |
$row[] = $agencyArray[$fieldName]; | |
} | |
} else { | |
$row[] = ""; | |
} | |
} | |
fputcsv($fp, array_values($row)); | |
} | |
} | |
} catch (SetteeRestClientException $e) { | |
setteErrorHandler($e); | |
} | |
die; | |
} | |
?> | |
<?php | <?php |
require_once 'include/common.inc.php'; | require_once '../include/common.inc.php'; |
try { | try { |
$server->create_db('disclosr-agencies'); | $server->create_db('disclosr-agencies'); |
} catch (SetteeRestClientException $e) { | } catch (SetteeRestClientException $e) { |
setteErrorHandler($e); | setteErrorHandler($e); |
} | } |
$db = $server->get_db('disclosr-agencies'); | $db = $server->get_db('disclosr-agencies'); |
createAgencyDesignDoc(); | createAgencyDesignDoc(); |
$conn = new PDO("pgsql:dbname=contractDashboard;user=postgres;password=snmc;host=localhost"); | $conn = new PDO("pgsql:dbname=contractDashboard;user=postgres;password=snmc;host=localhost"); |
$namesQ = 'select agency.abn, string_agg("agencyName",\'|\') as names from agency inner join agency_nametoabn on agency.abn::text = agency_nametoabn.abn group by agency.abn;'; | $namesQ = 'select agency.abn, string_agg("agencyName",\'|\') as names from agency inner join agency_nametoabn on agency.abn::text = agency_nametoabn.abn group by agency.abn;'; |
$abntonames = Array(); | $abntonames = Array(); |
foreach ($conn->query($namesQ) as $row) { | foreach ($conn->query($namesQ) as $row) { |
$abntonames[$row['abn']] = explode("|", $row['names']); | $abntonames[$row['abn']] = explode("|", $row['names']); |
} | } |
$result = $conn->query("select * from agency"); | $result = $conn->query("select * from agency"); |
while ($agency = $result->fetch(PDO::FETCH_ASSOC)) { | while ($agency = $result->fetch(PDO::FETCH_ASSOC)) { |
$agency['_id'] = md5($agency['abn']); | $agency['_id'] = md5($agency['abn']); |
$agency['otherNames'] = $abntonames[$agency['abn']]; | $agency['otherNames'] = $abntonames[$agency['abn']]; |
if (sizeof($abntonames[$agency['abn']]) == 1) | if (sizeof($abntonames[$agency['abn']]) == 1) |
$agency['name'] = $abntonames[$agency['abn']][0]; | $agency['name'] = $abntonames[$agency['abn']][0]; |
$agency["lastScraped"] = "1/1/1970"; | $agency["lastScraped"] = "1/1/1970"; |
$agency["scrapeDepth"] = 1; | $agency["scrapeDepth"] = 1; |
try { | try { |
$doc = $db->save($agency); | $doc = $db->save($agency); |
//print_r($doc); | //print_r($doc); |
echo $agency['abn'] . " imported \n<br>"; | echo $agency['abn'] . " imported \n<br>"; |
} catch (SetteeRestClientException $e) { | } catch (SetteeRestClientException $e) { |
setteErrorHandler($e); | setteErrorHandler($e); |
} | } |
} | } |
?> | ?> |
<?php | |
require_once '../include/common.inc.php'; | |
$db = $server->get_db('disclosr-agencies'); | |
createAgencyDesignDoc(); | |
?> | |
<?php | |
include_once('../include/common.inc.php'); | |
include_header(); | |
// Include the diff class | |
echo '<STYLE TYPE="text/css"> | |
<!-- | |
@import url(../lib/php-diff/example/styles.css); | |
--> | |
</STYLE> | |
'; | |
require_once dirname(__FILE__) . '/../lib/php-diff/lib/Diff.php'; | |
// Generate a side by side diff | |
require_once dirname(__FILE__) . '/../lib/php-diff/lib/Diff/Renderer/Html/SideBySide.php'; | |
$renderer = new Diff_Renderer_Html_SideBySide; | |
$db = $server->get_db('disclosr-agencies'); | |
$docs = Array(); | |
try { | |
$rows = $db->get_view("app", "getConflicts")->rows; | |
//print_r($rows); | |
foreach ($rows as $row) { | |
echo '<h2>' . $row->id . '</h2>'; | |
echo "Comparing " . $row->value[0] . " and " . $row->value[1]; | |
$docA = explode(",", json_encode($db->get($row->id . "?rev=" . $row->value[0]))); | |
$docB = explode(",", json_encode($db->get($row->id . "?rev=" . $row->value[1]))); | |
// Options for generating the diff | |
$options = array( | |
//'ignoreWhitespace' => true, | |
//'ignoreCase' => true, | |
); | |
// Initialize the diff class | |
$diff = new Diff($docA, $docB, $options); | |
echo $diff->Render($renderer); | |
} | |
} catch (SetteeRestClientException $e) { | |
setteErrorHandler($e); | |
} | |
include_footer(); | |
?> |
<?php | <?php |
include_once('include/common.inc.php'); | include_once('../include/common.inc.php'); |
include_header(); | include_header(); |
$db = $server->get_db('disclosr-agencies'); | $db = $server->get_db('disclosr-agencies'); |
$docs = Array(); | $docs = Array(); |
try { | try { |
$rows = $db->get_view("app", "byABN")->rows; | $rows = $db->get_view("app", "byABN")->rows; |
//print_r($rows); | //print_r($rows); |
foreach ($rows as $row) { | foreach ($rows as $row) { |
$docs["a" . $row->key] = $row->value; | $docs["a" . $row->key] = $row->value; |
} | } |
} catch (SetteeRestClientException $e) { | } catch (SetteeRestClientException $e) { |
setteErrorHandler($e); | setteErrorHandler($e); |
} | } |
//print_r($docs); | //print_r($docs); |
$row = 1; | $row = 1; |
if (($handle = fopen("cacfma.csv", "r")) !== FALSE) { | if (($handle = fopen("cacfma.csv", "r")) !== FALSE) { |
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { | while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { |
$row++; | $row++; |
echo $data[0] . " " . str_replace("?", "", $data[1]) . "<br />\n"; | echo $data[0] . " " . str_replace("?", "", $data[1]) . "<br />\n"; |
$name = $data[0]; | $name = $data[0]; |
$abn = trim(str_replace("?", "", $data[1])); | $abn = trim(str_replace("?", "", $data[1])); |
$aabn = "a".$abn; | $aabn = "a".$abn; |
if (isset($docs[$aabn])) { | if (isset($docs[$aabn])) { |
echo "Existing agency ABN detected<br>"; | echo "Existing agency ABN detected<br>"; |
if (!in_array($name, object_to_array($docs[$aabn]->otherNames)) && $name != $docs[$aabn]->name) { | if (!in_array($name, object_to_array($docs[$aabn]->otherNames)) && $name != $docs[$aabn]->name) { |
$docs[$aabn]->otherNames[] = $name; | $docs[$aabn]->otherNames[] = $name; |
try { | try { |
$docs[$aabn] = $db->save($docs[$aabn]); | $docs[$aabn] = $db->save($docs[$aabn]); |
//print_r($doc); | //print_r($doc); |
echo $abn . " additional names imported \n<br>"; | echo $abn . " additional names imported \n<br>"; |
} catch (SetteeRestClientException $e) { | } catch (SetteeRestClientException $e) { |
setteErrorHandler($e); | setteErrorHandler($e); |
} | } |
} | } |
} else { | } else { |
echo "New agency ABN detected<br>"; | echo "New agency ABN detected<br>"; |
$agency['_id'] = md5($aabn); | $agency['_id'] = md5($aabn); |
$agency['name'] = $name; | $agency['name'] = $name; |
$agency["abn"] = $abn; | $agency["abn"] = $abn; |
try { | try { |
$doc = $db->save($agency); | $doc = $db->save($agency); |
print_r($doc); | print_r($doc); |
echo $abn . " imported \n<br>"; | echo $abn . " imported \n<br>"; |
} catch (SetteeRestClientException $e) { | } catch (SetteeRestClientException $e) { |
setteErrorHandler($e); | setteErrorHandler($e); |
} | } |
} | } |
echo "<hr>"; | echo "<hr>"; |
} | } |
fclose($handle); | fclose($handle); |
} | } |
include_footer(); | include_footer(); |
?> | ?> |
<?php | |
include_once("../include/common.inc.php"); | |
function shortName($name) { | |
$name = trim($name); | |
if (strstr($name,"Minister ") || strstr($name,"Treasurer") || strstr($name,"Parliamentary Secretary")) { | |
$badWords = Array ("Assisting the Prime Minister on","Assisting on"," the "," of "," for "," on "," and "," to ",","," ","'","`"); | |
return str_replace($badWords,"",$name); | |
} | |
else { | |
$out = Array(); | |