Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
there once was a command line
nav filesystem, launch apps, write scripts
Input                                                    Output

                                            Program




l...
STDIN                                                     STDOUT

                                          Program



   ...
Infrastructure

           STDIN                                                      STDOUT

                            ...
and we’ve had it since 1977
                              1977
1997
fast foward 20 years just after commercialization of internet to a perl conference
jon udell talks about websites as ...
a new programming paradigm
            that takes the whole Internet
                    as its platform



              ...
“What is the equivalent of the pipe
          in the age of the web?”


tim oreilly to ask in 2000...
there seems to be resounding consensus the answer is feeds
they sound good in theory
it makes you think of feeds like in the telecom world
data coming directly to you
but we know that’s not how it works
?




instead we have to go request the data
then it gives it to us. and we do this over and over.
?




client side mashups might be able to get by with this
?




but when you start talking about persistent web applications, it becomes a bit more work
?


    • Crontab / Daemon
    • Parsing
    • Caching
?


                                       • Crontab / Daemon
                                       • Parsing
           ...
Command-line
                                 Application
                             Start                              ...
Web
                                   Application

                                                            Always
   ...
here we have some daemons.
this is ps doom
so using this metaphor, how do daemons communicate?
IPC?
       Inter process communication




ipc?
lol
                         h4x



                                                      stfu
                           ...
it turns out amazon provides a queue web service
but with a third party queue you only defer the polling
it doesn’t solve ...
so this is not the solution, and probably why not too many people use or know of it
Real-time
 Efficient
   Easy
Web Hooks




web hooks are user defined callback URLs that point to a web script to run on a certain event.
you can call t...
Web Hooks
                                  • User Callbacks
                                  • Triggers
                ...
to implement web hooks, you generally provide a ui--
for the user to specify a url for events
http://example.com/post-commit.php
http://example.com/post-commit.php




                                                             Infrastructure
what th...
Easy for Vendors




the idea is that it’s easy for vendors to integrate
the main mechanism is a standard http post, which is trivial in most environments
Easy (enough) for Users




it’s also very open and easy for the users, which will generally be advanced users, but can ea...
as a user, to take advantage of hooks, you’d write a script to handle an event, like the commit
this is a very simple script
“Internet”




so what the user would do
“Internet”




is put that script up on the internet
“Internet”




then they’d go to the hook settings page
and hook the commit event up to their script
then as the user interacts with devjavu
Commit!




and they make a commit, it fires a post to their script
Commit!




the script runs, and send an email to the mailing list
Commit!




this makes the user a happy cookie.
and this is a trivial example, using only on web service.
imagine using th...
Commit!




but even in this simple example, you see the power it gives to the user and to the data that we’re
trying to “...
STDIN                                                      STDOUT

                                         Program




ba...
STDIN

                                            Program




we wouldn’t be able to do it without the output part of it
API

                                           Web App




unfortunately that’s how the web is today.
the only output you...
API                                                            Hooks

                                           Web App

...
Program the Web




the possibilities become very rich and i’ve thought about it a lot
there’s probably a lot more
imagine...
Fin
Questions?




 blogrium.com
SuperHappyDevHouse
API                                                            Hooks

                                           Web App

...
Upcoming SlideShare
Loading in …5
×

Web Hooks

26,302 views

Published on

A talk I gave at several places trying to evangelize the web hook pattern. More information at http://webhooks.pbwiki.com

Published in: Technology

Web Hooks

  1. 1. there once was a command line nav filesystem, launch apps, write scripts
  2. 2. Input Output Program lots of power in a bit of infrastructure involving input and output
  3. 3. STDIN STDOUT Program STDERR stdin, stdout were available to reroute wherever the user wanted most common use was chaining commands together: piping
  4. 4. Infrastructure STDIN STDOUT Program STDERR this was an amazing amount of infrastructure based on a very simple idea
  5. 5. and we’ve had it since 1977 1977
  6. 6. 1997 fast foward 20 years just after commercialization of internet to a perl conference jon udell talks about websites as data sources that can be reused and remixed today that idea isn’t very novel
  7. 7. a new programming paradigm that takes the whole Internet as its platform 1997 he also talked about a new programming paradigm i don’t think we’re there yet but this inspired ...
  8. 8. “What is the equivalent of the pipe in the age of the web?” tim oreilly to ask in 2000...
  9. 9. there seems to be resounding consensus the answer is feeds they sound good in theory
  10. 10. it makes you think of feeds like in the telecom world
  11. 11. data coming directly to you
  12. 12. but we know that’s not how it works
  13. 13. ? instead we have to go request the data
  14. 14. then it gives it to us. and we do this over and over.
  15. 15. ? client side mashups might be able to get by with this
  16. 16. ? but when you start talking about persistent web applications, it becomes a bit more work
  17. 17. ? • Crontab / Daemon • Parsing • Caching
  18. 18. ? • Crontab / Daemon • Parsing • Caching this is just too much work sometimes the other problem i have is with the command line metaphor for web apps
  19. 19. Command-line Application Start Stop because a command line application is linear. it starts, runs, and stops
  20. 20. Web Application Always Running web apps are always running. a better metaphor for this is a running process or daemon
  21. 21. here we have some daemons. this is ps doom so using this metaphor, how do daemons communicate?
  22. 22. IPC? Inter process communication ipc?
  23. 23. lol h4x stfu n00b ... yeah. my experience with ipc was pretty bad. ipc usually involves some sort of shared memory mechanism, like a queue
  24. 24. it turns out amazon provides a queue web service but with a third party queue you only defer the polling it doesn’t solve the problem, its just fancier rss
  25. 25. so this is not the solution, and probably why not too many people use or know of it
  26. 26. Real-time Efficient Easy
  27. 27. Web Hooks web hooks are user defined callback URLs that point to a web script to run on a certain event. you can call them other things...
  28. 28. Web Hooks • User Callbacks • Triggers • Event Handlers • “Plugouts” web hooks are user defined callback URLs that point to a web script to run on a certain event. you can call them other things...
  29. 29. to implement web hooks, you generally provide a ui--
  30. 30. for the user to specify a url for events
  31. 31. http://example.com/post-commit.php
  32. 32. http://example.com/post-commit.php Infrastructure what this does is creates powerful infrastructure that might not be obvious at the surface
  33. 33. Easy for Vendors the idea is that it’s easy for vendors to integrate
  34. 34. the main mechanism is a standard http post, which is trivial in most environments
  35. 35. Easy (enough) for Users it’s also very open and easy for the users, which will generally be advanced users, but can easily be taken advantage of by novice users
  36. 36. as a user, to take advantage of hooks, you’d write a script to handle an event, like the commit this is a very simple script
  37. 37. “Internet” so what the user would do
  38. 38. “Internet” is put that script up on the internet
  39. 39. “Internet” then they’d go to the hook settings page
  40. 40. and hook the commit event up to their script
  41. 41. then as the user interacts with devjavu
  42. 42. Commit! and they make a commit, it fires a post to their script
  43. 43. Commit! the script runs, and send an email to the mailing list
  44. 44. Commit! this makes the user a happy cookie. and this is a trivial example, using only on web service. imagine using the api of another in the hook script and chaining these things together
  45. 45. Commit! but even in this simple example, you see the power it gives to the user and to the data that we’re trying to “open up” to our users
  46. 46. STDIN STDOUT Program back to piping on the command line, remember that it was simple infrastructure that gave you tremendous power, and one of the key components was making it easy to chain commands
  47. 47. STDIN Program we wouldn’t be able to do it without the output part of it
  48. 48. API Web App unfortunately that’s how the web is today. the only output you can get is by using the input (api, feed)
  49. 49. API Hooks Web App web hooks gives us this output, and when *combined* with the input of api’s it will give us and our user tremendous power that i think will really push the web into being a new programmable paradigm
  50. 50. Program the Web the possibilities become very rich and i’ve thought about it a lot there’s probably a lot more imagine realtime data syncronization or a chain of events that makes these apps work together in a way you’ve never imagined
  51. 51. Fin
  52. 52. Questions? blogrium.com
  53. 53. SuperHappyDevHouse
  54. 54. API Hooks Web App web hooks gives us this output, and when *combined* with the input of api’s it will give us and our user tremendous power that i think will really push the web into being a new programmable paradigm

×