From: Maxious Date: Sat, 01 Sep 2012 12:28:07 +0000 Subject: agls function scraper X-Git-Url: https://maxious.lambdacomplex.org/git/?p=disclosr.git&a=commitdiff&h=874dfff3f944677ce84039b23ac19a93b445d8c9 --- agls function scraper Former-commit-id: 174e97ffdeaeded56d2cc86d961d05b6f1a0c427 --- --- a/.gitmodules +++ b/.gitmodules @@ -22,4 +22,7 @@ [submodule "javascripts/bubbletree"] path = javascripts/bubbletree url = https://github.com/okfn/bubbletree.git +[submodule "lib/querypath"] + path = lib/querypath + url = https://github.com/technosophos/querypath.git --- a/about.php +++ b/about.php @@ -1,6 +1,6 @@

About/FAQ

@@ -8,7 +8,7 @@

What is this?

Disclo.gs is a project to monitor Australian Federal Government agencies -compliance with their "proactive disclosure requirements". +compliance with their "proactive disclosure requirements" to make a transparency league table as suggested by gov2 taskforce http://gov2.net.au/blog/2009/09/19/a-league-ladder-of-psi-openness/.

Attributions

National Archives of Australia, Australian Governments’ Interactive Functions Thesaurus, 2nd edition, September 2005, published at http://www.naa.gov.au/recordkeeping/thesaurus/index.htm. --- a/admin/conflicts.php +++ b/admin/conflicts.php @@ -1,7 +1,7 @@ get_db('disclosr-agencies'); + +try { + $agencies = $db->get_view("app", "byCanonicalName", null, true)->rows; + //print_r($rows); + foreach ($agencies as $agency) { + //echo $agency->value->name . " ".$agency->value->website."
\n"; + // print_r($agency); + //hasRestricitiveLicence" hasRestrictiveLicense -> has Restrictive Licence + // "hasYoutube" -> Tube + // "comment" -> "comments" + if (!isset($agency->value->metaTags) && isset($agency->value->website)) { + echo $agency->value->name . " ".$agency->value->website."
\n"; + $agency->value->metaTags = Array(); + $request = Requests::get($agency->value->website); + $html = phpQuery::newDocumentHTML($request->body); + phpQuery::selectDocument($html); + foreach (pq('meta')->elements as $meta) { + $tagName = $meta->getAttribute('name');; + $content = $meta->getAttribute('content'); + if ($tagName != "") { +echo "$tagName == $content
\n"; + $agency->value->metaTags[$tagName] = $content; + } + } + //print_r($agency->value->metaTags); + $db->save($agency->value); + echo "
"; + flush(); + } + } +} catch (SetteeRestClientException $e) { + setteErrorHandler($e); +} +?> + --- /dev/null +++ b/admin/naa-agift-tree.php @@ -1,1 +1,2504 @@ + + + + Demo of the tree layout in D3.js + + + + + +
+
+ + + + + + + + + + --- a/charts.php +++ b/charts.php @@ -1,6 +1,6 @@ get_db('disclosr-agencies'); ?>
--- a/getAgency.php +++ b/getAgency.php @@ -1,23 +1,27 @@ "; echo "" . $schemas['agency']["properties"][$key]['x-title'] . "
" . $schemas['agency']["properties"][$key]['description'] . ""; if (is_array($value)) { echo "
    "; foreach ($value as $subkey => $subvalue) { - if (isset($schemas['agency']["properties"][$key]['x-property'])) { - echo '
  1. '; - } else { - echo "
  2. "; - } + + echo "
  3. "; + echo "$subvalue
  4. "; } echo "
"; @@ -28,8 +32,8 @@ echo ""; } if ((strpos($key, "URL") > 0 || $key == 'website') && $value != "") { - echo "view"; - } else { + echo "$value"; + } else { echo "$value"; } } @@ -61,7 +65,8 @@ } else { echo ""; if ((strpos($key, "URL") > 0 || $key == 'website') && $value != "") { - echo "view"; + echo "view"; + } if ($key == 'abn') { echo "view abn"; @@ -108,6 +113,7 @@ // edit? $obj = $db->get($_REQUEST['id']); + include_header($obj->name); //print_r($row); if (sizeof($_POST) > 0) { //print_r($_POST); @@ -137,7 +143,7 @@ } } - $mode = "edit"; + $mode = "view"; $rowArray = object_to_array($obj); ksort($rowArray); if ($mode == "edit") { @@ -147,8 +153,8 @@ } if ($mode == "view") { - echo '
'; - echo '"; + echo '

' . $row['name'] . "

'; + echo '"; echo ""; } if ($mode == "edit") { @@ -185,7 +191,8 @@ echo ''; } } else { - +// show all list + include_header('Agencies'); try { /* $rows = $db->get_view("app", "showNamesABNs")->rows; //print_r($rows); @@ -200,10 +207,10 @@ echo '"; } catch (SetteeRestClientException $e) { --- a/include/template.inc.php +++ b/include/template.inc.php @@ -1,6 +1,6 @@ @@ -16,7 +16,7 @@ - Disclosr + <?php echo $title; ?> - Disclosr @@ -71,9 +71,27 @@ + + --- a/javascripts/bubbletree +++ b/javascripts/bubbletree --- /dev/null +++ b/javascripts/d3.layout.min.js @@ -1,1 +1,1 @@ - +(function(){function bh(a,b,c){return a._tree.ancestor.parent==b.parent?a._tree.ancestor:c}function bg(a,b,c){a=a._tree,b=b._tree;var d=c/(b.number-a.number);a.change+=d,b.change-=d,b.shift+=c,b.prelim+=c,b.mod+=c}function bf(a){var b=0,c=0,d=a.children,e=d.length,f;while(--e>=0)f=d[e]._tree,f.prelim+=b,f.mod+=b,b+=f.shift+(c+=f.change)}function be(a,b){function c(a,d){var e=a.children;if(e){var f,g=null,h=-1,i=e.length;while(++h0&&(a=d)}return a}function _(a){return a.children?a.children[a.children.length-1]:a._tree.thread}function $(a){return a.children?a.children[0]:a._tree.thre

' . $row['name'] . "

Field NameField Value