sapo messenger
DESCRIPTION
XMPP como API.Serviços do SAPO via IM.SAPO Messenger M5.Demonstração prática: construir um Bot.TRANSCRIPT
SAPOMSG^H^Hessenger
ArquitecturaClientes
Protocolo
Demo Party
Delfim Machado ✉ [email protected] ☺[email protected] Carvalho ✉ [email protected] ☺[email protected]
SAPO MSGArquitectura
• Ejabberd / Erlang
• Perl / PHP
• Mnesia / MySQL
• Always on / Code upgrade non-stop
• Open Source / Open Mind
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
SAPO MSGClientes
• Windows
• OS X
• Web
• Delphi
• Protocolo XMPP implementado por nós
• VOIP: SIP assegurado por SDK Counterpath
• 200k + linhas
SAPO MSGClientes ➧ Windows
• Objective-C/ C++
• Lib PSI
• 40k + linhas
SAPO MSGClientes ➧ OS X
• Javascript
• Lib jsjac
• HTTP-Binding
• Spot, Mail
• http://webmsg.sapo.pt/
SAPO MSGClientes ➧ Web
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
SAPO MSGProtocolo ➧ Tipo Mensagens
• Message : Uma mensagem
• Presence : Informação de estado
• IQ (Information Query) : Perguntar / Alterar
<message type="chat" to="[email protected]" id="aaf3a" >
<body>ding</body>
</message>
SAPO MSGProtocolo ➧ Mensagem
<presence />
<presence type=”unavailable” />
SAPO MSGProtocolo ➧ Presença
<iq type="get" to="sapo.pt" id="aae7a" >
<query xmlns="http://jabber.org/protocol/disco#info"/>
</iq>
SAPO MSGProtocolo ➧ IQ (Information Query)
<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
SAPO MSGDemo Party
• Bot Calculadora
• Bot SAPO Pesquisa
SAPO MSGDemo Party ➧ Bot Calculadora
• Perl
• Net::XMPP2
• Math::Expression::Evaluator
• bot_calc (baseado em sample/talkbot)
• calc <expression> || c <expression>
SAPO MSGDemo Party ➧ Bot Pesquisa
• Perl
• Net::XMPP2
• XML::RAI (RSS Abstraction Interface)
• bot_pesq (baseado em sample/talkbot)
• pesq <words> || p <words>
Obrigado
Muitas ideias e boa noitada!
• 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]