|
|
@@ -17,16 +17,19 @@ doc = Nokogiri.parse(open(url).read) |
|
|
|
|
|
|
|
meeting = '' |
|
|
|
items = [] |
|
|
|
items_this_meeting = 0 |
|
|
|
|
|
|
|
doc.at("#bodytext").children.each do |node| |
|
|
|
if node.inner_text.match(/\d{1,2}\s+\w+\s+\d{4}/) # eg 10 December 2012 |
|
|
|
meeting = node.inner_text.strip |
|
|
|
items_this_meeting = 0 |
|
|
|
end |
|
|
|
|
|
|
|
node.children.each do |subnode| |
|
|
|
if subnode.name == 'a' && subnode['href'].match(/\.mp3$/i) |
|
|
|
items_this_meeting += 1 |
|
|
|
items << { |
|
|
|
:d => Time.parse(meeting), |
|
|
|
:d => Time.parse(meeting) + ((items_this_meeting - 1) * 30 * 60), |
|
|
|
:href => subnode['href'].strip, |
|
|
|
:title => subnode.inner_text.strip |
|
|
|
} |
|
|
|