SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
Having Fun with
 Jabber Bots
 Victor Hugo Germano
Why Jabber Bots?
What kinda a crazy am I?
It’s Fun!
http://www.flickr.com/photos/sleepallday/3311794264/
Maybe a glimpse of the future?
                 http://www.flickr.com/photos/dancoulter/21042744/
Dynamic web
Is not enough!
Tired of Ctrl+R and F5




                 http://www.flickr.com/photos/disaster_area/3454110496/
We want websites like this!
But during the game...



      Real time streamming... for sure!
FLASH
Would FLASH be the answer?
No!
At least is what most companies are saying
“Big” Problem
How to create a chat room? Or a chess game?
Because

     Latency Matters
Specially when developing and application
client




server



Traditional Polling
         Often Problematic
?
Any other options?
Extensive Messaging and
   Presence Protocol




   Event-Driven

   XML oriented
Stanzas

  Presence
<presence from="victorhg@im.net/home">
  <status>at #pyconIreland o/</status>
</presence>
Stanzas

Message
<message to="mary@im.net/work"
     from="victorhg@im.net/home"
     type="chat" >
    <body>How u doing? ;) </body>
</message>
Stanzas

  IQ (Info Query)
<iq type="get" id="an_id"
     from="victorhg@im.net/casa"
     to="im.net">
    <query xmlns="jabber:iq:roster"/>
</iq>
client




server



         Long Polling
Jabber.org
But XML sucks!
xmppPy is your friend!
xmppPy
conn = xmpp.Client(‘gmail.com’)

conn.connect([server, port])

conn.auth(user, pwd)

conn.send(Message(
       "email@gmail.com","hello!"))

conn.disconnect()
First Example
Using GTalkBot



http://github.com/victorhg/botnet/blob/master/botnet/gtalkbot.py
mybot.py
from gtalkbot import GTalkBot, botcommand

class MyBot(GTalkBot):
  def __init__(self):
   super(MyBot,self).__init__('USER_ID','PWD')

 @botcommand
 def hello(self, mess, args):
  return “Hello World!”

MyBot().run_client()

http://github.com/victorhg/botnet/blob/master/botnet/gtalkbot.py
$> python mybot.py
How about a real bot?
Enough with the hello_world
Demo
Add a contact on your GTalk account



pycon.bot@gmail.com
Having fun!
Show me the code!
How can
you use it?

              http://www.flickr.com/photos/flysi/183272970/
Real Time Web?
Powered by XMPP
BOSH
Bidirectional-streams Over Synchronous HTTP
Strophe.js
When XMPP hits the web


    http://code.stanziq.com/strophe/
Strophe.js
// Connecting
var conn = new Strophe.Connection(URL)
conn.connect( jid, password, callback );

// Creating stanzas
var stanza = new Strophe.Builder(
     “message”,
   { “to”: “john@jabber.org”, type:”chat” }
);
Who uses XMPP on the web?
References
http://xmpp.org/

http://xmpppy.sourceforge.net/

http://thpinfo.com/2007/python-jabberbot/

http://xmpppy-guide.berlios.de/

http://code.stanziq.com/strophe/
Real Time Web with XMPP @ InfoQ
Thank you!

   twitter.com/victorhg
google.com/profiles/victorhg


                  Use it! Share it!
                    Remix it!

Más contenido relacionado

Similar a Having fun with jabber bots

Microblogging via XMPP
Microblogging via XMPPMicroblogging via XMPP
Microblogging via XMPP
Stoyan Zhekov
 
Joseph-Smarr-Plaxo-OSCON-2006
Joseph-Smarr-Plaxo-OSCON-2006Joseph-Smarr-Plaxo-OSCON-2006
Joseph-Smarr-Plaxo-OSCON-2006
guestfbf1e1
 

Similar a Having fun with jabber bots (20)

Writing a slack chatbot mxlos
Writing a slack chatbot mxlosWriting a slack chatbot mxlos
Writing a slack chatbot mxlos
 
How To Be A Hacker
How To Be A HackerHow To Be A Hacker
How To Be A Hacker
 
Turbot - A Next Generation Botnet
Turbot - A Next Generation BotnetTurbot - A Next Generation Botnet
Turbot - A Next Generation Botnet
 
ATX Bot Talk - Hello PyBot
ATX Bot Talk - Hello PyBotATX Bot Talk - Hello PyBot
ATX Bot Talk - Hello PyBot
 
Djabot – Python Jabber Bot
Djabot – Python Jabber BotDjabot – Python Jabber Bot
Djabot – Python Jabber Bot
 
Going Live! with Comet
Going Live! with CometGoing Live! with Comet
Going Live! with Comet
 
Bot-Tender: A Chat Bot Walks into a Bar (2020)
Bot-Tender: A Chat Bot Walks into a Bar (2020)Bot-Tender: A Chat Bot Walks into a Bar (2020)
Bot-Tender: A Chat Bot Walks into a Bar (2020)
 
Writing a slack chatbot DrupalCampLA
Writing a slack chatbot DrupalCampLAWriting a slack chatbot DrupalCampLA
Writing a slack chatbot DrupalCampLA
 
Microblogging via XMPP
Microblogging via XMPPMicroblogging via XMPP
Microblogging via XMPP
 
Introductions of Messaging bot 做聊天機器人
Introductions of Messaging bot 做聊天機器人Introductions of Messaging bot 做聊天機器人
Introductions of Messaging bot 做聊天機器人
 
WebSockets with Spring 4
WebSockets with Spring 4WebSockets with Spring 4
WebSockets with Spring 4
 
XSS Without Browser
XSS Without BrowserXSS Without Browser
XSS Without Browser
 
Modern Web 2016: Using Golang to build a smart IM Bot
Modern Web 2016: Using Golang to build a smart IM Bot Modern Web 2016: Using Golang to build a smart IM Bot
Modern Web 2016: Using Golang to build a smart IM Bot
 
How to Build a Serverless Chatbot for $0?
How to Build a Serverless Chatbot for $0?How to Build a Serverless Chatbot for $0?
How to Build a Serverless Chatbot for $0?
 
Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moon
 
Introduction to python scrapping
Introduction to python scrappingIntroduction to python scrapping
Introduction to python scrapping
 
Joseph-Smarr-Plaxo-OSCON-2006
Joseph-Smarr-Plaxo-OSCON-2006Joseph-Smarr-Plaxo-OSCON-2006
Joseph-Smarr-Plaxo-OSCON-2006
 
Plaxo OSCON 2006
Plaxo OSCON 2006Plaxo OSCON 2006
Plaxo OSCON 2006
 
Robotlegs on Top of Gaia
Robotlegs on Top of GaiaRobotlegs on Top of Gaia
Robotlegs on Top of Gaia
 
DODN2009 - Jump Start Silverlight
DODN2009 - Jump Start SilverlightDODN2009 - Jump Start Silverlight
DODN2009 - Jump Start Silverlight
 

Más de Victor Hugo Germano

Trilha management 3.0 - arbejdsglaede v2 (1)
Trilha   management 3.0 - arbejdsglaede v2 (1)Trilha   management 3.0 - arbejdsglaede v2 (1)
Trilha management 3.0 - arbejdsglaede v2 (1)
Victor Hugo Germano
 

Más de Victor Hugo Germano (20)

Expectativa ágil - Caipira Ágil 2017
Expectativa ágil - Caipira Ágil 2017Expectativa ágil - Caipira Ágil 2017
Expectativa ágil - Caipira Ágil 2017
 
O que não te contaram sobre entregar projetos Ágeis - TDC2017
O que não te contaram sobre entregar projetos Ágeis - TDC2017O que não te contaram sobre entregar projetos Ágeis - TDC2017
O que não te contaram sobre entregar projetos Ágeis - TDC2017
 
Agile coaching competency framework - TDC
Agile coaching competency framework - TDCAgile coaching competency framework - TDC
Agile coaching competency framework - TDC
 
5 disfunções de um time Scrum Day
5 disfunções de um time   Scrum Day5 disfunções de um time   Scrum Day
5 disfunções de um time Scrum Day
 
5 disfunções de um time - Devops Summit Brasil
5 disfunções de um time  - Devops Summit Brasil5 disfunções de um time  - Devops Summit Brasil
5 disfunções de um time - Devops Summit Brasil
 
Direto ao Ponto - DevOpsSummit Brasil
Direto ao Ponto - DevOpsSummit BrasilDireto ao Ponto - DevOpsSummit Brasil
Direto ao Ponto - DevOpsSummit Brasil
 
Métricas que importam Agile Brazil 2016
Métricas que importam   Agile Brazil 2016Métricas que importam   Agile Brazil 2016
Métricas que importam Agile Brazil 2016
 
Auto-gestão, negócios e produtividade - Agile Floripa 2016
Auto-gestão, negócios e produtividade - Agile Floripa 2016Auto-gestão, negócios e produtividade - Agile Floripa 2016
Auto-gestão, negócios e produtividade - Agile Floripa 2016
 
O Mundo dos OKRs
O Mundo dos OKRsO Mundo dos OKRs
O Mundo dos OKRs
 
Além da gestão tradicional
Além da gestão tradicionalAlém da gestão tradicional
Além da gestão tradicional
 
Democracia Organizacional - Linguagil 2015
Democracia Organizacional - Linguagil 2015Democracia Organizacional - Linguagil 2015
Democracia Organizacional - Linguagil 2015
 
Trilha management 3.0 - arbejdsglaede v2 (1)
Trilha   management 3.0 - arbejdsglaede v2 (1)Trilha   management 3.0 - arbejdsglaede v2 (1)
Trilha management 3.0 - arbejdsglaede v2 (1)
 
Democracia organizacional TDC 2013
Democracia organizacional TDC 2013Democracia organizacional TDC 2013
Democracia organizacional TDC 2013
 
Largamos o cucumber
Largamos o cucumberLargamos o cucumber
Largamos o cucumber
 
O futuro do agile - TDC 2011
O futuro do agile - TDC 2011O futuro do agile - TDC 2011
O futuro do agile - TDC 2011
 
O futuro do agile
O futuro do agileO futuro do agile
O futuro do agile
 
Minicurso groovy grails
Minicurso groovy grailsMinicurso groovy grails
Minicurso groovy grails
 
Voce Tem Orgulho Do Seu Codigo
Voce Tem Orgulho Do Seu CodigoVoce Tem Orgulho Do Seu Codigo
Voce Tem Orgulho Do Seu Codigo
 
Trust - Diana Larsen at Agiles 2009
Trust - Diana Larsen at Agiles 2009Trust - Diana Larsen at Agiles 2009
Trust - Diana Larsen at Agiles 2009
 
Do Monumental Ao Agil
Do Monumental Ao AgilDo Monumental Ao Agil
Do Monumental Ao Agil
 

Último

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Having fun with jabber bots