Advertisement

Using Web Hooks

Hacker-philosopher at Twilio
Apr. 23, 2009
Advertisement

More Related Content

Advertisement

Using Web Hooks

  1. webhooks jeff lindsay
  2. WEBHOOKS AND THE FUTURE OF THE WEB
  3. problem solution examples implementation inspiration future
  4. problem?
  5. ‣ notifications ‣ data syncing ‣ chaining ‣ modification ‣ plugins
  6. ‣ notifications ‣ data syncing ‣ chaining ‣ modification ‣ plugins
  7. ‣ notifications “I wish I could get notifications exactly ‣ data syncing how I want.” ‣ chaining ‣ modification ‣ plugins
  8. ‣ notifications ‣ data syncing “I wish my web apps would keep overlapping ‣ chaining data in sync.” ‣ modification ‣ plugins
  9. ‣ notifications ‣ data syncing ‣ chaining “I wish I could make ‣ modification another app do ‣ plugins something when I use this app.”
  10. ‣ notifications ‣ data syncing ‣ chaining ‣ modification “I wish I could make ‣ plugins this app work just slightly differently.”
  11. ‣ notifications ‣ data syncing ‣ chaining ‣ modification ‣ plugins “I wish I could let my users extend/build plugins for my app.”
  12. } ‣ notifications ‣ data syncing ‣ chaining programmability ‣ modification ‣ plugins
  13. WEBHOOKS
  14. WEBHOOKS Huh?
  15. web•hooks |ˈwebˌhoŏks| pattern of enabling user-defined callbacks in web applications
  16. us•er |ˈyoōzər|
  17. call•back |ˈkôlˌbak|
  18. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  19. call•back |ˈkôlˌbak| Program
  20. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  21. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  22. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  23. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  24. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  25. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  26. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  27. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  28. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  29. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  30. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  31. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  32. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  33. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  34. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  35. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  36. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  37. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  38. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  39. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  40. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  41. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  42. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  43. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  44. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  45. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  46. call•back |ˈkôlˌbak| Program ƒ(x) ƒ(x) ƒ(x) Library ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x) ƒ(x)
  47. “In computer programming, hooking is a technique used to alter or augment the behavior of [a program], often without having access to its source code.”
  48. webhooks origin
  49. subversion hooks repository working copy foo
  50. subversion hooks repository working copy foo foo
  51. subversion hooks repository foo
  52. subversion hooks repository bar foo
  53. subversion hooks repository bar foo
  54. subversion hooks repository bar bar
  55. subversion hooks repository pre-commit foo bar post-commit
  56. subversion hooks repository pre-commit foo bar post-commit
  57. subversion hooks Does this user have repository permission? pre-commit Is this change valid? foo bar post-commit
  58. subversion hooks repository pre-commit foo bar post-commit
  59. subversion hooks repository pre-commit bar bar post-commit
  60. subversion hooks repository pre-commit bar bar Send a notice to IRC post-commit Try to build the project
  61. subversion hooks repository bar bar
  62. subversion hooks repository A new change was committed by Jeff. bar bar
  63. subversion hooks repository bar bar Damn it Jeff, you broke the build!
  64. paypal ipn
  65. paypal ipn
  66. paypal ipn
  67. webhooks SO SIMPLE YOUʼLL THINK ITʼS STUPID
  68. webhooks anatomy web app
  69. webhooks anatomy web app db
  70. webhooks anatomy ui web app db
  71. webhooks anatomy ui web app db
  72. webhooks anatomy ui web app event event db event
  73. webhooks anatomy ui api web app event event db event
  74. webhooks anatomy ui api web app event event db event
  75. webhooks anatomy ui api web app event event db event
  76. webhooks anatomy ui api web app event event db event callback
  77. webhooks anatomy ui api web app event event db event callback
  78. webhooks anatomy ui api web app event event db event
  79. webhooks anatomy
  80. webhooks anatomy callback
  81. webhooks anatomy callback
  82. webhooks anatomy callback
  83. webhooks anatomy callback
  84. webhooks anatomy callback
  85. examples
  86. DEPLOY
  87. PUSH
  88. Hey guys, pull.
  89. k
  90. DEPLOY
  91. PUSH
  92. Hey guys, pull.
  93. k
  94. DEPLOY
  95. Hooks?
  96. http://myserver.com/script
  97. http://myserver.com/script R ISTE REG
  98. PUSH
  99. PUSH
  100. Hey guys, pull.
  101. k
  102. OY PL E D
  103. 1. define achievements here 2. add trigger pings to your backend 3. paste javascript into your layout
  104. not done yet, but... QUESTIONS?
  105. more examples ecommerce project hosting notifications plugins / platform
  106. more examples ecommerce project hosting notifications plugins / platform
  107. more examples ecommerce project hosting notifications plugins / platform
  108. more examples ecommerce project hosting notifications plugins / platform
  109. payoff notifications data syncing FOR THE DEVELOPER chaining modifications plugins
  110. payoff notifications data syncing FOR THE DEVELOPER chaining modifications plugins
  111. payoff notifications data syncing FOR THE DEVELOPER chaining modifications plugins
  112. payoff notifications data syncing FOR THE DEVELOPER chaining modifications plugins
  113. payoff notifications data syncing FOR THE DEVELOPER chaining modifications plugins
  114. payoff notifications data syncing FOR THE DEVELOPER chaining modifications plugins one, simple solution
  115. how to implement
  116. 1. design callback channels per noun or per verb on noun wiki crud? project install/uninstall account pre-commit/post-commit plugin vs
  117. 2. create registration method web ui or api both? :)
  118. 3. choose payload format POST parameters JSON XML
  119. 4. add trigger code to events
  120. 5. consider these options queuing posts HMAC verification retry return data filtering validation
  121. ecosystem
  122. protocol-droid
  123. protocol-droid coming soon...
  124. inspiration
  125. Todos Basecamp
  126. Hey, there’s an event hook here!
  127. Save
  128. future
  129. what to expect from webhooks
  130. what to expect from webhooks sharing
  131. what to expect from webhooks sharing standardization
  132. what to expect from webhooks sharing standardization
  133. what to expect from webhooks sharing standardization tools
  134. what to expect from webhooks sharing standardization integration tools
  135. what to expect from webhooks sharing standardization integration tools
  136. what to expect from webhooks
  137. web of things embedded devices are getting more powerful and connected
  138. web of things “API for everything”
  139. programming literacy As programming becomes more important, it will leave the back room and become a key skill and attribute of our top intellectual and social classes, just as reading and writing did in the past. Marc Prensky
  140. program the world cloud computing + == near real “magic” web of things + easier programmability
  141. problem solution examples implementation inspiration future
  142. use webhooks! join the community http://webhooks.org
  143. ok, itʼs over... QUESTIONS?

Editor's Notes

  1. me: nasa, startups, shdh, web hooks “using webhooks”
  2. more appropriately pretentious. although it’s really about webhooks, then future. webhooks may be the future of the web, but just a small part. who has heard of webhooks? i watch search.twitter for webhooks...
  3. lightning bolts of cloud computing.
  4. i don’t know how this started. it had nothing to do with my talk titles...
  5. tim bray just says they’re the next big thing.
  6. this guy’s not so sure.
  7. it’s great to see people love an idea. i wish i could sell it.
  8. and then there’s this guy. apparently he’s french.
  9. this is what my talk is going to feel like. i’m going to talk about...
  10. before we get to what they are... what problem do they solve? people haven’t been asking for them, so what’s the point? \"If I had asked people what they wanted, they would have said faster horses.\"
  11. like a good engineer i came up with the problems after the solution. like a good programmer i came up with a solution that is very generalized and can be used for lots of stuff. these are the rough problems that webhooks solve, most of which haven’t been done well or much at all on the web.
  12. notifications are the big pull these days. which is cool i suppose. but really just the tip of the iceberg
  13. i use three web applications that have “projects.” i use them all for slightly different things, but none of them share data. twitter to facebook updates is sort of the same thing. both are updates, i like both apps. they should just be about the same data.
  14. this is like the pipes for the web metaphor. this is about composing a system of applications to do more than the parts individually.
  15. there is no open source equivalent for the concept of a SaaS. we don’t have the freedom to change code for things we use in the cloud. think of how many lame projects this would eliminate: “it’s like twitter, but it does INSERT MINOR IMPROVEMENT” what if you could just make it do that?
  16. the most popular desktop apps we use: office, firefox, itunes, photoshop... even cult favorites like quicksilver, winamp, vlc... they all have plugins. how many web apps do you know with plugins?
  17. to me, these ARE all part of the same problem. the web is not programmable enough. programmable web is a misnomer. programmatic web. and if people do try to solve these problems, they reinvent for each one... just lay proper infrastructure. really this is about code in the cloud ... hooks are just a vehicle for code, but we’ll get to this later.
  18. but obviously... we need webhooks. right?
  19. we know what web apps are... callbacks is a bit curious--wait user defined? like end users?
  20. i think of three classes of users. developers, power users, machines, and average users. so far, web hooks are for developers, but part of all this is about bridging the gap between their power and the average user. for the moment, we mostly talk about the first two here
  21. callbacks! you know what callbacks are? well here’s a quick summary, excuse the crude program diagram
  22. programs start and stop, usually have input/output
  23. flow through functions
  24. flow through functions
  25. flow through functions
  26. flow through functions
  27. flow through functions
  28. flow through functions
  29. flow through functions
  30. compelx. use libraries. they have functions, but they’re black boxes
  31. compelx. use libraries. they have functions, but they’re black boxes
  32. we use them like black boxes most of the time
  33. we use them like black boxes most of the time
  34. we use them like black boxes most of the time
  35. we use them like black boxes most of the time
  36. we use them like black boxes most of the time
  37. we use them like black boxes most of the time
  38. unless they have callbacks. here we can modify their behavior! this is also called hooking
  39. unless they have callbacks. here we can modify their behavior! this is also called hooking
  40. unless they have callbacks. here we can modify their behavior! this is also called hooking
  41. unless they have callbacks. here we can modify their behavior! this is also called hooking
  42. unless they have callbacks. here we can modify their behavior! this is also called hooking
  43. unless they have callbacks. here we can modify their behavior! this is also called hooking
  44. unless they have callbacks. here we can modify their behavior! this is also called hooking
  45. unless they have callbacks. here we can modify their behavior! this is also called hooking
  46. unless they have callbacks. here we can modify their behavior! this is also called hooking
  47. unless they have callbacks. here we can modify their behavior! this is also called hooking
  48. devjavu, paypal ... before functional programming even?
  49. look at those extra files in the repo!
  50. code can do anything
  51. all transparent. only see the effects
  52. maybe later this
  53. ipn is a webhook. started as just a real-time ping of a payment, but more events came up...
  54. including events that didn’t involve a user at all. ex: subscription payment failed
  55. simple. register a callback url.
  56. used that to expose svn hooks in devjavu.
  57. simple. too simple? heard disappointment after discovering it was HTTP POST.
  58. came up with this tongue in cheek tagline. but simple isn’t bad. it’s usually great.
  59. simple mechanics, if done right, yield rich, emergent dynamics.
  60. so here’s a regular web app.
  61. so here’s a regular web app.
  62. so here’s a regular web app.
  63. so here’s a regular web app.
  64. so here’s a regular web app.
  65. so here’s a regular web app.
  66. just have the events, stuff your code already does, trigger a callback url using POST. the user will have a callback...
  67. ..registers with you... and now it gets run when events happen
  68. all the app needs to know is its a url. it shouldn’t care about much else.
  69. so what is the callback? it’s just something to handle the post data. cheap php hosting, app engine, appjet, scriptlets... because it’s just a url that runs cgi, it can be any language on any machine...
  70. so what is the callback? it’s just something to handle the post data. cheap php hosting, app engine, appjet, scriptlets... because it’s just a url that runs cgi, it can be any language on any machine...
  71. so what is the callback? it’s just something to handle the post data. cheap php hosting, app engine, appjet, scriptlets... because it’s just a url that runs cgi, it can be any language on any machine...
  72. so what is the callback? it’s just something to handle the post data. cheap php hosting, app engine, appjet, scriptlets... because it’s just a url that runs cgi, it can be any language on any machine...
  73. so what is the callback? it’s just something to handle the post data. cheap php hosting, app engine, appjet, scriptlets... because it’s just a url that runs cgi, it can be any language on any machine...
  74. jon is building a web app. writes code, deploys to server.
  75. jon starts working with a team
  76. jon starts working with a team
  77. jon starts working with a team
  78. jon starts working with a team
  79. jon starts working with a team
  80. jon starts working with a team
  81. jon starts working with a team
  82. jon starts working with a team
  83. gets repetitive
  84. puts a script on his server
  85. registers it as a callback on github for post-recieve
  86. as he pushes, it runs the script
  87. as he pushes, it runs the script
  88. automates his previous manual announcement
  89. and even...
  90. deploys to itself automatically. all he has to do is write code and push. could take it further, he owns the script... maybe testing before deploy?
  91. the issue is that while interacting with amazon, the user picks options that could affect shipping, promotion discounts, and taxes. needs to call out back to you (the store owner) to calculate these.
  92. here’s what they look like. just post params, key value pairs. you can see what i did. they trigger on a lot of events. like login...
  93. verticals: ecommerce
  94. another big vertical
  95. more of a particular use case
  96. this is another use case, but varies a lot in details
  97. let users decide how they will be notified
  98. let users manage data from where they want
  99. let users use your app as part of a system
  100. let users tweak your app to their needs
  101. let users build new functionality for your app. user contributed functionality...
  102. This is real value: empowering your users to do more with your app than what you created it for... with one, simple solution
  103. observer pattern: subscribe to subjects
  104. getpingd, Fethr
  105. getpingd, Fethr
  106. as a user (power user or otherwise), all hookable apps are part of the ecosystem. like web apps with apis.
  107. made to help making callback urls for common things easy
  108. in code in the cloud environments, you usually are limited to web requests for obvious reasons. protocol droid is going to get around that.
  109. this makes working with email mailboxes way easier in the context of the web
  110. it’s neat to see it in netnewswire. looks like mail.app point is to make more protocols easier to work with from web scripts in fairly limited environments... because there will be more of them as the cloud grows
  111. do my own parsing on tasks... extend natural language, or add special codes
  112. for example, all these apps share data about todos. they each have respective specialized talents, but all work with todos. by putting hooks on todo CRUD, you can use their apis to keep them synced pretty well. magically. real-time.
  113. could use hooks to help with their magic, maybe... but could also use them to let people contribute connectors... reference github
  114. monitoring hooks. run some code to restart your server if the site is down?
  115. one thing i’ve been working on is an extension to integrate these ideas.
  116. by detecting some markup in a page, it discovers hooks. like say for new photos from contacts. you want to do something when that happens, click it
  117. and write some code. hit save, it posts to AppJet (or wherever), registers the handler (assuming a standard protocol), and done. all inline. go back and change the code.
  118. botanicalls, camera with webhooks
  119. Any sufficiently advanced technology is indistinguishable from magic.
  120. Web is not programmable/composable enough ... As the web integrates with the world, as it becomes more programmable, so does the world
Advertisement