Skip to content

Instantly share code, notes, and snippets.

@kenmazaika
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenmazaika/9127774 to your computer and use it in GitHub Desktop.
Save kenmazaika/9127774 to your computer and use it in GitHub Desktop.
Last login: Thu Feb 20 21:38:08 on ttys005
kens-mbp:Documents ken$ ruby scraper.rb
Speaker: OMAR KHAN
The Details:
FRIDAY 07 FEBRUARY
6:30PM, KRESGE THEATRE
Liminal Projects, Buffalo
CAST, University at Buffalo
'Materials and Situated Technologies'
Alan H Rider Distinguished Lecture
with reception sponsored by Epic Metals
Presented as part of Eliciting Environments | Actuating Response Symposium
Speaker: JENNY SABIN
The Details:
MONDAY 10 FEBRUARY
6:30PM, KRESGE THEATRE
Experimental Architecture & Design, Philadelphia
Sabin Design Lab, Cornell
ʻMatrix Architecture: Environment & Codeʼ
Presented as part of Eliciting Environments | Actuating Response Symposium
Speaker: MICHAEL CONTENTO
The Details:
Michael Contento's lecture has been cancelled due to unforeseen circumstances; we hope to reschedule at a later time.
MONDAY 24 FEBRUARY
6:30PM, KRESGE THEATRE
Urban-Think Tank, Caracas
ʻThe Need for Detoursʼ
Alan H Rider Distinguished Lecture
Speaker: EIKE ROSWAG
The Details:
MONDAY 17 MARCH
6:30PM, KRESGE THEATRE
Roswag Architekten, Berlin
'By Nature - Architecture in Dialogue'
William Finglass Lecture
Speaker: WINY MAAS
The Details:
MONDAY 24 MARCH
6:30PM, CARNEGIE LECTURE HALL
MVRDV, Rotterdam
'Whatʼs Next?ʼ
This program is supported, in part,
by public funds from the Netherlands Cultural Services
Cosponsored by the Heinz Architectural Center at Carnegie Museum of Art
Speaker: ANNA DYSON
The Details:
MONDAY 31 MARCH
6:30PM, CARNEGIE MUSEUM OF ART THEATER
CASE, New York
Professor, RPI
Alan H Rider Distinguished Lecture
Speaker: HUGH BROUGHTON
The Details:
MONDAY 14 APRIL
6:30PM, KRESGE THEATRE
Hugh Broughton Architects, London
'Context and Connections - the Work of Hugh Broughton Architectsʼ
Henry Hornbostel Lecture 
kens-mbp:Documents ken$
class Scraper
def self.scrape
response = HTTParty.get('http://www.cmu.edu/architecture/lecture/index.html')
speakers =[]
doc = Nokogiri::HTML(response.body)
doc.css('h2').each do |speaker|
next_element = speaker.next_element
content = []
while next_element != nil
break if next_element.name.to_s == 'h2'
content << next_element.content
next_element = next_element.next_element
end
element = {
:speaker => speaker.content.gsub("\n",""),
:details => content.join("\n").strip
}
speakers << element if element[:speaker].present? && element[:details].present?
end
speakers
end
end
results = Scraper.scrape
results.each do |result|
puts "Speaker: #{result[:speaker]}"
puts "The Details:"
puts result[:details]
puts "\n\n"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment