Commit 5cddf657 authored by Ollivier Robert's avatar Ollivier Robert
Browse files

Implement changes for Net Neutrality doc.

parent 71ba5f41
#!/usr/bin/env ruby
# Encoding: utf-8
# Pour lancer le script il faut ruby, rubygems et les gems nokogiri et htmldiff
require 'rubygems'
......@@ -7,9 +7,9 @@ require 'nokogiri'
require 'htmldiff'
require 'erb'
IN = ARGF.shift
IN = ARGV.shift
data ="Amdts_spectre_#{i}.txt")
data =
sections = data.scan(%r(<Amend>.+?</Amend>)m)
Amendment = :num, :note, :color, :commission_rows, :amendement_rows, :members, :article
......@@ -50,8 +50,8 @@ amendments = do |xml|
raise "Invalid note: #{note.inspect}"
infos = xml.scan(%r(Text proposed by the Commission\nAmendment\n(.+)\nOr.)m).first
raise "No info found" unless infos
infos = xml.scan(%r(Draft motion for a resolution\nAmendment\n(.+)\n^(Or. <Original|C|T|))m).first
raise "No info found #{xml}" unless infos
infos = infos.first.split(/\n/)
......@@ -65,7 +65,9 @@ amendments = do |xml|
amendement_rows << diff(commission, amendment).to_s.gsub(%r(<del class=".+?">.+?</del>), "").gsub(%r(<ins class=".+?">(.+?)</ins>), "'''\\1'''")
members = doc.css('Members').text
members = doc.css('Members').text.split(%r{, }).map{|m|
}.join(', ')
article = doc.css('Article').text num, note, color, commission_rows, amendement_rows, members, article
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment