SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
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!

Contenu connexe

Similaire à 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
 

Similaire à 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
 

Plus 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
 

Plus 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
 

Dernier

Dernier (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
"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 ...
 
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...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.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
 

Having fun with jabber bots