Ruby no Noite Hoje - Rs on Rails 2011

Post on 29-Jan-2018

931 views 1 download

Transcript of Ruby no Noite Hoje - Rs on Rails 2011

Felipe Lima@felipecsl

1. Introdução

O que é?

Festas e Shows

Multiplataforma

WebiOS

Android

Como funciona?

Web Crawlers

Implementação Genérica

class MyCrawlerinclude Crawlerevent :title, “xpath=/title”event :date, “css=.event .date”venue :name, “xpath=/venue/name”...

end

event :evt_type, "xpath=." do |title|title.split(" | ").first.strip.casecmp('SHOW') == 0 ? :show : :party

end

with_details_page "xpath=.//a[1]/@href" do event :description, "css=#main-content", :html venue :phone, "css=span.tel .value" venue :image, "xpath=//div[@id='image']/div/img/@src" city :name, "css=span.locality" location :street, "css=span.street" do |street| street.gsub(/\n/, '').gsub(/ /, '') endend

Cron

Rails?

Rails?

2. Arquitetura

3. API

RESTFul

JSON

1. getEvents2. getEvent3. getCities4. getLocations

4. Ambientes

DevelopmentStaging

Production

5. Dificuldades

Eventos duplicados

Dados inconsistentes

6. Futuro

Integração Contínua

Autenticação via Facebook, Twitter e

Foursquare

Open Source clients

API pública

Separar componentesda aplicação

noitehoje-api.heroku.comnoitehoje-webapp.heroku.comnoitehoje-admin.heroku.com

Quer colaborar? :)

Perguntas?