SAPO Messenger

18
SAPO MSG^H^Hessenger Arquitectura Clientes Protocolo Demo Party Delfim Machado [email protected] [email protected] Gustavo Carvalho [email protected] [email protected]

description

XMPP como API.Serviços do SAPO via IM.SAPO Messenger M5.Demonstração prática: construir um Bot.

Transcript of SAPO Messenger

Page 2: SAPO Messenger

SAPO MSGArquitectura

• Ejabberd / Erlang

• Perl / PHP

• Mnesia / MySQL

• Always on / Code upgrade non-stop

• Open Source / Open Mind

Page 3: SAPO Messenger

Clientes XMPP

X Outros servidores

XMPP

Outros serviços de

messaging

MSN, ICQ, AIM ...

EJABBERD

C2S

Client 2 Server

S2S

(Server 2 Server)

XML Parsing

Routing

API

Modulos Internos

MnesiaMySQL

Transportes

Modulos

externos

Socket HTTP

SAPO MSGArquitectura

Page 4: SAPO Messenger

SAPO MSGClientes

• Windows

• OS X

• Web

Page 5: SAPO Messenger

• Delphi

• Protocolo XMPP implementado por nós

• VOIP: SIP assegurado por SDK Counterpath

• 200k + linhas

SAPO MSGClientes ➧ Windows

Page 6: SAPO Messenger

• Objective-C/ C++

• Lib PSI

• 40k + linhas

SAPO MSGClientes ➧ OS X

Page 7: SAPO Messenger

• Javascript

• Lib jsjac

• HTTP-Binding

• Spot, Mail

• http://webmsg.sapo.pt/

SAPO MSGClientes ➧ Web

Page 8: SAPO Messenger

SAPO MSGProtocolo

• XMPP - eXtensible Messaging and Presence Protocol (vulgo Jabber)

• Protocolo aberto : RFC 3920 e 3921

• http://www.jabber.org/ http://www.xmpp.org/

• XML, extensível

Page 9: SAPO Messenger

SAPO MSGProtocolo ➧ Tipo Mensagens

• Message : Uma mensagem

• Presence : Informação de estado

• IQ (Information Query) : Perguntar / Alterar

Page 10: SAPO Messenger

<message type="chat" to="[email protected]" id="aaf3a" >

<body>ding</body>

</message>

SAPO MSGProtocolo ➧ Mensagem

Page 11: SAPO Messenger

<presence />

<presence type=”unavailable” />

SAPO MSGProtocolo ➧ Presença

Page 12: SAPO Messenger

<iq type="get" to="sapo.pt" id="aae7a" >

<query xmlns="http://jabber.org/protocol/disco#info"/>

</iq>

SAPO MSGProtocolo ➧ IQ (Information Query)

Page 13: SAPO Messenger

<iq from="sapo.pt" type="result" to="[email protected]/Mac" id="aae7a" > <query xmlns="http://jabber.org/protocol/disco#info"> <feature var=”iq” /> ... </query></iq>

SAPO MSGProtocolo ➧ IQ Result

Page 14: SAPO Messenger

SAPO MSGDemo Party

• Bot Calculadora

• Bot SAPO Pesquisa

Page 15: SAPO Messenger

SAPO MSGDemo Party ➧ Bot Calculadora

• Perl

• Net::XMPP2

• Math::Expression::Evaluator

• bot_calc (baseado em sample/talkbot)

• calc <expression> || c <expression>

Page 16: SAPO Messenger

SAPO MSGDemo Party ➧ Bot Pesquisa

• Perl

• Net::XMPP2

• XML::RAI (RSS Abstraction Interface)

• bot_pesq (baseado em sample/talkbot)

• pesq <words> || p <words>

Page 17: SAPO Messenger

Obrigado

Muitas ideias e boa noitada!

Page 18: SAPO Messenger

• SAPO MSG - http://messenger.sapo.pt/

• XMPP - http://www.xmpp.org/

• Erlang - http://www.erlang.org/

• Ejabberd - http://www.process-one.net/en/ejabberd/

• Perl & Modulos - http://search.cpan.org/

• Workshop Bots code - codebits intra sessões 28

Delfim Machado ✉ [email protected][email protected] Carvalho ✉ [email protected][email protected]