SlideShare uma empresa Scribd logo
1 de 60
Baixar para ler offline
Webhooks
                      glue for the Web




20 юни 2009, събота                      1
Who am I ?


                 • Name: Stoyan Zhekov
                 • Private: married, 3 kids (boys)
                 • Work: Software Engineer
                 • Contact: xmpp: //zh@jabber.jp

20 юни 2009, събота                                  2
20 юни 2009, събота   3
Today

                 • What is this talk about?
                 • What are webhooks?
                 • What can they do for me?
                 • Pros and cons
                 • Real life usage


20 юни 2009, събота                                                    4

Maybe you already forget the presentation title, so one more time...
What is this talk about?




20 юни 2009, събота                       5
Webhooks
                      glue for the Web

20 юни 2009, събота                      6
Hooks?
20 юни 2009, събота            7
Glue?
20 юни 2009, събота           8
Web 3.0
20 юни 2009, събота                        9

Don’t worry. We will talk about web :)
Web x.0?


                 • Web 1.0 - static
                 • Web 2.0 - dynamic? social?
                 • Web 3.0 - real time?



20 юни 2009, събота                             10

Google Wave, iPhone push notifications
Web 3.0


                 • Real Time
                 • Does it scale?
                 • PubSub



20 юни 2009, събота                      11
Real Time
20 юни 2009, събота               12
Real Time Web


                 • RSS is not enough (SUP)
                 • XMPP
                 • Webhooks



20 юни 2009, събота                                                13

I spoke in Kobe about SUP and XMPP (see my other presentations -
http://www.slideshare.net/zhesto/microblogging-via-xmpp
No Polling!
20 юни 2009, събота                                                              14

Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
Real Time
20 юни 2009, събота               15
Does it scale?



20 юни 2009, събота                                                                           16

Recently working a lot with EC2 - pay per use, scale easy - instant start/stop of instances
Clouds...



20 юни 2009, събота               17
Clouds?
20 юни 2009, събота             18
Computer cloud!
20 юни 2009, събота                     19
Communications
20 юни 2009, събота                    20
Communications


                 • Messaging (AMQP): RabbitMQ
                 • XMPP, Ejabberd, Prosody
                 • Webhooks



20 юни 2009, събота                                                                     21

Webooks can help you with the infrastructure. Some service is too heavy? - move it to
another machine and connect them with webhook. Think about webhooks even when on a
single machine (call by URL, not by function name)
PubSub



20 юни 2009, събота            22
Publishers
20 юни 2009, събота                23
Subscribers
20 юни 2009, събота                 24
Publishers and Subscribers
20 юни 2009, събота                        25
Watercoolr

                 •PubSub
                 •Webhooks
                 •Ruby

                      http://github.com/jcapote/watercoolr/

          http://github.com/zh/watercoolr/
20 юни 2009, събота                                           26
PubSubHubBub
                  http://code.google.com/p/pubsubhubbub/


20 юни 2009, събота                                        27
What are webhooks?
20 юни 2009, събота                                         28

Image from the presentation “Using Web Hooks”
I keep repeating webhooks, webhooks,... So what are they?
Captain Hook
20 юни 2009, събота                  29
SVN Hooks
20 юни 2009, събота                             30

Image from the presentation “Using Web Hooks”
Hooks


                 • Subversion pre-commit, post-commit
                 • Git, Mercurial - they have hooks too
                 • Rails: :before_save, :after_delete



20 юни 2009, събота                                       31
Unix Philosophy


                 • do ONE THING and do it well
                 • programs WORK TOGETHER
                 • UNIVERSAL INTERFACE (text)



20 юни 2009, събота                                          32

Insert here more about the webhooks - POST, etc.
example cat | grep | mail -> make this with web too (demo)
UNIX pipes
20 юни 2009, събота                                                              33

Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
The Web
20 юни 2009, събота                                                              34

Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
Web 3D
20 юни 2009, събота                                                                  35

There are services creating the web pages (feeds). Now nodes communicate via RSS -
indirect.
Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
WebApp pipes?
20 юни 2009, събота                                                              36

Can we make a simple applications and connect them like a pipe?
Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
20 юни 2009, събота                                                              37

Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
POST /service data={ 'message':'hey guys!' }




20 юни 2009, събота                               38
What are WEBhooks?

              webhooks are user defined callback URLs,
                that point to a web script to run on a
                            certain event




20 юни 2009, събота                                                                                                         39

By letting the user specify a URL for various events, the application will POST data to those URLs when the events occur.
Key poins: USER DEFINED, URLs (remote services), RUN ON CERTAIN EVENT (push, no cronjobs etc.)
User defined
20 юни 2009, събота                 40
URLs = remote
20 юни 2009, събота                   41
register URL
20 юни 2009, събота                             42

Image from the presentation “Using Web Hooks”
get notification
20 юни 2009, събота                             43

Image from the presentation “Using Web Hooks”
Why?



20 юни 2009, събота          44
Service Integration
20 юни 2009, събота                         45
Flexibility
20 юни 2009, събота                 46
Customization
20 юни 2009, събота                                                              47

Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
Webhooks movement


                 • Jeff Lindsay
                 • http://blogrium.com/?p=70
                 • http://webhooks.pbworks.com/
                 • http://blog.webhooks.org/



20 юни 2009, събота                               48
Webhooks


               • Amazon have Merchant Callback API
               • PayPal (Instant Payment Notification)
               • GitHub and Google Code



20 юни 2009, събота                                     49
Good and bad
20 юни 2009, събота                  50
Good

                 • Well known protocol - HTTP
                      • code libraries (software)
                      • infrastructure (hardware)
                 • Easy for vendors (services)
                 • Easy for users (consumers)


20 юни 2009, събота                                 51
20 юни 2009, събота   52
require ‘net/http’
         require ‘json’

         class User
            def commit(message)
               Net::HTTP.post_form(
                 User.hook_url,
                 { :data => message.to_json })
            end
         end



20 юни 2009, събота                              53

For service providers (publishers)
require ‘net/smtp’
         require ‘json’
         require ‘sinatra’

         post ‘/hook’ do
            data = JSON.parse(params[:data])
            # do something with the data
            Net::SMTP.start(‘localhost’) do |smtp|
                smtp.send_message data[‘message’], from, to
            end
         end



20 юни 2009, събота                                           54

For service consumers (subscribers)
Bad

                 • No standard
                      • Google Code: XML
                      • GitHub: JSON
                      • ping.fm - POST parameters
                 • Security (authentication)


20 юни 2009, събота                                 55
Real Life Usage



20 юни 2009, събота                     56
Where to create hooks?


                 • http://heroku.com/ - Ruby
                 • GAE - Python, Java, JRuby
                 • http://scriptlets.org/ - Python, JS
                 • PHP - almost everywhere



20 юни 2009, събота                                      57
Ready Tools
                 • GitHub - RunCodeRun
                 • http://ping.fm/ - IM, email, Skype
                 • http://postbin.org/ - debug
                 • SwitchHub, TarPipe
                 • http://superfeedr.com/ - RSS
                 • http://bot.im/ - IMified XMPP bot

20 юни 2009, събота                                     58
Demo
                            ping.fm + postbin
                      ping.fm + switchub (+postbin)




20 юни 2009, събота                                                                         59

create new hook on postbin, login to post.fm/custom/ and put there the url. test: web, email,
im?
Questions?



20 юни 2009, събота                60

Mais conteúdo relacionado

Destaque

Microsoft Azure 虛擬機器與虛擬網路 (2014-4-2 雲端達人班)
Microsoft Azure 虛擬機器與虛擬網路 (2014-4-2 雲端達人班)Microsoft Azure 虛擬機器與虛擬網路 (2014-4-2 雲端達人班)
Microsoft Azure 虛擬機器與虛擬網路 (2014-4-2 雲端達人班)
Jeff Chu
 
Ασφαλής πλοήγηση στο Διαδίκτυο
Ασφαλής πλοήγηση στο ΔιαδίκτυοΑσφαλής πλοήγηση στο Διαδίκτυο
Ασφαλής πλοήγηση στο Διαδίκτυο
Vasilis Drimtzias
 

Destaque (20)

Web Hooks
Web HooksWeb Hooks
Web Hooks
 
APIs That Make Things Happen
APIs That Make Things HappenAPIs That Make Things Happen
APIs That Make Things Happen
 
Building Event Driven API Services Using Webhooks
Building Event Driven API Services Using WebhooksBuilding Event Driven API Services Using Webhooks
Building Event Driven API Services Using Webhooks
 
V1 of The Computer Scientist and The Cleaner
V1 of The Computer Scientist and The CleanerV1 of The Computer Scientist and The Cleaner
V1 of The Computer Scientist and The Cleaner
 
SignalR & SQL Dependency
SignalR & SQL DependencySignalR & SQL Dependency
SignalR & SQL Dependency
 
Web Hooks On Pbwiki
Web Hooks On PbwikiWeb Hooks On Pbwiki
Web Hooks On Pbwiki
 
Microsoft Azure 虛擬機器與虛擬網路 (2014-4-2 雲端達人班)
Microsoft Azure 虛擬機器與虛擬網路 (2014-4-2 雲端達人班)Microsoft Azure 虛擬機器與虛擬網路 (2014-4-2 雲端達人班)
Microsoft Azure 虛擬機器與虛擬網路 (2014-4-2 雲端達人班)
 
From an idea to a Startup
From an idea to a StartupFrom an idea to a Startup
From an idea to a Startup
 
危機管理のリーダーシップ自己効力感尺度日本語版(C-LEAD-J)
危機管理のリーダーシップ自己効力感尺度日本語版(C-LEAD-J)危機管理のリーダーシップ自己効力感尺度日本語版(C-LEAD-J)
危機管理のリーダーシップ自己効力感尺度日本語版(C-LEAD-J)
 
Webhooks
WebhooksWebhooks
Webhooks
 
web 1.0 web 2.0 web 3.0 semantic web
web 1.0 web 2.0 web 3.0 semantic webweb 1.0 web 2.0 web 3.0 semantic web
web 1.0 web 2.0 web 3.0 semantic web
 
How to Get Started with Google Voice
How to Get Started with Google VoiceHow to Get Started with Google Voice
How to Get Started with Google Voice
 
Digital tech and consumer behaviour
Digital tech and consumer behaviourDigital tech and consumer behaviour
Digital tech and consumer behaviour
 
Real Time Connected Vehicle Networking with HDInsight and Apache Storm
Real Time Connected Vehicle Networking with HDInsight and Apache StormReal Time Connected Vehicle Networking with HDInsight and Apache Storm
Real Time Connected Vehicle Networking with HDInsight and Apache Storm
 
Ασφαλής πλοήγηση στο Διαδίκτυο
Ασφαλής πλοήγηση στο ΔιαδίκτυοΑσφαλής πλοήγηση στο Διαδίκτυο
Ασφαλής πλοήγηση στο Διαδίκτυο
 
How Mobile Voice Search Changes SEO
How Mobile Voice Search Changes SEOHow Mobile Voice Search Changes SEO
How Mobile Voice Search Changes SEO
 
Microsoft Cognitive Services 概要
Microsoft Cognitive Services 概要Microsoft Cognitive Services 概要
Microsoft Cognitive Services 概要
 
Using Web Hooks
Using Web HooksUsing Web Hooks
Using Web Hooks
 
Cognitive APIs and Conversational Interfaces
Cognitive APIs and Conversational InterfacesCognitive APIs and Conversational Interfaces
Cognitive APIs and Conversational Interfaces
 
第5回 cogbot勉強会!
第5回 cogbot勉強会!第5回 cogbot勉強会!
第5回 cogbot勉強会!
 

Semelhante a Webhooks - glue for the web

Nanite (And An Introduction To Cloud Computing)
Nanite (And An Introduction To Cloud Computing)Nanite (And An Introduction To Cloud Computing)
Nanite (And An Introduction To Cloud Computing)
will_j
 
Presentation to wdim_students
Presentation to wdim_studentsPresentation to wdim_students
Presentation to wdim_students
Scott Motte
 

Semelhante a Webhooks - glue for the web (20)

The Future Of Dm
The Future Of DmThe Future Of Dm
The Future Of Dm
 
Howdah
HowdahHowdah
Howdah
 
Howdah - An Application using Pylons, PostgreSQL, Simpycity and Exceptable
Howdah - An Application using Pylons, PostgreSQL, Simpycity and ExceptableHowdah - An Application using Pylons, PostgreSQL, Simpycity and Exceptable
Howdah - An Application using Pylons, PostgreSQL, Simpycity and Exceptable
 
Nanite (And An Introduction To Cloud Computing)
Nanite (And An Introduction To Cloud Computing)Nanite (And An Introduction To Cloud Computing)
Nanite (And An Introduction To Cloud Computing)
 
Open Video And Metadata Presentation
Open Video And Metadata PresentationOpen Video And Metadata Presentation
Open Video And Metadata Presentation
 
GWT Overview And Feature Preview - SV Web JUG - June 16 2009
GWT Overview And Feature Preview - SV Web JUG -  June 16 2009GWT Overview And Feature Preview - SV Web JUG -  June 16 2009
GWT Overview And Feature Preview - SV Web JUG - June 16 2009
 
Investing in open source hw
Investing in open source hwInvesting in open source hw
Investing in open source hw
 
Cloudera Desktop
Cloudera DesktopCloudera Desktop
Cloudera Desktop
 
Google Sites Lightning Talk
Google  Sites  Lightning  TalkGoogle  Sites  Lightning  Talk
Google Sites Lightning Talk
 
Websockets - OMG! Someone broke the internet!
Websockets - OMG! Someone broke the internet!Websockets - OMG! Someone broke the internet!
Websockets - OMG! Someone broke the internet!
 
Presentation to wdim_students
Presentation to wdim_studentsPresentation to wdim_students
Presentation to wdim_students
 
Holland Exibition Promotion
Holland Exibition PromotionHolland Exibition Promotion
Holland Exibition Promotion
 
Slideshare presentation
Slideshare presentationSlideshare presentation
Slideshare presentation
 
Why Architecture Matters
Why Architecture MattersWhy Architecture Matters
Why Architecture Matters
 
Growing Your Blog with WordPress
Growing Your Blog with WordPressGrowing Your Blog with WordPress
Growing Your Blog with WordPress
 
HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09HTML5 and Google Chrome - DevFest09
HTML5 and Google Chrome - DevFest09
 
CSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp BostonCSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp Boston
 
"Mozilla Labs" by Pascal Finette @ eLiberatica 2009
"Mozilla Labs" by Pascal Finette @ eLiberatica 2009"Mozilla Labs" by Pascal Finette @ eLiberatica 2009
"Mozilla Labs" by Pascal Finette @ eLiberatica 2009
 
Session11
Session11Session11
Session11
 
Vertically Challenged
Vertically ChallengedVertically Challenged
Vertically Challenged
 

Mais de Stoyan Zhekov

Deployment on Heroku
Deployment on HerokuDeployment on Heroku
Deployment on Heroku
Stoyan Zhekov
 
Websockets with ruby
Websockets with rubyWebsockets with ruby
Websockets with ruby
Stoyan Zhekov
 
Microblogging via XMPP (japanese)
Microblogging via XMPP (japanese)Microblogging via XMPP (japanese)
Microblogging via XMPP (japanese)
Stoyan Zhekov
 
Microblogging via XMPP
Microblogging via XMPPMicroblogging via XMPP
Microblogging via XMPP
Stoyan Zhekov
 

Mais de Stoyan Zhekov (18)

Multirotors
MultirotorsMultirotors
Multirotors
 
ZeroMQ
ZeroMQZeroMQ
ZeroMQ
 
Padrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraPadrino - the Godfather of Sinatra
Padrino - the Godfather of Sinatra
 
Sequel
SequelSequel
Sequel
 
Deployment on Heroku
Deployment on HerokuDeployment on Heroku
Deployment on Heroku
 
Push the web with HTML5
Push the web with HTML5Push the web with HTML5
Push the web with HTML5
 
Foreman - Process manager for applications with multiple components
Foreman - Process manager for applications with multiple componentsForeman - Process manager for applications with multiple components
Foreman - Process manager for applications with multiple components
 
Social Network for spare parts
Social Network for spare partsSocial Network for spare parts
Social Network for spare parts
 
Using XMPP Presence stanzas for real-time parking information
Using XMPP Presence stanzas for real-time parking informationUsing XMPP Presence stanzas for real-time parking information
Using XMPP Presence stanzas for real-time parking information
 
Ruby cooking
Ruby cookingRuby cooking
Ruby cooking
 
Websockets with ruby
Websockets with rubyWebsockets with ruby
Websockets with ruby
 
EventMachine
EventMachineEventMachine
EventMachine
 
Webhooks - glue for the web (japanese)
Webhooks - glue for the web (japanese)Webhooks - glue for the web (japanese)
Webhooks - glue for the web (japanese)
 
Microblogging via XMPP (japanese)
Microblogging via XMPP (japanese)Microblogging via XMPP (japanese)
Microblogging via XMPP (japanese)
 
Microblogging via XMPP
Microblogging via XMPPMicroblogging via XMPP
Microblogging via XMPP
 
Ruby off Rails (english)
Ruby off Rails (english)Ruby off Rails (english)
Ruby off Rails (english)
 
Ruby off Rails (japanese)
Ruby off Rails (japanese)Ruby off Rails (japanese)
Ruby off Rails (japanese)
 
Rails Deployment with NginX
Rails Deployment with NginXRails Deployment with NginX
Rails Deployment with NginX
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

Webhooks - glue for the web

  • 1. Webhooks glue for the Web 20 юни 2009, събота 1
  • 2. Who am I ? • Name: Stoyan Zhekov • Private: married, 3 kids (boys) • Work: Software Engineer • Contact: xmpp: //zh@jabber.jp 20 юни 2009, събота 2
  • 3. 20 юни 2009, събота 3
  • 4. Today • What is this talk about? • What are webhooks? • What can they do for me? • Pros and cons • Real life usage 20 юни 2009, събота 4 Maybe you already forget the presentation title, so one more time...
  • 5. What is this talk about? 20 юни 2009, събота 5
  • 6. Webhooks glue for the Web 20 юни 2009, събота 6
  • 7. Hooks? 20 юни 2009, събота 7
  • 8. Glue? 20 юни 2009, събота 8
  • 9. Web 3.0 20 юни 2009, събота 9 Don’t worry. We will talk about web :)
  • 10. Web x.0? • Web 1.0 - static • Web 2.0 - dynamic? social? • Web 3.0 - real time? 20 юни 2009, събота 10 Google Wave, iPhone push notifications
  • 11. Web 3.0 • Real Time • Does it scale? • PubSub 20 юни 2009, събота 11
  • 12. Real Time 20 юни 2009, събота 12
  • 13. Real Time Web • RSS is not enough (SUP) • XMPP • Webhooks 20 юни 2009, събота 13 I spoke in Kobe about SUP and XMPP (see my other presentations - http://www.slideshare.net/zhesto/microblogging-via-xmpp
  • 14. No Polling! 20 юни 2009, събота 14 Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
  • 15. Real Time 20 юни 2009, събота 15
  • 16. Does it scale? 20 юни 2009, събота 16 Recently working a lot with EC2 - pay per use, scale easy - instant start/stop of instances
  • 17. Clouds... 20 юни 2009, събота 17
  • 18. Clouds? 20 юни 2009, събота 18
  • 19. Computer cloud! 20 юни 2009, събота 19
  • 21. Communications • Messaging (AMQP): RabbitMQ • XMPP, Ejabberd, Prosody • Webhooks 20 юни 2009, събота 21 Webooks can help you with the infrastructure. Some service is too heavy? - move it to another machine and connect them with webhook. Think about webhooks even when on a single machine (call by URL, not by function name)
  • 22. PubSub 20 юни 2009, събота 22
  • 23. Publishers 20 юни 2009, събота 23
  • 24. Subscribers 20 юни 2009, събота 24
  • 25. Publishers and Subscribers 20 юни 2009, събота 25
  • 26. Watercoolr •PubSub •Webhooks •Ruby http://github.com/jcapote/watercoolr/ http://github.com/zh/watercoolr/ 20 юни 2009, събота 26
  • 27. PubSubHubBub http://code.google.com/p/pubsubhubbub/ 20 юни 2009, събота 27
  • 28. What are webhooks? 20 юни 2009, събота 28 Image from the presentation “Using Web Hooks” I keep repeating webhooks, webhooks,... So what are they?
  • 29. Captain Hook 20 юни 2009, събота 29
  • 30. SVN Hooks 20 юни 2009, събота 30 Image from the presentation “Using Web Hooks”
  • 31. Hooks • Subversion pre-commit, post-commit • Git, Mercurial - they have hooks too • Rails: :before_save, :after_delete 20 юни 2009, събота 31
  • 32. Unix Philosophy • do ONE THING and do it well • programs WORK TOGETHER • UNIVERSAL INTERFACE (text) 20 юни 2009, събота 32 Insert here more about the webhooks - POST, etc. example cat | grep | mail -> make this with web too (demo)
  • 33. UNIX pipes 20 юни 2009, събота 33 Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
  • 34. The Web 20 юни 2009, събота 34 Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
  • 35. Web 3D 20 юни 2009, събота 35 There are services creating the web pages (feeds). Now nodes communicate via RSS - indirect. Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
  • 36. WebApp pipes? 20 юни 2009, събота 36 Can we make a simple applications and connect them like a pipe? Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
  • 37. 20 юни 2009, събота 37 Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
  • 38. POST /service data={ 'message':'hey guys!' } 20 юни 2009, събота 38
  • 39. What are WEBhooks? webhooks are user defined callback URLs, that point to a web script to run on a certain event 20 юни 2009, събота 39 By letting the user specify a URL for various events, the application will POST data to those URLs when the events occur. Key poins: USER DEFINED, URLs (remote services), RUN ON CERTAIN EVENT (push, no cronjobs etc.)
  • 40. User defined 20 юни 2009, събота 40
  • 41. URLs = remote 20 юни 2009, събота 41
  • 42. register URL 20 юни 2009, събота 42 Image from the presentation “Using Web Hooks”
  • 43. get notification 20 юни 2009, събота 43 Image from the presentation “Using Web Hooks”
  • 44. Why? 20 юни 2009, събота 44
  • 45. Service Integration 20 юни 2009, събота 45
  • 46. Flexibility 20 юни 2009, събота 46
  • 47. Customization 20 юни 2009, събота 47 Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
  • 48. Webhooks movement • Jeff Lindsay • http://blogrium.com/?p=70 • http://webhooks.pbworks.com/ • http://blog.webhooks.org/ 20 юни 2009, събота 48
  • 49. Webhooks • Amazon have Merchant Callback API • PayPal (Instant Payment Notification) • GitHub and Google Code 20 юни 2009, събота 49
  • 50. Good and bad 20 юни 2009, събота 50
  • 51. Good • Well known protocol - HTTP • code libraries (software) • infrastructure (hardware) • Easy for vendors (services) • Easy for users (consumers) 20 юни 2009, събота 51
  • 52. 20 юни 2009, събота 52
  • 53. require ‘net/http’ require ‘json’ class User def commit(message) Net::HTTP.post_form( User.hook_url, { :data => message.to_json }) end end 20 юни 2009, събота 53 For service providers (publishers)
  • 54. require ‘net/smtp’ require ‘json’ require ‘sinatra’ post ‘/hook’ do data = JSON.parse(params[:data]) # do something with the data Net::SMTP.start(‘localhost’) do |smtp| smtp.send_message data[‘message’], from, to end end 20 юни 2009, събота 54 For service consumers (subscribers)
  • 55. Bad • No standard • Google Code: XML • GitHub: JSON • ping.fm - POST parameters • Security (authentication) 20 юни 2009, събота 55
  • 56. Real Life Usage 20 юни 2009, събота 56
  • 57. Where to create hooks? • http://heroku.com/ - Ruby • GAE - Python, Java, JRuby • http://scriptlets.org/ - Python, JS • PHP - almost everywhere 20 юни 2009, събота 57
  • 58. Ready Tools • GitHub - RunCodeRun • http://ping.fm/ - IM, email, Skype • http://postbin.org/ - debug • SwitchHub, TarPipe • http://superfeedr.com/ - RSS • http://bot.im/ - IMified XMPP bot 20 юни 2009, събота 58
  • 59. Demo ping.fm + postbin ping.fm + switchub (+postbin) 20 юни 2009, събота 59 create new hook on postbin, login to post.fm/custom/ and put there the url. test: web, email, im?
  • 60. Questions? 20 юни 2009, събота 60