beginnings of document scrapers mark 2
beginnings of document scrapers mark 2


Former-commit-id: fc862f3bada775436406e0ee8adcd4e7d04ac8f6

  google-site-verification: google676a414ad086cefb.html
 
  australian disclosure logs
 
  are you looking for more information about:
  contracts
  gov orgs
  lobbyists
 
  1/1/11 title (Dept dfggdfgdf)
  description:
  source link:
  documents:
  #1 title link
 
 
  rss feed here
  <?php
 
  // Agency X updated Y, new files, diff of plain text/link text,
  // feed for just one agency or all
  // This is a minimum example of using the Universal Feed Generator Class
  include("lib/FeedWriter.php");
  //Creating an instance of FeedWriter class.
  $TestFeed = new FeedWriter(RSS2);
  //Setting the channel elements
  //Use wrapper functions for common channelelements
  $TestFeed->setTitle('Last Modified - All');
  $TestFeed->setLink('http://disclosr.lambdacomplex.org/rss.xml.php');
  $TestFeed->setDescription('This is test of creating a RSS 2.0 feed Universal Feed Writer');
  //Retriving informations from database
  $rows = $db->get_view("app", "byLastModified")->rows;
  //print_r($rows);
  foreach ($rows as $row) {
  //Create an empty FeedItem
  $newItem = $TestFeed->createNewItem();
  //Add elements to the feed item
  $newItem->setTitle($row['name']);
  $newItem->setLink($row['id']);
  $newItem->setDate(date("c", $row['metadata']['lastModified']));
  $newItem->setDescription($row['name']);
  //Now add the feed item
  $TestFeed->addItem($newItem);
  }
  //OK. Everything is done. Now genarate the feed.
  $TestFeed->genarateFeed();
  ?>
  http://www.apvma.gov.au/rss/disclosure.rss
  http://www.daff.gov.au/about/foi/ips/disclosure_log
  http://foi.deewr.gov.au/disclosure-log/rss
 
  www.finance.gov.au/foi/disclosure-log/foi-rss.xml
  http://www.righttoknow.org.au/feed/search/%20(latest_status:successful%20OR%20latest_status:partially_successful)
  <?php
  include_once('include/common.inc.php');
  include_header('Search');
  ?>
  <div class="foundation-header">
  <h1><a href="search.php">Search</a></h1>
  </div>
  <form>
  <input type="text" name="q" value="<?php if (isset($_REQUEST['q']))echo $_REQUEST['q'];?>"/>
  <input type="submit"/>
  </form>
 
  <?php
  if (isset($_REQUEST['q'])) {
  $request = Requests::get($serverAddr."disclosr-documents/_fti/_design/lucene/by_all?include_docs=true&q=".$_REQUEST['q']);
  $results = json_decode($request->body);
  $db = $server->get_db('disclosr-documents');
  foreach ($results->rows as $result) {
  //print_r($result);
  //$row = $db->get($result->id);
  echo $result->doc->_id." ".$result->doc->url."<br>".PHP_EOL;
  }
  }
  include_footer();
  ?>
file:a/rss.xml.php (deleted)
<?php  
 
// Agency X updated Y, new files, diff of plain text/link text,  
// feed for just one agency or all  
// This is a minimum example of using the Universal Feed Generator Class  
include("lib/FeedWriter.php");  
//Creating an instance of FeedWriter class.  
$TestFeed = new FeedWriter(RSS2);  
//Setting the channel elements  
//Use wrapper functions for common channelelements  
$TestFeed->setTitle('Last Modified - All');  
$TestFeed->setLink('http://disclosr.lambdacomplex.org/rss.xml.php');  
$TestFeed->setDescription('This is test of creating a RSS 2.0 feed Universal Feed Writer');  
//Retriving informations from database  
$rows = $db->get_view("app", "byLastModified")->rows;  
//print_r($rows);  
foreach ($rows as $row) {  
//Create an empty FeedItem  
$newItem = $TestFeed->createNewItem();  
//Add elements to the feed item  
$newItem->setTitle($row['name']);  
$newItem->setLink($row['id']);  
$newItem->setDate(date("c", $row['metadata']['lastModified']));  
$newItem->setDescription($row['name']);  
//Now add the feed item  
$TestFeed->addItem($newItem);  
}  
//OK. Everything is done. Now genarate the feed.  
$TestFeed->genarateFeed();  
?>  
file:a/search.php (deleted)
<?php  
include_once('include/common.inc.php');  
include_header('Search');  
?>  
<div class="foundation-header">  
<h1><a href="search.php">Search</a></h1>  
</div>  
<form>  
<input type="text" name="q" value="<?php if (isset($_REQUEST['q']))echo $_REQUEST['q'];?>"/>  
<input type="submit"/>  
</form>  
 
<?php  
if (isset($_REQUEST['q'])) {  
$request = Requests::get($serverAddr."disclosr-documents/_fti/_design/lucene/by_all?include_docs=true&q=".$_REQUEST['q']);  
$results = json_decode($request->body);  
$db = $server->get_db('disclosr-documents');  
foreach ($results->rows as $result) {  
//print_r($result);  
//$row = $db->get($result->id);  
echo $result->doc->_id." ".$result->doc->url."<br>".PHP_EOL;  
}  
}  
include_footer();  
?>