Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mejorando el periodismo con Ruby

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.
Avatar for dcabo dcabo
October 30, 2014

Mejorando el periodismo con Ruby

Charla en Madrid.rb el 30 de Octubre de 2014.

Grabación disponible en http://vimeo.com/111778599

Avatar for dcabo

dcabo

October 30, 2014
Tweet

More Decks by dcabo

Other Decks in Programming

Transcript

  1. Open data / datos abiertos - disponible online, gratuita -

    procesable por ordenadores - licencia abierta, reutilizable
  2. “Data is the new coal — abundant, dirty and difficult

    to mine.”, someone on the internet, after using data. data-reality
  3. title =~ /([Dd]on|[Dd]oña)/ prefix = $1 gender = prefix.index("ñ") ?

    ‘M’ : ‘H’ Expresiones regulares en ruby
  4. doc = Nokogiri::HTML(open(filename)) rows = doc.css('table.S0ESTILO9 tr’) rows.each do |row|

    columns = row.css(‘td') .map{|td| td.text.strip} amount = columns[4] … end nokogiri
  5. reuniones ‘discretas’ “SI ALGUIEN QUIERE TENER UNA REUNIÓN discreta CONMIGO,

    YO LA TENGO”, mariano rajoy, 18 de abril del 2013, en el congreso.
  6. agent = Mechanize.new page = agent.get(company_page_url) board_link = page.link_with(:text =>

    /Consejo/) board_html = board_link.click.content # Use nokogiri to get the data mechanize