Web Hooks
Forging a Personalized Programmable Interconnected InternetRyan TeixeiraBarCamp MiamiFeb 2009
Programmable World of Tomorrow
Give credit where credit is due
Jeff Lindsay
Web Hooks and the Programmable World of Tomorrow on slideshare
Jeff's Lindsay's presentation was great. I wanted to pass this information along so I did a similar presentation at Barcamp Miami.
Traditional Communication
My Bank
Traditional communication was mail and phone.
Personal Computing
Then we had personal comuting.
We Discovered the Internet
That lead us to the Internet.
Email Is Still The Killer App
Now we can send emailYeahWhich meant we could send email. Even after all the advancements, email is still the number one used service on the Internet.
My Bank and I Can Talk
Your balance is low
Email is still the killer appOnline banking
Email notifications
Now I can do online banking. And my bank can send me email notices.
Now I'm Getting Social
What do they all do?
Time went by and we discovered we could be social on the Internet. How do these sites communicate with me?
Send Me Email!
They send me email.
Email Is Great
We Need to Move On
Enough with the email already. It is time to move on.
I Sign Up for a New Service
I have a new service called QUIBLROk Cool. Sign me up.Suppose I sign up for a new service.
Please send it to this URL...I might have some information for you. I'll email it to you.http://ryantxr.appjet.com/hello
And that service want to send me information if they have something of interest to me. I might give them a URL to send the data to.
What is that?It's a PHP script on my web host.What is at that URL? A custom script.
What does that do?Whatever I wantWhat does the URL do you might ask? Anything I want.
The Idea Is Not New
Been doing it for yearsPalPal has been doing this for a while now.
RESTful Web Services
Did not really get popular until it had a name
RESTful web services did not get anywhere until it had a name. We would like Web Hooks to be the same way.
Two Sides of The Same Coin
REST and Hooks are two sides of the same coin.
Feeds Are Everywhere
Everyone is familiar with feeds.
The One Way World of Yesteryear
We have to request the dataThis made sense when desktops were readers and the web was viewed primarily as a content distribution media.
In the world of yesteryear, a desktop app polled the site to get the latest feed.
Web Applications Consume Feeds
In today's world, we have web apps comsuming feeds from other web apps.
Polling Sucks!
Can I have the data?
Here it is
Bored
We all know that polling sucks. It is a constant round of asking for data and sometimes getting a positive answer. Why can't you just tell me when you have some data.
Joshua Schachter Had An Idea
http://joshua.schachter.org/
There are some simple ideas out there. Using HTTP to send some notification data isn't new.
Worked For Paypal
It worked for PayPal.
Proposal
Building on top of suggestions and proposals for mechanisms to notify of page changes via Web Hooks and XMPP, GetPingd proposes mechanisms for subscribing to content change notifications in a generic and standardized way.
Getpingd proposed using standardized mechanisms to get notified of new data.
Consider GNIP
Making data portability suck less.
GNIP takes data in various forms and transfers them to other places using other protocols. It is an Internet protocol converter.
Push Is Good
But that is not the point
Push is good. It is more efficient. But that isn't the point. There's more to this than moving content around.
Once Upon A Time
There was a command line system that let you combine apps together for a greater purpose.
There once was a command line interface. It had various functions you could use to do all sorts of things.
The Key Was Input and Output
ProgramProcessed data comes outRaw data inEach command had an input, some processing, and an output.
We Had All These Programs
They were far more useful when strung together
You could combine them in any way you wanted
These could be strung together to do much more and automate things. They are a great productivity enhancement.
The UNIX Philosophy
Write programs that do ONE THING and do it well
Write programs to work together
Write programs that handle text streams because that is a universal interface
The UNIX philosphy is clear.
Web Apps Can Only Respond
They can respond to us
The can give us information when we ask for it
They generally cannot initiate communication that can be consumed by another app
Web Apps only have one side to this. Their output is the screen they produce. But you cannot feed that into another web app.
They Need Web Hooks
Use the mechanisms the web already has
Use existing protocols
Give them a way to call us (or our apps)
If Web Apps had Web Hooks.
Combine Applications Like UNIX Command Line Apps
We could combine web apps like we combine command line apps. We could make things work together in ways we want them to work.
Imagine Basecamp With Hooks
If Basecamp had hooks
We could make it respond to events in ways that means something to us.
Anything Can Trigger A Handler
Imagine if other things in the world had Web Hooks what could be done.
Back To Github
Github has an interface with Lighthouse
RunCodeRun
Integrates With Github
RunCodeRun does automatic testing. And it integrates with Github to run a set of tests when code is updated.
Service Integration
We are looking for Service Integration
Web Synthesis
This is Web Synthesis
Code as Glue
It is using code as glue.
Separation of Concerns
And there is separation of concerns. Each piece can do what it does best and only worry about how they interface together.
Appjet
Server side Javascript
Create small handlers
Use them as web hooks
Run on Appjet site
Download AppJet and run on your own server
Making a handler should not be that hard. Use Appjet.
It is server side Javascript.
Google App Engine
More complicated than AppJet
Need to know Python
Certainly viable
Google App Engine is a bit more complicated but better at handling more sophisticated applications.
What Else Should Have Web Hooks?
My Bank
Other apps that should have hooks.
RSS As Input
Use RSSFWD so there is no need for polling
RSSFWD converts pull-based RSS into push.
Yahoo Pipes and YQL
Has all the data filtering features
Needs web hooks
Needs an input so data can be pushed to it
Yahoo Pipes and YQL. This has some neat things. However, it is a pull mechanism. You can call it to get data. But you cannot push data to it and have it push data elsewhere.
Forget About Pushing Content
It's All AboutIntegration
Integrating multiple apps is much more powerful than any content
Everyone should use whatever apps they want then integrate them
Enable users to use whatever apps they want and let them combine these apps together.
Web Hooks and Feeds
Web Hooks do not replace feeds
Both a feed and a web hook should be supported
HTTP call backs are not new
Exposing them to users is the concept
Web hooks and feeds are both needed. They serve different purposes.
Web Hooks and XMPP
They are not the same
Web Hooks are simpler
Web Hooks are probably more suited to smaller data that is less frequent
XMPP probably more suited to more data and higher frequency
Use XMPP when necessary. Know when to recognize the need for both.
Is there a standard
Short answer: NO
Perhaps there will be on at some point
On his blog data Feb 20 2009, Jeff said this:
Im not going to assume well know everything about the implications of this mechanism that we can encode them in a document that will either be ignored or adopted by everybody, making it harder to adapt to change. The longer we can put off standardizing, the better.
We don't understand the implications of this mechanism. Standards can wait.
John Udell Envisions the Internet
As a new programming paradigm that takes the whole Internet as its platform
It is really all about using the Internet, or the web as one big coordinated and programmable space.
One More Cool Thing
Here is one more interesting example. It is a Twitter bot that can be used to execute commands.
Thanks
Ryan [email protected]
ryantxr
ryantxr
http://devsanctum.com
Click to edit the title text format
Click to edit the outline text format
Second Outline Level
Third Outline Level
Fourth Outline Level
Fifth Outline Level
Sixth Outline Level
Seventh Outline Level
Eighth Outline Level
Ninth Outline Level