1) { $congress = $_SERVER['argv'][1]; } else { $congress = $current['congress']; } echo "Congress: {$congress}\n"; $dir = EPT_APP_DIR; //// note that the Govtrack people database is always in the current congress echo "Syncing people.xml database:\n"; $cmd = "rsync -avz govtrack.us::govtrackdata/us/{$current['congress']}/". "people.xml {$dir}/data/us/{$current['congress']}"; $output = array(); echo "{$cmd}\n"; exec($cmd, $output); foreach ($output as $line) { echo "{$line}\n"; } echo "\n"; $types = array('bills', 'bills.amdt', 'bills.summary', 'rolls', 'cr'); foreach ($types as $type) { echo "Syncing {$type}:\n"; $cmd = "rsync -avz ". "govtrack.us::govtrackdata/us/{$congress}/{$type} ". "{$dir}/data/us/{$congress}"; echo "{$cmd}\n"; $output = array(); exec($cmd, $output); foreach ($output as $line) { echo "{$line}\n"; } foreach ($output as $line) { if (strpos($line, '.xml') > 0) { $data_dir = dirname(__FILE__) ."/data"; $path = "{$data_dir}/us/{$congress}/{$line}"; if ($type == 'bills') { parseBill($path); } else if ($type == 'bills.amdt') { parseAmendment($path); } else if ($type == 'rolls') { parseVote($path); } else if ($type == 'cr') { parseRecord($path); } } if ($line == '') { break; } } echo "\n"; } //// update any missing rep info updateReps(); echo "Done.\n"; ?>