“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.”
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
program the world
cloud computing
+
== near real “magic”
web of things
+
easier programmability
me: nasa, startups, shdh, web hooks
“using webhooks”
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...
lightning bolts of cloud computing.
i don’t know how this started. it had nothing to do with my talk titles...
tim bray just says they’re the next big thing.
this guy’s not so sure.
it’s great to see people love an idea. i wish i could sell it.
and then there’s this guy. apparently he’s french.
this is what my talk is going to feel like. i’m going to talk about...
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.\"
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.
notifications are the big pull these days. which is cool i suppose. but really just the tip of the iceberg
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.
this is like the pipes for the web metaphor. this is about composing a system of applications to do more than the parts individually.
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?
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?
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.
but obviously... we need webhooks. right?
we know what web apps are... callbacks is a bit curious--wait user defined? like end users?
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
callbacks! you know what callbacks are?
well here’s a quick summary, excuse the crude program diagram
programs start and stop, usually have input/output
flow through functions
flow through functions
flow through functions
flow through functions
flow through functions
flow through functions
flow through functions
compelx. use libraries. they have functions, but they’re black boxes
compelx. use libraries. they have functions, but they’re black boxes
we use them like black boxes most of the time
we use them like black boxes most of the time
we use them like black boxes most of the time
we use them like black boxes most of the time
we use them like black boxes most of the time
we use them like black boxes most of the time
unless they have callbacks. here we can modify their behavior!
this is also called hooking
unless they have callbacks. here we can modify their behavior!
this is also called hooking
unless they have callbacks. here we can modify their behavior!
this is also called hooking
unless they have callbacks. here we can modify their behavior!
this is also called hooking
unless they have callbacks. here we can modify their behavior!
this is also called hooking
unless they have callbacks. here we can modify their behavior!
this is also called hooking
unless they have callbacks. here we can modify their behavior!
this is also called hooking
unless they have callbacks. here we can modify their behavior!
this is also called hooking
unless they have callbacks. here we can modify their behavior!
this is also called hooking
unless they have callbacks. here we can modify their behavior!
this is also called hooking
devjavu, paypal ... before functional programming even?
look at those extra files in the repo!
code can do anything
all transparent. only see the effects
maybe later this
ipn is a webhook. started as just a real-time ping of a payment, but more events came up...
including events that didn’t involve a user at all. ex: subscription payment failed
simple. register a callback url.
used that to expose svn hooks in devjavu.
simple. too simple? heard disappointment after discovering it was HTTP POST.
came up with this tongue in cheek tagline.
but simple isn’t bad. it’s usually great.
simple mechanics, if done right, yield rich, emergent dynamics.
so here’s a regular web app.
so here’s a regular web app.
so here’s a regular web app.
so here’s a regular web app.
so here’s a regular web app.
so here’s a regular web app.
just have the events, stuff your code already does, trigger a callback url using POST.
the user will have a callback...
..registers with you... and now it gets run when events happen
all the app needs to know is its a url. it shouldn’t care about much else.
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...
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...
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...
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...
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...
jon is building a web app. writes code, deploys to server.
jon starts working with a team
jon starts working with a team
jon starts working with a team
jon starts working with a team
jon starts working with a team
jon starts working with a team
jon starts working with a team
jon starts working with a team
gets repetitive
puts a script on his server
registers it as a callback on github for post-recieve
as he pushes, it runs the script
as he pushes, it runs the script
automates his previous manual announcement
and even...
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?
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.
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...
verticals: ecommerce
another big vertical
more of a particular use case
this is another use case, but varies a lot in details
let users decide how they will be notified
let users manage data from where they want
let users use your app as part of a system
let users tweak your app to their needs
let users build new functionality for your app.
user contributed functionality...
This is real value: empowering your users to do more with your app than what you created it for...
with one, simple solution
observer pattern: subscribe to subjects
getpingd, Fethr
getpingd, Fethr
as a user (power user or otherwise), all hookable apps are part of the ecosystem.
like web apps with apis.
made to help making callback urls for common things easy
in code in the cloud environments, you usually are limited to web requests for obvious reasons.
protocol droid is going to get around that.
this makes working with email mailboxes way easier in the context of the web
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
do my own parsing on tasks... extend natural language, or add special codes
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.
could use hooks to help with their magic, maybe... but could also use them to let people contribute connectors... reference github
monitoring hooks. run some code to restart your server if the site is down?
one thing i’ve been working on is an extension to integrate these ideas.
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
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.
botanicalls, camera with webhooks
Any sufficiently advanced technology is indistinguishable from magic.
Web is not programmable/composable enough
...
As the web integrates with the world, as it becomes more programmable, so does the world