SlideShare a Scribd company logo
1 of 38
Download to read offline
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!

More Related Content

Similar to 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 to 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
 

More from 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
 

More from 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
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Having fun with jabber bots