Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Intergalactic Javascript Robots from Outer Space

Intergalactic Javascript Robots from Outer Space

Vicent Martí

July 06, 2012
Tweet

More Decks by Vicent Martí

Other Decks in Programming

Transcript

  1. a hubot plugin is just a
    coffeescript file

    View full-size slide

  2. the plugin is initialized
    in the module’s main export
    a hubot plugin is just a
    coffeescript file

    View full-size slide

  3. the plugin is initialized
    in the module’s main export
    the ‘respond’ method takes
    a regex and a callback
    a hubot plugin is just a
    coffeescript file

    View full-size slide

  4. the plugin is initialized
    in the module’s main export
    the ‘respond’ method takes
    a regex and a callback
    the ‘send’ method in the message
    can be used to answer the query
    a hubot plugin is just a
    coffeescript file

    View full-size slide

  5. the ‘http’ method in ‘msg’
    starts composing an http request

    View full-size slide

  6. the ‘http’ method in ‘msg’
    starts composing an http request
    chain it with ‘query’ to set
    the query parameters

    View full-size slide

  7. the ‘http’ method in ‘msg’
    starts composing an http request
    chain it with ‘query’ to set
    the query parameters
    ...or with ‘header’ to set the
    headers for the request

    View full-size slide

  8. the ‘http’ method in ‘msg’
    starts composing an http request
    chain it with ‘query’ to set
    the query parameters
    ...or with ‘header’ to set the
    headers for the request
    perform the request with ‘get’,
    ‘post’, ‘put’, ‘patch’ or ‘delete’!

    View full-size slide

  9. look! a copy of rms’ famous
    interjection speech!

    View full-size slide

  10. look! a copy of rms’ famous
    interjection speech!
    use ‘hear’ instead of
    ‘respond’ to listen to all
    incoming chat messages

    View full-size slide

  11. look! a copy of rms’ famous
    interjection speech!
    use ‘hear’ instead of
    ‘respond’ to listen to all
    incoming chat messages
    ...and then reply with the
    speech if somebody says “linux”

    View full-size slide