buildingplatforms
DESCRIPTION
Os últimos anos conferiram à web uma nova dinâmica. Novos produtos e soluções inundam a nossa atenção a toda a hora, mas a verdadeira killer feature é a facilidade com que se constroem novos serviços sobre APIs. Building platforms é uma apresentação orientada adevelopers sobre APIs e plataformas como Microformats, OpenID, OAuth.TRANSCRIPT
![Page 1: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/1.jpg)
Frederico Oliveira / Webreakstuff / @ SAPO Codebits
Building Platforms
![Page 2: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/2.jpg)
Introdução
![Page 3: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/3.jpg)
Web 2.0? What the f%&#?
![Page 4: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/4.jpg)
out: Square Corners in: Rounded Corners
![Page 5: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/5.jpg)
out: #FF0000in: Gradientes
![Page 6: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/6.jpg)
out: cat
![Page 7: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/7.jpg)
out: catin: lolcat
invisible dance partner.
![Page 8: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/8.jpg)
out: Robotsin: Humans
![Page 9: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/9.jpg)
out: IRCin: Facebook / MySpace
social networking é o novo instant messaging
![Page 10: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/10.jpg)
out: Rede como plataforma in: Apps como plataforma
![Page 11: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/11.jpg)
out: Data Silos in: Data Sources
data! data! data!
data!data!
data! data!
data!
![Page 12: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/12.jpg)
All praise the mighty API!
![Page 13: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/13.jpg)
API (Application Programming Interface)
o LEGO da internet.
![Page 14: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/14.jpg)
data!
data!
data! data!
data!
data!
data!data!
data! data!
mashups
![Page 15: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/15.jpg)
An interesting 2005, Bubblr, Clockr, Dumpr.net, Favcol, FD's Flickr Toys, Findr, Flappr, Flash-based Kaleidoscope, Flauntr, Flickeur, Flickr Chia Pet, Flickr Color Selectr, Flickr Font, Flickr Graph, Flickr Group Trackr, Flickr Hive Mind, Flickr Leech, Flickr Leech, Flickr Logo Makr, Flickr People Finder, Flickr RSS Reader, Flickr Set Manager, Flickr Sets RSS, Flickr SlideShow Generator, Flickr Tag Viewer, Flickr2Photocast, FlickrFling, FlickrFly, Flickriver, FlickrLilli, FlickrNews, FlickrReplacr, Flicktionary, Fotocrib, Gickr, h4ppierphotos, Invitr, Islands of Consciousness, Mappr, Matchr, MightyFlickr, Mosaickr, Pixel Peeper, Printr Killr, Retrievr, RSS 2 PDF, Salutr, Selfportraitr
![Page 16: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/16.jpg)
Porquê APIs? (para empresas)
![Page 17: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/17.jpg)
Porquê APIs? (para developers)
![Page 18: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/18.jpg)
Weather.com + Google Maps + Dopplr = Melhores sítios para passar férias em Janeiro.
![Page 19: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/19.jpg)
Last.fm + Amazon ECS = Recomendações personalizadas de albuns com reviews e e-store
![Page 20: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/20.jpg)
Daylife + Technorati + Yahoo Finance = Sistema para correlacionar mercados e notícias no mundo
(Que me tivesse dito com antecedência para comprar acções GALP) :-)
![Page 21: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/21.jpg)
out: internet como plataformain: tudo é uma plataforma
data! data!
data!data!
data! data!
data!
Web-apps sem API são desinteressantes.
![Page 22: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/22.jpg)
“Can’t get enough of that sweet, sweet data.”
Tom Coates @ Web 2.0 Expo
![Page 23: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/23.jpg)
APIs são tão 2006
![Page 24: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/24.jpg)
Microformats, OpenID, OAuth
Muito mais 2007/08.
![Page 25: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/25.jpg)
Microformats, OpenID, OAuth
Patterns para descrever microcontent, escritas sobre semântica existente (xhtml).microformats.org
![Page 26: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/26.jpg)
<div class="agent vcard"> <a class="email fn" href="mailto:[email protected]">Joe Friday</a> <div class="tel">+1-919-555-7878</div> <div class="title">Area Administrator, Assistant</div></div>
Exemplo: hCardAGENT:BEGIN:VCARD\nFN:Joe Friday\nTEL:+1-919-555-7878\nTITLE:Area Administrator\, Assistant\n EMAIL\;TYPE=INTERNET:\[email protected]\nEND:VCARD\n
![Page 27: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/27.jpg)
<div class="vevent"> <a class="url" href="http://www.web2con.com/">http://www.web2con.com/</a> <span class="summary">Web 2.0 Conference</span>: <abbr class="dtstart" title="2007-10-05">October 5</abbr>- <abbr class="dtend" title="2007-10-20">19</abbr>, at the <span class="location">Argent Hotel, San Francisco, CA</span></div>
Exemplo: hCalendarBEGIN:VCALENDARPRODID:-//XYZproduct//ENVERSION:2.0BEGIN:VEVENTURL:http://www.web2con.com/DTSTART:20071005DTEND:20071020SUMMARY:Web 2.0 ConferenceLOCATION:Argent Hotel\, San Francisco\, CAEND:VEVENTEND:VCALENDAR
![Page 28: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/28.jpg)
Microformats, OpenID, OAuth
Objectivo: ser interpretados principalmente por pessoas. Máquinas depois.microformats.org
![Page 29: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/29.jpg)
1-0
![Page 30: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/30.jpg)
Microformats, OpenID, OAuth
Sistema de identidade aberto e descentralizado. Um único login para todos os sites.openid.net
![Page 31: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/31.jpg)
Microformats, OpenID, OAuth
Evita ter de confiar na Microsoft (Passport), ou SixApart (Typekey).
![Page 32: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/32.jpg)
Microformats, OpenID, OAuth
Decisão sobre em quem confiar está do lado do utilizador.
![Page 33: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/33.jpg)
2-0
![Page 34: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/34.jpg)
Microformats, OpenID, OAuth
Protocolo de autenticação seguro para APIs, para clientes Desktop e Web-basedoauth.net
![Page 35: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/35.jpg)
Microformats, OpenID, OAuth
Evita ter de dar dados confidenciais a um site que quer aceder a dados em outro. Ex: Facebook + GMail contacts
![Page 36: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/36.jpg)
Microformats, OpenID, OAuth
Ao contrário de trocar emails e passwords (com acesso total), trocam-se tokens de acesso limitado aos dados do user.
![Page 37: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/37.jpg)
3-0
![Page 38: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/38.jpg)
Hack-fest sem código? <:(
![Page 39: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/39.jpg)
No API? No problem.
http://www.ruby-lang.org/en/http://code.whytheluckystiff.net/hpricot/http://mofo.rubyforge.org/
![Page 40: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/40.jpg)
lojadocidadao.pt + hpricot = O script anti-filas.
1 def update(serv) 2 a = Hpricot(open(serv)) 3 4 a.search("b").each_with_index do |a, i| 5 if i == 1 6 pessoas = a.inner_html 7 elsif i == 2 8 tempomedio = a.inner_html 9 elsif i == 3 10 tempoat = a.inner_html 11 elsif i == 5 12 balcoes = a.inner_html 13 end 14 end 15 end 16 17 update("http://www.lojadocidadao.pt/webiglc/inlineinclude.aspx?local=3&entidade=3&senha=A")
![Page 41: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/41.jpg)
deviantart + hpricot + feed-rss = Feed de wallpapersurl = "http://browse.deviantart.com/customization/wallpaper/animals/"doc = Hpricot(open(url))
elements = (doc/"div.stream")#elements = (elements/"a.src")
pages = Array.new
html = elements.to_html html.each('<') { |s| s =~ /a href=\"([^\"]+)/ if Regexp.last_match(1) != nil pages.push(Regexp.last_match(1)) end}
pages.each { |s| p s }
![Page 42: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/42.jpg)
wikipedia + hpricot = Crawler de artigosdoc = Hpricot open('http://en.wikipedia.org/wiki/List_of_bicycle_manufacturing_companies')@article = (doc/"#content").each do |content| #change /wiki/ links to point to full wikipedia path (content/:a).each do |link| unless link.attributes['href'].nil? if (link.attributes['href'][0..5] == "/wiki/") link.attributes['href'].sub!('/wiki/', 'http://en.wikipedia.org/wiki/') end end end
#remove unnecessary content and edit links items_to_remove.each { |x| (content/x).remove }
#replace links to create new entries with plain text (content/"a.new").each do |link| link.parent.insert_before Hpricot.make(link.attributes['title']), link end.removeend
![Page 43: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/43.jpg)
flickr + mecanize = flickr hcard contact fetcher agent = WWW::Mechanize.new
agent.user_agent_alias = 'Mac FireFox'page = agent.get('http://flickr.com/signin/')form = page.forms.name('login_form').firstform.login = 'login'form.passwd = 'pass'page = agent.submit(form)
page = agent.click page.links.text('click here')page = agent.click(page.links.text('Contacts'))page = agent.click(page.links.text('Contact List'))page = agent.click page.links.text('Contacts')[1]
page.links.text('profile').each do |profile| profile_page = agent.get(profile.href) tree = Microformat.find(:text => profile_page.body) hcard = tree.first unless tree.empty? puts hcard.email.gsub(' [at] ','@') unless hcard.email.nil?end
![Page 44: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/44.jpg)
Data é o “building block” fundamental da web hoje em dia. Tudo o que construímos são potenciais plataformas.
![Page 45: Buildingplatforms](https://reader033.vdocuments.mx/reader033/viewer/2022060110/5560c01cd8b42afe3b8b5444/html5/thumbnails/45.jpg)
Bonus bits: Android (demo)open + free + mobile platform