<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -35,7 +35,3 @@ qanda_all_senators_url: &quot;http://www.abc.net.au/tv/qanda/find-a-senate-member-by-
 
 # ABC 2007 election results
 election_web_root: &quot;http://www.abc.net.au/elections/federal/2007&quot;
-
-# Selectively allows us to turn off and on the writing of the XML
-write_xml_representatives: true
-write_xml_senators: true</diff>
      <filename>configuration.yml</filename>
    </modified>
    <modified>
      <diff>@@ -33,26 +33,11 @@ class PeopleXMLWriter
     x.ministers do
       people.each do |person|
         person.minister_positions.each do |p|
-          was_representative = !person.house_periods.empty?
-          was_senator = !person.senate_periods.empty?
-          
           # TODO: Add &quot;dept&quot; and &quot;source&quot;
-          if (conf.write_xml_representatives &amp;&amp; was_representative) ||
-             (conf.write_xml_senators &amp;&amp; was_senator)
-            if conf.write_xml_representatives &amp;&amp; !conf.write_xml_senators
-              matchid = person.house_periods.first.id
-            elsif conf.write_xml_senators &amp;&amp; !conf.write_xml_representatives
-              matchid = person.senate_periods.first.id
-            elsif conf.write_xml_representatives &amp;&amp; conf.write_xml_senators
-              matchid = person.periods.first.id
-            else
-              throw &quot;Hmmm... what's the point of that?&quot;
-            end
-            x.ministerofficegroup do
-              x.moffice(:id =&gt; p.id, :name =&gt; person.name.full_name,
-                :matchid =&gt; matchid, :position =&gt; p.position,
-                :fromdate =&gt; p.from_date, :todate =&gt; p.to_date, :dept =&gt; &quot;&quot;, :source =&gt; &quot;&quot;)
-            end
+          x.ministerofficegroup do
+            x.moffice(:id =&gt; p.id, :name =&gt; person.name.full_name,
+              :matchid =&gt; person.periods.first.id, :position =&gt; p.position,
+              :fromdate =&gt; p.from_date, :todate =&gt; p.to_date, :dept =&gt; &quot;&quot;, :source =&gt; &quot;&quot;)
           end
         end  
       end
@@ -67,14 +52,12 @@ class PeopleXMLWriter
     x = Builder::XmlMarkup.new(:target =&gt; xml, :indent =&gt; 1)
     x.instruct!
     x.members do
-      if conf.write_xml_representatives
-        people.each do |person|
-          person.house_periods.each do |period|
-            x.member(:id =&gt; period.id,
-              :house =&gt; &quot;representatives&quot;, :title =&gt; period.person.name.title, :firstname =&gt; period.person.name.first,
-              :lastname =&gt; period.person.name.last, :division =&gt; period.division, :party =&gt; period.party,
-              :fromdate =&gt; period.from_date, :todate =&gt; period.to_date, :fromwhy =&gt; period.from_why, :towhy =&gt; period.to_why)
-          end
+      people.each do |person|
+        person.house_periods.each do |period|
+          x.member(:id =&gt; period.id,
+            :house =&gt; &quot;representatives&quot;, :title =&gt; period.person.name.title, :firstname =&gt; period.person.name.first,
+            :lastname =&gt; period.person.name.last, :division =&gt; period.division, :party =&gt; period.party,
+            :fromdate =&gt; period.from_date, :todate =&gt; period.to_date, :fromwhy =&gt; period.from_why, :towhy =&gt; period.to_why)
         end
       end
     end
@@ -88,14 +71,12 @@ class PeopleXMLWriter
     x = Builder::XmlMarkup.new(:target =&gt; xml, :indent =&gt; 1)
     x.instruct!
     x.members do
-      if conf.write_xml_senators
-        people.each do |person|
-          person.senate_periods.each do |period|
-            x.member(:id =&gt; period.id,
-              :house =&gt; &quot;senate&quot;, :title =&gt; period.person.name.title, :firstname =&gt; period.person.name.first,
-              :lastname =&gt; period.person.name.last, :division =&gt; period.state, :party =&gt; period.party,    
-              :fromdate =&gt; period.from_date, :todate =&gt; period.to_date, :fromwhy =&gt; period.from_why, :towhy =&gt; period.to_why)
-          end
+      people.each do |person|
+        person.senate_periods.each do |period|
+          x.member(:id =&gt; period.id,
+            :house =&gt; &quot;senate&quot;, :title =&gt; period.person.name.title, :firstname =&gt; period.person.name.first,
+            :lastname =&gt; period.person.name.last, :division =&gt; period.state, :party =&gt; period.party,    
+            :fromdate =&gt; period.from_date, :todate =&gt; period.to_date, :fromwhy =&gt; period.from_why, :towhy =&gt; period.to_why)
         end
       end
     end
@@ -111,22 +92,18 @@ class PeopleXMLWriter
     x.people do
       people.each do |person|
         x.person(:id =&gt; person.id, :latestname =&gt; person.name.informal_name) do
-          if conf.write_xml_representatives
-            person.house_periods.each do |period|
-              if period.current?
-                x.office(:id =&gt; period.id, :current =&gt; &quot;yes&quot;)
-              else
-                x.office(:id =&gt; period.id)
-              end
+          person.house_periods.each do |period|
+            if period.current?
+              x.office(:id =&gt; period.id, :current =&gt; &quot;yes&quot;)
+            else
+              x.office(:id =&gt; period.id)
             end
           end
-          if conf.write_xml_senators
-            person.senate_periods.each do |period|
-              if period.current?
-                x.office(:id =&gt; period.id, :current =&gt; &quot;yes&quot;)
-              else
-                x.office(:id =&gt; period.id)
-              end
+          person.senate_periods.each do |period|
+            if period.current?
+              x.office(:id =&gt; period.id, :current =&gt; &quot;yes&quot;)
+            else
+              x.office(:id =&gt; period.id)
             end
           end
           person.minister_positions.each do |p|</diff>
      <filename>lib/people_xml_writer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -66,20 +66,16 @@ xml = File.open(&quot;#{conf.members_xml_path}/websites.xml&quot;, 'w')
 x = Builder::XmlMarkup.new(:target =&gt; xml, :indent =&gt; 1)
 x.instruct!
 x.peopleinfo do
-  if conf.write_xml_representatives
-    agent.get(conf.alternative_current_house_members_url).links.each do |link|
-      if link.to_s =~ /Member for/
-        name = Name.last_title_first(link.text.split(',')[0..1].join(','))
-        extract_links(name, people, agent, link, x)
-      end
+  agent.get(conf.alternative_current_house_members_url).links.each do |link|
+    if link.to_s =~ /Member for/
+      name = Name.last_title_first(link.text.split(',')[0..1].join(','))
+      extract_links(name, people, agent, link, x)
     end
   end
-  if conf.write_xml_senators
-    agent.get(conf.alternative_current_senate_members_url).links.each do |link|
-      if link.to_s =~ /Senator/
-        name = Name.last_title_first(link.to_s.split('-')[0..-2].join('-'))
-        extract_links(name, people, agent, link, x)
-      end
+  agent.get(conf.alternative_current_senate_members_url).links.each do |link|
+    if link.to_s =~ /Senator/
+      name = Name.last_title_first(link.to_s.split('-')[0..-2].join('-'))
+      extract_links(name, people, agent, link, x)
     end
   end
 end
@@ -120,55 +116,50 @@ puts &quot;Q&amp;A Links...&quot;
 
 data = {}
 
-if conf.write_xml_representatives
+# First get mapping between constituency name and web page
+page = agent.get(conf.qanda_electorate_url)
+map = {}
 
-  # First get mapping between constituency name and web page
-  page = agent.get(conf.qanda_electorate_url)
-  map = {}
-
-  page.links[35..184].each do |link|
-    map[link.text.downcase] = (page.uri + link.uri).to_s
-  end
-  # Hack to deal with &quot;Flynn&quot; constituency incorrectly spelled as &quot;Flyn&quot;
-  map[&quot;flynn&quot;] = &quot;http://www.abc.net.au/tv/qanda/mp-profiles/flyn.htm&quot;
-
-  bad_divisions = []
-  # Check that the links point to valid pages
-  map.each_pair do |division, url|
-    begin
-      agent.get(url)
-    rescue WWW::Mechanize::ResponseCodeError
-      bad_divisions &lt;&lt; division
-      puts &quot;ERROR: Invalid url #{url} for division #{division}&quot;
-    end
-  end
-  # Clear out bad divisions
-  bad_divisions.each { |division| map.delete(division) }
-
-  people.find_current_members(House.representatives).each do |member|
-    short_division = member.division.downcase[0..3]
-    link = map[member.division.downcase]
-    data[member.person.id] = link
-    puts &quot;ERROR: Couldn't lookup division #{member.division}&quot; if link.nil?
+page.links[35..184].each do |link|
+  map[link.text.downcase] = (page.uri + link.uri).to_s
+end
+# Hack to deal with &quot;Flynn&quot; constituency incorrectly spelled as &quot;Flyn&quot;
+map[&quot;flynn&quot;] = &quot;http://www.abc.net.au/tv/qanda/mp-profiles/flyn.htm&quot;
+
+bad_divisions = []
+# Check that the links point to valid pages
+map.each_pair do |division, url|
+  begin
+    agent.get(url)
+  rescue WWW::Mechanize::ResponseCodeError
+    bad_divisions &lt;&lt; division
+    puts &quot;ERROR: Invalid url #{url} for division #{division}&quot;
   end
 end
+# Clear out bad divisions
+bad_divisions.each { |division| map.delete(division) }
+
+people.find_current_members(House.representatives).each do |member|
+  short_division = member.division.downcase[0..3]
+  link = map[member.division.downcase]
+  data[member.person.id] = link
+  puts &quot;ERROR: Couldn't lookup division #{member.division}&quot; if link.nil?
+end
 
-if conf.write_xml_senators
-  page = agent.get(conf.qanda_all_senators_url)
-  page.links.each do |link|
-    if link.uri.to_s =~ /^\/tv\/qanda\/senators\//
-      # HACK to handle Unicode in Kerry O'Brien's name on Q&amp;A site
-      if link.to_s == &quot;Kerry O\222Brien&quot;
-        name_text = &quot;Kerry O'Brien&quot;
-      else
-        name_text = link.to_s
-      end
-      member = people.find_member_by_name_current_on_date(Name.title_first_last(name_text), Date.today, House.senate)
-      if member.nil?
-        puts &quot;WARNING: Can't find Senator #{link}&quot;
-      else
-        data[member.person.id] = page.uri + link.uri
-      end
+page = agent.get(conf.qanda_all_senators_url)
+page.links.each do |link|
+  if link.uri.to_s =~ /^\/tv\/qanda\/senators\//
+    # HACK to handle Unicode in Kerry O'Brien's name on Q&amp;A site
+    if link.to_s == &quot;Kerry O\222Brien&quot;
+      name_text = &quot;Kerry O'Brien&quot;
+    else
+      name_text = link.to_s
+    end
+    member = people.find_member_by_name_current_on_date(Name.title_first_last(name_text), Date.today, House.senate)
+    if member.nil?
+      puts &quot;WARNING: Can't find Senator #{link}&quot;
+    else
+      data[member.person.id] = page.uri + link.uri
     end
   end
 end</diff>
      <filename>parse-member-links.rb</filename>
    </modified>
    <modified>
      <diff>@@ -78,20 +78,16 @@ progress = ProgressBar.new(&quot;parse-speeches&quot;, ((to_date - from_date + 1) * 2).to_
 # Kind of helpful to start at the end date and go backwards when using the &quot;--proof&quot; option. So, always going to do this now.
 date = to_date
 while date &gt;= from_date
-  if conf.write_xml_representatives
-    if options[:proof]
-      parser.parse_date_house_only_in_proof(date, &quot;#{conf.xml_path}/scrapedxml/representatives_debates/#{date}.xml&quot;, House.representatives)
-    else
-      parser.parse_date_house(date, &quot;#{conf.xml_path}/scrapedxml/representatives_debates/#{date}.xml&quot;, House.representatives)
-    end
+  if options[:proof]
+    parser.parse_date_house_only_in_proof(date, &quot;#{conf.xml_path}/scrapedxml/representatives_debates/#{date}.xml&quot;, House.representatives)
+  else
+    parser.parse_date_house(date, &quot;#{conf.xml_path}/scrapedxml/representatives_debates/#{date}.xml&quot;, House.representatives)
   end
   progress.inc
-  if conf.write_xml_senators
-    if options[:proof]
-      parser.parse_date_house_only_in_proof(date, &quot;#{conf.xml_path}/scrapedxml/senate_debates/#{date}.xml&quot;, House.senate)
-    else
-      parser.parse_date_house(date, &quot;#{conf.xml_path}/scrapedxml/senate_debates/#{date}.xml&quot;, House.senate)
-    end
+  if options[:proof]
+    parser.parse_date_house_only_in_proof(date, &quot;#{conf.xml_path}/scrapedxml/senate_debates/#{date}.xml&quot;, House.senate)
+  else
+    parser.parse_date_house(date, &quot;#{conf.xml_path}/scrapedxml/senate_debates/#{date}.xml&quot;, House.senate)
   end
   progress.inc
   date = date - 1
@@ -102,8 +98,8 @@ progress.finish
 # And load up the database
 if options[:load_database]
   command_options = &quot; --from=#{from_date} --to=#{to_date}&quot;
-  command_options &lt;&lt; &quot; --debates&quot; if conf.write_xml_representatives
-  command_options &lt;&lt; &quot; --lordsdebates&quot; if conf.write_xml_senators
+  command_options &lt;&lt; &quot; --debates&quot;
+  command_options &lt;&lt; &quot; --lordsdebates&quot;
   command_options &lt;&lt; &quot; --force&quot; if options[:force]
   
   # Starts with 'perl' to be friendly with Windows</diff>
      <filename>parse-speeches.rb</filename>
    </modified>
    <modified>
      <diff>@@ -30,16 +30,12 @@ agent = MechanizeProxy.new
 agent.user_agent_alias = 'Mac Safari'
 agent.cache_subdirectory = &quot;wikipedia&quot;
 
-if conf.write_xml_representatives
-  puts &quot;Wikipedia links for Representatives...&quot;
-  links = extract_all_representative_wikipedia_links(people, agent)
-  write_links(links, &quot;#{conf.members_xml_path}/wikipedia-commons.xml&quot;)
-  # For Representatives just for curiousity sake find out which has a link back to OpenAustralia
-  links.each {|link| check_wikipedia_page(link[1], agent) }
-end
-if conf.write_xml_senators
-  puts &quot;Wikipedia links for Senators...&quot;
-  write_links(extract_all_senator_wikipedia_links(people, agent), &quot;#{conf.members_xml_path}/wikipedia-lords.xml&quot;)
-end
+puts &quot;Wikipedia links for Representatives...&quot;
+links = extract_all_representative_wikipedia_links(people, agent)
+write_links(links, &quot;#{conf.members_xml_path}/wikipedia-commons.xml&quot;)
+# For Representatives just for curiousity sake find out which has a link back to OpenAustralia
+links.each {|link| check_wikipedia_page(link[1], agent) }
+puts &quot;Wikipedia links for Senators...&quot;
+write_links(extract_all_senator_wikipedia_links(people, agent), &quot;#{conf.members_xml_path}/wikipedia-lords.xml&quot;)
 
 system(conf.web_root + &quot;/twfy/scripts/mpinfoin.pl links&quot;)</diff>
      <filename>wikipedia.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>69841c4733500945aa38168f1614ae0a62233c33</id>
    </parent>
  </parents>
  <author>
    <name>Matthew Landauer</name>
    <email>matthew@openaustralia.org</email>
  </author>
  <url>http://github.com/mlandauer/openaustralia-parser/commit/4b6ee4e4e2a66440b62d870ca998023011cbc195</url>
  <id>4b6ee4e4e2a66440b62d870ca998023011cbc195</id>
  <committed-date>2009-11-01T04:45:21-08:00</committed-date>
  <authored-date>2009-11-01T04:45:21-08:00</authored-date>
  <message>Always write out both the representatives and the senators xml</message>
  <tree>431df9d1f536c8f541a396538e850232330e5b0b</tree>
  <committer>
    <name>Matthew Landauer</name>
    <email>matthew@openaustralia.org</email>
  </committer>
</commit>
