SlideShare a Scribd company logo
Jabber Bot
By Ezwan Aizat bin Abdullah Faiz
aizat.faiz@gmail.com
http://aizatto.com



                                           http://creativecommons.org/licenses/by/3.0/
http://flickr.com/photos/warmnfuzzy/466382464/
http://creativecommons.org/licenses/by/3.0/
http://flickr.com/photos/warmnfuzzy/466382464/
http://creativecommons.org/licenses/by/3.0/
http://flickr.com/photos/warmnfuzzy/466382464/
http://flickr.com/photos/warmnfuzzy/466382464/
Who Am I?

Go by many names
                    Student
  ezwan aizat bin
  abdullah faiz     Web Developer

  aizatto           That out of shape
  zatto             guy trying to climb a
                    mountain
Warning!



http://tango.freedesktop.org
There will be CODE



http://tango.freedesktop.org
a persons ability to
              type/code is greatly
                 impaired when
                   presenting

http://tango.freedesktop.org
BDD
                      Behavior Driven Development




                                                             http://behaviour-driven.org/
                               http://en.wikipedia.org/wiki/Behavior_Driven_Development
http://flickr.com/photos/baboon/3946055/
What is

Jabber?
What is

         XMPP?
eXtensible Messaging and Presence Protocol



                           http://en.wikipedia.org/wiki/XMPP
why?



http://flickr.com/photos/genewolf/147722495/
fun



http://flickr.com/photos/evank750i/306288390/
services built on top of
Straw Poll
http://strawpollnow.com
foamee
http://foamee.com
under construction...
monitoring



http://flickr.com/photos/parl/3231111/
any other ideas?



http://flickr.com/photos/genewolf/147722495/
Lets start
                           CODING!



http://flickr.com/photos/warmnfuzzy/466382456/
RubyGems
  Execute:

    sudo gem install xmpp4r ZenTest rspec daemons



  Optional:

    sudo gem install hpricot




http://flickr.com/photos/mikeleary83/1729114228/
Setup Directory Structure
  Execute:

    mkdir -p xmpp/{autotest,bin,db,config,lib,spec/sample}




http://flickr.com/photos/mikeleary83/1729114228/
Setup Autotest
  File:
    ./autotest/discover.rb



  Contents:
    Autotest.add_discovery do quot;rspecquot; end



  Execute:

    autotest

http://flickr.com/photos/mikeleary83/1729114228/
Create Spec for
      Client#apply_rules(message)
  File:
    ./spec/client_spec.rb




http://flickr.com/photos/mikeleary83/1729114228/
Implement
      Client#apply_rules(message)
  File:
    ./lib/client.rb




http://flickr.com/photos/mikeleary83/1729114228/
We would like to use
          actual XMPP messages

            We would like to use actual XMPP messages,
            serialized

            Need to capture them somehow

            Create Daemon to serialize messages, easier
            to recreate messages



http://flickr.com/photos/mikeleary83/1729114228/
Create Daemon

  File:
    ./config/jabber.yml




  File:
    ./bin/daemon.rb




http://flickr.com/photos/mikeleary83/1729114228/
Create Daemon

  Start:
    ruby bin/daemon.rb start




  Stop:
    ruby bin/daemon.rb stop




http://flickr.com/photos/mikeleary83/1729114228/
Wait for Tweets
        to come in and serialize



http://flickr.com/photos/mikeleary83/1729114228/
or use sample ones...



http://flickr.com/photos/mikeleary83/1729114228/
<?xml version=quot;1.0quot;?>
<message xmlns=quot;jabber:clientquot; from=quot;twitter@twitter.comquot; type=quot;chatquot;
id=quot;tag:twitter.com:2877533quot; to=quot;aizat.faiz@gmail.comquot;>
  <body>seanx2: @strawpoll cat KITTIES FTW!!!</body>
  <entry xmlns=quot;http://www.w3.org/2005/Atomquot;>
    <source>
      <title>Twitter / seanx2</title>
      <link href=quot;http://twitter.com/seanx2quot;/>
      <link href=quot;http://twitter.com/statuses/user_timeline/seanx2.atomquot; rel=quot;selfquot;
type=quot;application/atom+xmlquot;/>
      <author>
        <name>seanx2</name>
      </author>
      <icon>http://s3.amazonaws.com/twitter_production/profile_images/24969932/
seanx2_normal.png</icon>
    </source>
    <title>seanx2: @strawpoll cat KITTIES FTW!!!</title>
    <summary>seanx2: @strawpoll cat KITTIES FTW!!!</summary>
    <link href=quot;http://twitter.com/seanx2/statuses/777710064quot; rel=quot;alternatequot; type=quot;text/
htmlquot;/>
    <id>tag:twitter.com,2008-03-27T01:10:41+00:00:/statuses/777710064</id>
    <published>2008-03-27T01:10:41+00:00</published>
    <updated>2008-03-27T01:10:41+00:00</updated>
  </entry>
</message>




http://flickr.com/photos/mikeleary83/1729114228/
<?xml version=quot;1.0quot;?>
<message xmlns=quot;jabber:clientquot; from=quot;twitter@twitter.comquot; type=quot;chatquot;
id=quot;tag:twitter.com:2877533quot; to=quot;aizat.faiz@gmail.comquot;>
  <body>seanx2: @strawpoll cat KITTIES FTW!!!</body>
  <entry xmlns=quot;http://www.w3.org/2005/Atomquot;>
    <source>
      <title>Twitter / seanx2</title>
      <link href=quot;http://twitter.com/seanx2quot;/>
      <link href=quot;http://twitter.com/statuses/user_timeline/seanx2.atomquot; rel=quot;selfquot;
type=quot;application/atom+xmlquot;/>
      <author>
        <name>seanx2</name>
      </author>
      <icon>http://s3.amazonaws.com/twitter_production/profile_images/24969932/
seanx2_normal.png</icon>
    </source>
    <title>seanx2: @strawpoll cat KITTIES FTW!!!</title>
    <summary>seanx2: @strawpoll cat KITTIES FTW!!!</summary>
    <link href=quot;http://twitter.com/seanx2/statuses/777710064quot; rel=quot;alternatequot; type=quot;text/
htmlquot;/>
    <id>tag:twitter.com,2008-03-27T01:10:41+00:00:/statuses/777710064</id>
    <published>2008-03-27T01:10:41+00:00</published>
    <updated>2008-03-27T01:10:41+00:00</updated>
  </entry>
</message>




http://flickr.com/photos/mikeleary83/1729114228/
<?xml version=quot;1.0quot;?>
<message xmlns=quot;jabber:clientquot; from=quot;twitter@twitter.comquot; type=quot;chatquot;
id=quot;tag:twitter.com:952601quot; to=quot;aizat.faiz@gmail.comquot;>
  <body>rajaseelan: wow .. jigdo me this batman: Im still downloading Fedora 9 Beta,
since yesterday 0630 :P</body>
  <entry xmlns=quot;http://www.w3.org/2005/Atomquot;>
    <source>
      <title>Twitter / rajaseelan</title>
      <link href=quot;http://twitter.com/rajaseelanquot;/>
      <link href=quot;http://twitter.com/statuses/user_timeline/rajaseelan.atomquot; rel=quot;selfquot;
type=quot;application/atom+xmlquot;/>
      <author>
        <name>rajaseelan</name>
      </author>
      <icon>http://s3.amazonaws.com/twitter_production/profile_images/36242282/raja-
profile_normal.png</icon>
    </source>
    <title>rajaseelan: wow .. jigdo me this batman: Im still downloading Fedora 9 Beta,
since yesterday 0630 :P</title>
    <summary>rajaseelan: wow .. jigdo me this batman: Im still downloading Fedora 9 Beta,
since yesterday 0630 :P</summary>
    <link href=quot;http://twitter.com/rajaseelan/statuses/777649976quot; rel=quot;alternatequot;
type=quot;text/htmlquot;/>
    <id>tag:twitter.com,2008-03-26T22:48:10+00:00:/statuses/777649976</id>
    <published>2008-03-26T22:48:10+00:00</published>
    <updated>2008-03-26T22:48:10+00:00</updated>
  </entry>
</message>
http://flickr.com/photos/mikeleary83/1729114228/
<?xml version=quot;1.0quot;?>
<message xmlns=quot;jabber:clientquot; from=quot;twitter@twitter.comquot; type=quot;chatquot;
id=quot;tag:twitter.com:952601quot; to=quot;aizat.faiz@gmail.comquot;>
  <body>rajaseelan: wow .. jigdo me this batman: Im still downloading Fedora 9 Beta,
since yesterday 0630 :P</body>
  <entry xmlns=quot;http://www.w3.org/2005/Atomquot;>
    <source>
      <title>Twitter / rajaseelan</title>
      <link href=quot;http://twitter.com/rajaseelanquot;/>
      <link href=quot;http://twitter.com/statuses/user_timeline/rajaseelan.atomquot; rel=quot;selfquot;
type=quot;application/atom+xmlquot;/>
      <author>
        <name>rajaseelan</name>
      </author>
      <icon>http://s3.amazonaws.com/twitter_production/profile_images/36242282/raja-
profile_normal.png</icon>
    </source>
    <title>rajaseelan: wow .. jigdo me this batman: Im still downloading Fedora 9 Beta,
since yesterday 0630 :P</title>
    <summary>rajaseelan: wow .. jigdo me this batman: Im still downloading Fedora 9 Beta,
since yesterday 0630 :P</summary>
    <link href=quot;http://twitter.com/rajaseelan/statuses/777649976quot; rel=quot;alternatequot;
type=quot;text/htmlquot;/>
    <id>tag:twitter.com,2008-03-26T22:48:10+00:00:/statuses/777649976</id>
    <published>2008-03-26T22:48:10+00:00</published>
    <updated>2008-03-26T22:48:10+00:00</updated>
  </entry>
</message>
http://flickr.com/photos/mikeleary83/1729114228/
Hpricot




   A Fast, Enjoyable HTML Parser for Ruby
               http://code.whytheluckystiff.net/hpricot/


http://flickr.com/photos/mikeleary83/1729114228/
i                        hpricot

http://flickr.com/photos/mikeleary83/1729114228/
I can use the serialized Tweets
           in the spec now
  File:
    ./spec/client_spec.rb




http://flickr.com/photos/mikeleary83/1729114228/
Flesh out my Bot

  File:
    ./spec/client_spec.rb




  File:
    ./lib/client.rb




http://flickr.com/photos/mikeleary83/1729114228/
Build your own

              bot Army!
http://flickr.com/photos/dystopos/8921528/
http://flickr.com/photos/dystopos/8921528/
any other ideas?



http://flickr.com/photos/genewolf/147722495/
kthxbai
                       aizat.faiz@gmail.com



                                           http://creativecommons.org/licenses/by/3.0/
http://flickr.com/photos/warmnfuzzy/466382466/

More Related Content

What's hot

Joomla! Plugin Development
Joomla! Plugin DevelopmentJoomla! Plugin Development
Joomla! Plugin Development
Yireo
 
Hardening WordPress - SAScon Manchester 2013 (WordPress Security)
Hardening WordPress - SAScon Manchester 2013 (WordPress Security)Hardening WordPress - SAScon Manchester 2013 (WordPress Security)
Hardening WordPress - SAScon Manchester 2013 (WordPress Security)
Bastian Grimm
 
Introduction to WordPress Class 3
Introduction to WordPress Class 3Introduction to WordPress Class 3
Introduction to WordPress Class 3
Adrian Mikeliunas
 
VP R&D Open Seminar: Caching
VP R&D Open Seminar: CachingVP R&D Open Seminar: Caching
VP R&D Open Seminar: Caching
Moshe Kaplan
 
Campaign Metrics - Measure Camp 2013
Campaign Metrics - Measure Camp 2013Campaign Metrics - Measure Camp 2013
Campaign Metrics - Measure Camp 2013Steve Lock
 
Facebook Connect
Facebook ConnectFacebook Connect
Facebook Connect
Pitra Satvika
 
Facebook Apps Development 101 (Java)
Facebook Apps Development 101 (Java)Facebook Apps Development 101 (Java)
Facebook Apps Development 101 (Java)
Damon Widjaja
 
Introduction to WordPress Class 4
Introduction to WordPress Class 4Introduction to WordPress Class 4
Introduction to WordPress Class 4
Adrian Mikeliunas
 
Plugins at WordCamp Phoenix
Plugins at WordCamp PhoenixPlugins at WordCamp Phoenix
Plugins at WordCamp PhoenixAndrew Ryno
 
Introduction to WordPress Class 2
Introduction to WordPress Class 2Introduction to WordPress Class 2
Introduction to WordPress Class 2
Adrian Mikeliunas
 
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'Abhishek Kumar
 
Hardcore SEO Power Tools - SMX London 2013
Hardcore SEO Power Tools - SMX London 2013Hardcore SEO Power Tools - SMX London 2013
Hardcore SEO Power Tools - SMX London 2013
Steve Lock
 
Introduction to WordPress Class 6
Introduction to WordPress Class 6Introduction to WordPress Class 6
Introduction to WordPress Class 6
Adrian Mikeliunas
 
Paul Campbell — A Modern Approach to Third-Party Embedded Widgets (Turing Fes...
Paul Campbell — A Modern Approach to Third-Party Embedded Widgets (Turing Fes...Paul Campbell — A Modern Approach to Third-Party Embedded Widgets (Turing Fes...
Paul Campbell — A Modern Approach to Third-Party Embedded Widgets (Turing Fes...
Turing Fest
 
Introduction to rg\injection
Introduction to rg\injectionIntroduction to rg\injection
Introduction to rg\injection
Bastian Hofmann
 
Don't sh** in the Pool
Don't sh** in the PoolDon't sh** in the Pool
Don't sh** in the PoolChris Jean
 
Best Wordpress Plug-Ins - SEMpdx Searchfest 2009
Best Wordpress Plug-Ins - SEMpdx Searchfest 2009Best Wordpress Plug-Ins - SEMpdx Searchfest 2009
Best Wordpress Plug-Ins - SEMpdx Searchfest 2009
David Wallace
 
Introduction to WordPress Class 5
Introduction to WordPress Class 5Introduction to WordPress Class 5
Introduction to WordPress Class 5
Adrian Mikeliunas
 
The page and the desktop
The page and the desktopThe page and the desktop
The page and the desktop
Glenn Jones
 

What's hot (20)

Joomla! Plugin Development
Joomla! Plugin DevelopmentJoomla! Plugin Development
Joomla! Plugin Development
 
Hardening WordPress - SAScon Manchester 2013 (WordPress Security)
Hardening WordPress - SAScon Manchester 2013 (WordPress Security)Hardening WordPress - SAScon Manchester 2013 (WordPress Security)
Hardening WordPress - SAScon Manchester 2013 (WordPress Security)
 
Introduction to WordPress Class 3
Introduction to WordPress Class 3Introduction to WordPress Class 3
Introduction to WordPress Class 3
 
VP R&D Open Seminar: Caching
VP R&D Open Seminar: CachingVP R&D Open Seminar: Caching
VP R&D Open Seminar: Caching
 
Campaign Metrics - Measure Camp 2013
Campaign Metrics - Measure Camp 2013Campaign Metrics - Measure Camp 2013
Campaign Metrics - Measure Camp 2013
 
Facebook Connect
Facebook ConnectFacebook Connect
Facebook Connect
 
Facebook Apps Development 101 (Java)
Facebook Apps Development 101 (Java)Facebook Apps Development 101 (Java)
Facebook Apps Development 101 (Java)
 
Introduction to WordPress Class 4
Introduction to WordPress Class 4Introduction to WordPress Class 4
Introduction to WordPress Class 4
 
Plugins at WordCamp Phoenix
Plugins at WordCamp PhoenixPlugins at WordCamp Phoenix
Plugins at WordCamp Phoenix
 
Introduction to WordPress Class 2
Introduction to WordPress Class 2Introduction to WordPress Class 2
Introduction to WordPress Class 2
 
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
Presentation on "XSS Defeating Concept in (secure)SiteHoster" : 'nullcon-2011'
 
Hardcore SEO Power Tools - SMX London 2013
Hardcore SEO Power Tools - SMX London 2013Hardcore SEO Power Tools - SMX London 2013
Hardcore SEO Power Tools - SMX London 2013
 
Pr7 8 clubwear-and-party-wear
Pr7 8 clubwear-and-party-wearPr7 8 clubwear-and-party-wear
Pr7 8 clubwear-and-party-wear
 
Introduction to WordPress Class 6
Introduction to WordPress Class 6Introduction to WordPress Class 6
Introduction to WordPress Class 6
 
Paul Campbell — A Modern Approach to Third-Party Embedded Widgets (Turing Fes...
Paul Campbell — A Modern Approach to Third-Party Embedded Widgets (Turing Fes...Paul Campbell — A Modern Approach to Third-Party Embedded Widgets (Turing Fes...
Paul Campbell — A Modern Approach to Third-Party Embedded Widgets (Turing Fes...
 
Introduction to rg\injection
Introduction to rg\injectionIntroduction to rg\injection
Introduction to rg\injection
 
Don't sh** in the Pool
Don't sh** in the PoolDon't sh** in the Pool
Don't sh** in the Pool
 
Best Wordpress Plug-Ins - SEMpdx Searchfest 2009
Best Wordpress Plug-Ins - SEMpdx Searchfest 2009Best Wordpress Plug-Ins - SEMpdx Searchfest 2009
Best Wordpress Plug-Ins - SEMpdx Searchfest 2009
 
Introduction to WordPress Class 5
Introduction to WordPress Class 5Introduction to WordPress Class 5
Introduction to WordPress Class 5
 
The page and the desktop
The page and the desktopThe page and the desktop
The page and the desktop
 

Viewers also liked

The Future Of Travel
The Future Of TravelThe Future Of Travel
The Future Of TravelAizat Faiz
 
Read Write Culture
Read  Write  CultureRead  Write  Culture
Read Write CultureAizat Faiz
 
Presentation Of Services Synergon Consulting
Presentation Of Services Synergon ConsultingPresentation Of Services Synergon Consulting
Presentation Of Services Synergon ConsultingAdelina Nicoleta FRONEA
 
Free and Open Source Software Society Malaysia
Free and Open Source Software Society MalaysiaFree and Open Source Software Society Malaysia
Free and Open Source Software Society Malaysia
Aizat Faiz
 
The Age of Collaboration
The Age of CollaborationThe Age of Collaboration
The Age of CollaborationAizat Faiz
 
On Things Getting More Colourful
On Things Getting More ColourfulOn Things Getting More Colourful
On Things Getting More Colourfulsidek1ck
 
U11 Heat Temperature
U11 Heat TemperatureU11 Heat Temperature
U11 Heat TemperatureAlkor
 

Viewers also liked (8)

The Future Of Travel
The Future Of TravelThe Future Of Travel
The Future Of Travel
 
Read Write Culture
Read  Write  CultureRead  Write  Culture
Read Write Culture
 
Presentation Of Services Synergon Consulting
Presentation Of Services Synergon ConsultingPresentation Of Services Synergon Consulting
Presentation Of Services Synergon Consulting
 
Free and Open Source Software Society Malaysia
Free and Open Source Software Society MalaysiaFree and Open Source Software Society Malaysia
Free and Open Source Software Society Malaysia
 
The Age of Collaboration
The Age of CollaborationThe Age of Collaboration
The Age of Collaboration
 
On Things Getting More Colourful
On Things Getting More ColourfulOn Things Getting More Colourful
On Things Getting More Colourful
 
Heat
HeatHeat
Heat
 
U11 Heat Temperature
U11 Heat TemperatureU11 Heat Temperature
U11 Heat Temperature
 

Similar to Jabber Bot

Illuminated Hacks -- Where 2.0 101 Tutorial
Illuminated Hacks -- Where 2.0 101 TutorialIlluminated Hacks -- Where 2.0 101 Tutorial
Illuminated Hacks -- Where 2.0 101 Tutorial
mikel_maron
 
Services web RESTful
Services web RESTfulServices web RESTful
Services web RESTfulgoldoraf
 
Mobile Web Performance - Velocity 2011
Mobile Web Performance - Velocity 2011Mobile Web Performance - Velocity 2011
Mobile Web Performance - Velocity 2011
Barbara Bermes
 
HTML5 Overview
HTML5 OverviewHTML5 Overview
HTML5 Overview
reybango
 
Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3
Pradeep Varadaraja Banavara
 
Struts2 course chapter 2: installation and configuration
Struts2 course chapter 2: installation and configurationStruts2 course chapter 2: installation and configuration
Struts2 course chapter 2: installation and configuration
JavaEE Trainers
 
Developing for Mobile
Developing for MobileDeveloping for Mobile
Developing for Mobile
Remy Sharp
 
Mobile Web Speed Bumps
Mobile Web Speed BumpsMobile Web Speed Bumps
Mobile Web Speed Bumps
Nicholas Zakas
 
Snakes on the Web
Snakes on the WebSnakes on the Web
Snakes on the Web
Jacob Kaplan-Moss
 
Creating Book Trailers
Creating Book TrailersCreating Book Trailers
Creating Book Trailers
Naomi Bates
 
Web services and JavaScript
Web services and JavaScriptWeb services and JavaScript
Web services and JavaScript
Christian Heilmann
 
Velocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and youVelocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and you
Patrick Meenan
 
Silos are for farmers
Silos are for farmersSilos are for farmers
Silos are for farmers
Julian Simpson
 
Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0
Estelle Weyl
 
Ruby Robots
Ruby RobotsRuby Robots
Ruby Robots
Daniel Cukier
 
Monitoring web application behaviour with cucumber-nagios
Monitoring web application behaviour with cucumber-nagiosMonitoring web application behaviour with cucumber-nagios
Monitoring web application behaviour with cucumber-nagios
Lindsay Holmwood
 
StirTrek 2018 - Rapid API Development with Sails
StirTrek 2018 - Rapid API Development with SailsStirTrek 2018 - Rapid API Development with Sails
StirTrek 2018 - Rapid API Development with Sails
Justin James
 
Developing for iPhone
Developing for iPhoneDeveloping for iPhone
Developing for iPhone
Tim Lucas
 
Plagger the duct tape of internet
Plagger the duct tape of internetPlagger the duct tape of internet
Plagger the duct tape of internet
Tatsuhiko Miyagawa
 
Shifting Gears
Shifting GearsShifting Gears
Shifting Gears
Christian Heilmann
 

Similar to Jabber Bot (20)

Illuminated Hacks -- Where 2.0 101 Tutorial
Illuminated Hacks -- Where 2.0 101 TutorialIlluminated Hacks -- Where 2.0 101 Tutorial
Illuminated Hacks -- Where 2.0 101 Tutorial
 
Services web RESTful
Services web RESTfulServices web RESTful
Services web RESTful
 
Mobile Web Performance - Velocity 2011
Mobile Web Performance - Velocity 2011Mobile Web Performance - Velocity 2011
Mobile Web Performance - Velocity 2011
 
HTML5 Overview
HTML5 OverviewHTML5 Overview
HTML5 Overview
 
Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3
 
Struts2 course chapter 2: installation and configuration
Struts2 course chapter 2: installation and configurationStruts2 course chapter 2: installation and configuration
Struts2 course chapter 2: installation and configuration
 
Developing for Mobile
Developing for MobileDeveloping for Mobile
Developing for Mobile
 
Mobile Web Speed Bumps
Mobile Web Speed BumpsMobile Web Speed Bumps
Mobile Web Speed Bumps
 
Snakes on the Web
Snakes on the WebSnakes on the Web
Snakes on the Web
 
Creating Book Trailers
Creating Book TrailersCreating Book Trailers
Creating Book Trailers
 
Web services and JavaScript
Web services and JavaScriptWeb services and JavaScript
Web services and JavaScript
 
Velocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and youVelocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and you
 
Silos are for farmers
Silos are for farmersSilos are for farmers
Silos are for farmers
 
Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0
 
Ruby Robots
Ruby RobotsRuby Robots
Ruby Robots
 
Monitoring web application behaviour with cucumber-nagios
Monitoring web application behaviour with cucumber-nagiosMonitoring web application behaviour with cucumber-nagios
Monitoring web application behaviour with cucumber-nagios
 
StirTrek 2018 - Rapid API Development with Sails
StirTrek 2018 - Rapid API Development with SailsStirTrek 2018 - Rapid API Development with Sails
StirTrek 2018 - Rapid API Development with Sails
 
Developing for iPhone
Developing for iPhoneDeveloping for iPhone
Developing for iPhone
 
Plagger the duct tape of internet
Plagger the duct tape of internetPlagger the duct tape of internet
Plagger the duct tape of internet
 
Shifting Gears
Shifting GearsShifting Gears
Shifting Gears
 

Recently uploaded

Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 

Recently uploaded (20)

Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 

Jabber Bot

  • 1. Jabber Bot By Ezwan Aizat bin Abdullah Faiz aizat.faiz@gmail.com http://aizatto.com http://creativecommons.org/licenses/by/3.0/ http://flickr.com/photos/warmnfuzzy/466382464/
  • 5. Who Am I? Go by many names Student ezwan aizat bin abdullah faiz Web Developer aizatto That out of shape zatto guy trying to climb a mountain
  • 6.
  • 8. There will be CODE http://tango.freedesktop.org
  • 9. a persons ability to type/code is greatly impaired when presenting http://tango.freedesktop.org
  • 10.
  • 11. BDD Behavior Driven Development http://behaviour-driven.org/ http://en.wikipedia.org/wiki/Behavior_Driven_Development http://flickr.com/photos/baboon/3946055/
  • 12.
  • 14. What is XMPP? eXtensible Messaging and Presence Protocol http://en.wikipedia.org/wiki/XMPP
  • 23. Lets start CODING! http://flickr.com/photos/warmnfuzzy/466382456/
  • 24. RubyGems Execute: sudo gem install xmpp4r ZenTest rspec daemons Optional: sudo gem install hpricot http://flickr.com/photos/mikeleary83/1729114228/
  • 25. Setup Directory Structure Execute: mkdir -p xmpp/{autotest,bin,db,config,lib,spec/sample} http://flickr.com/photos/mikeleary83/1729114228/
  • 26. Setup Autotest File: ./autotest/discover.rb Contents: Autotest.add_discovery do quot;rspecquot; end Execute: autotest http://flickr.com/photos/mikeleary83/1729114228/
  • 27. Create Spec for Client#apply_rules(message) File: ./spec/client_spec.rb http://flickr.com/photos/mikeleary83/1729114228/
  • 28. Implement Client#apply_rules(message) File: ./lib/client.rb http://flickr.com/photos/mikeleary83/1729114228/
  • 29. We would like to use actual XMPP messages We would like to use actual XMPP messages, serialized Need to capture them somehow Create Daemon to serialize messages, easier to recreate messages http://flickr.com/photos/mikeleary83/1729114228/
  • 30. Create Daemon File: ./config/jabber.yml File: ./bin/daemon.rb http://flickr.com/photos/mikeleary83/1729114228/
  • 31. Create Daemon Start: ruby bin/daemon.rb start Stop: ruby bin/daemon.rb stop http://flickr.com/photos/mikeleary83/1729114228/
  • 32. Wait for Tweets to come in and serialize http://flickr.com/photos/mikeleary83/1729114228/
  • 33. or use sample ones... http://flickr.com/photos/mikeleary83/1729114228/
  • 34. <?xml version=quot;1.0quot;?> <message xmlns=quot;jabber:clientquot; from=quot;twitter@twitter.comquot; type=quot;chatquot; id=quot;tag:twitter.com:2877533quot; to=quot;aizat.faiz@gmail.comquot;> <body>seanx2: @strawpoll cat KITTIES FTW!!!</body> <entry xmlns=quot;http://www.w3.org/2005/Atomquot;> <source> <title>Twitter / seanx2</title> <link href=quot;http://twitter.com/seanx2quot;/> <link href=quot;http://twitter.com/statuses/user_timeline/seanx2.atomquot; rel=quot;selfquot; type=quot;application/atom+xmlquot;/> <author> <name>seanx2</name> </author> <icon>http://s3.amazonaws.com/twitter_production/profile_images/24969932/ seanx2_normal.png</icon> </source> <title>seanx2: @strawpoll cat KITTIES FTW!!!</title> <summary>seanx2: @strawpoll cat KITTIES FTW!!!</summary> <link href=quot;http://twitter.com/seanx2/statuses/777710064quot; rel=quot;alternatequot; type=quot;text/ htmlquot;/> <id>tag:twitter.com,2008-03-27T01:10:41+00:00:/statuses/777710064</id> <published>2008-03-27T01:10:41+00:00</published> <updated>2008-03-27T01:10:41+00:00</updated> </entry> </message> http://flickr.com/photos/mikeleary83/1729114228/
  • 35. <?xml version=quot;1.0quot;?> <message xmlns=quot;jabber:clientquot; from=quot;twitter@twitter.comquot; type=quot;chatquot; id=quot;tag:twitter.com:2877533quot; to=quot;aizat.faiz@gmail.comquot;> <body>seanx2: @strawpoll cat KITTIES FTW!!!</body> <entry xmlns=quot;http://www.w3.org/2005/Atomquot;> <source> <title>Twitter / seanx2</title> <link href=quot;http://twitter.com/seanx2quot;/> <link href=quot;http://twitter.com/statuses/user_timeline/seanx2.atomquot; rel=quot;selfquot; type=quot;application/atom+xmlquot;/> <author> <name>seanx2</name> </author> <icon>http://s3.amazonaws.com/twitter_production/profile_images/24969932/ seanx2_normal.png</icon> </source> <title>seanx2: @strawpoll cat KITTIES FTW!!!</title> <summary>seanx2: @strawpoll cat KITTIES FTW!!!</summary> <link href=quot;http://twitter.com/seanx2/statuses/777710064quot; rel=quot;alternatequot; type=quot;text/ htmlquot;/> <id>tag:twitter.com,2008-03-27T01:10:41+00:00:/statuses/777710064</id> <published>2008-03-27T01:10:41+00:00</published> <updated>2008-03-27T01:10:41+00:00</updated> </entry> </message> http://flickr.com/photos/mikeleary83/1729114228/
  • 36. <?xml version=quot;1.0quot;?> <message xmlns=quot;jabber:clientquot; from=quot;twitter@twitter.comquot; type=quot;chatquot; id=quot;tag:twitter.com:952601quot; to=quot;aizat.faiz@gmail.comquot;> <body>rajaseelan: wow .. jigdo me this batman: Im still downloading Fedora 9 Beta, since yesterday 0630 :P</body> <entry xmlns=quot;http://www.w3.org/2005/Atomquot;> <source> <title>Twitter / rajaseelan</title> <link href=quot;http://twitter.com/rajaseelanquot;/> <link href=quot;http://twitter.com/statuses/user_timeline/rajaseelan.atomquot; rel=quot;selfquot; type=quot;application/atom+xmlquot;/> <author> <name>rajaseelan</name> </author> <icon>http://s3.amazonaws.com/twitter_production/profile_images/36242282/raja- profile_normal.png</icon> </source> <title>rajaseelan: wow .. jigdo me this batman: Im still downloading Fedora 9 Beta, since yesterday 0630 :P</title> <summary>rajaseelan: wow .. jigdo me this batman: Im still downloading Fedora 9 Beta, since yesterday 0630 :P</summary> <link href=quot;http://twitter.com/rajaseelan/statuses/777649976quot; rel=quot;alternatequot; type=quot;text/htmlquot;/> <id>tag:twitter.com,2008-03-26T22:48:10+00:00:/statuses/777649976</id> <published>2008-03-26T22:48:10+00:00</published> <updated>2008-03-26T22:48:10+00:00</updated> </entry> </message> http://flickr.com/photos/mikeleary83/1729114228/
  • 37. <?xml version=quot;1.0quot;?> <message xmlns=quot;jabber:clientquot; from=quot;twitter@twitter.comquot; type=quot;chatquot; id=quot;tag:twitter.com:952601quot; to=quot;aizat.faiz@gmail.comquot;> <body>rajaseelan: wow .. jigdo me this batman: Im still downloading Fedora 9 Beta, since yesterday 0630 :P</body> <entry xmlns=quot;http://www.w3.org/2005/Atomquot;> <source> <title>Twitter / rajaseelan</title> <link href=quot;http://twitter.com/rajaseelanquot;/> <link href=quot;http://twitter.com/statuses/user_timeline/rajaseelan.atomquot; rel=quot;selfquot; type=quot;application/atom+xmlquot;/> <author> <name>rajaseelan</name> </author> <icon>http://s3.amazonaws.com/twitter_production/profile_images/36242282/raja- profile_normal.png</icon> </source> <title>rajaseelan: wow .. jigdo me this batman: Im still downloading Fedora 9 Beta, since yesterday 0630 :P</title> <summary>rajaseelan: wow .. jigdo me this batman: Im still downloading Fedora 9 Beta, since yesterday 0630 :P</summary> <link href=quot;http://twitter.com/rajaseelan/statuses/777649976quot; rel=quot;alternatequot; type=quot;text/htmlquot;/> <id>tag:twitter.com,2008-03-26T22:48:10+00:00:/statuses/777649976</id> <published>2008-03-26T22:48:10+00:00</published> <updated>2008-03-26T22:48:10+00:00</updated> </entry> </message> http://flickr.com/photos/mikeleary83/1729114228/
  • 38. Hpricot A Fast, Enjoyable HTML Parser for Ruby http://code.whytheluckystiff.net/hpricot/ http://flickr.com/photos/mikeleary83/1729114228/
  • 39. i hpricot http://flickr.com/photos/mikeleary83/1729114228/
  • 40. I can use the serialized Tweets in the spec now File: ./spec/client_spec.rb http://flickr.com/photos/mikeleary83/1729114228/
  • 41. Flesh out my Bot File: ./spec/client_spec.rb File: ./lib/client.rb http://flickr.com/photos/mikeleary83/1729114228/
  • 42. Build your own bot Army! http://flickr.com/photos/dystopos/8921528/
  • 45. kthxbai aizat.faiz@gmail.com http://creativecommons.org/licenses/by/3.0/ http://flickr.com/photos/warmnfuzzy/466382466/