Webhooks
                      glue for the Web




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


                 • Name: Stoyan Zhekov
                 • Private: married, 3 kids (boys)
                 • ...
20 юни 2009, събота   3
Today

                 • What is this talk about?
                 • What are webhooks?
                 • What can they ...
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 - ...
Web 3.0


                 • Real Time
                 • Does it scale?
                 • PubSub



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


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



20 юни 2...
No Polling!
20 юни 2009, събота                                                              14

Image from the presentati...
Real Time
20 юни 2009, събота               15
Does it scale?



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

Recent...
Clouds...



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


                 • Messaging (AMQP): RabbitMQ
                 • XMPP, Ejabberd, Prosody
                ...
PubSub



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

                 •PubSub
                 •Webhooks
                 •Ruby

                      http://githu...
PubSubHubBub
                  http://code.google.com/p/pubsubhubbub/


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

Image from the presentation “Using Web ...
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
    ...
Unix Philosophy


                 • do ONE THING and do it well
                 • programs WORK TOGETHER
               ...
UNIX pipes
20 юни 2009, събота                                                              33

Image from the presentatio...
The Web
20 юни 2009, събота                                                              34

Image from the presentation ”...
Web 3D
20 юни 2009, събота                                                                  35

There are services creatin...
WebApp pipes?
20 юни 2009, събота                                                              36

Can we make a simple ap...
20 юни 2009, събота                                                              37

Image from the presentation ”Web Hook...
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 ru...
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 presenta...
Webhooks movement


                 • Jeff Lindsay
                 • http://blogrium.com/?p=70
                 • http:/...
Webhooks


               • Amazon have Merchant Callback API
               • PayPal (Instant Payment Notification)
      ...
Good and bad
20 юни 2009, събота                  50
Good

                 • Well known protocol - HTTP
                      • code libraries (software)
                    ...
20 юни 2009, събота   52
require ‘net/http’
         require ‘json’

         class User
            def commit(message)
               Net::HTTP.p...
require ‘net/smtp’
         require ‘json’
         require ‘sinatra’

         post ‘/hook’ do
            data = JSON.pa...
Bad

                 • No standard
                      • Google Code: XML
                      • GitHub: JSON
        ...
Real Life Usage



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


                 • http://heroku.com/ - Ruby
                 • GAE - Python, Java, JRuby
       ...
Ready Tools
                 • GitHub - RunCodeRun
                 • http://ping.fm/ - IM, email, Skype
                 ...
Demo
                            ping.fm + postbin
                      ping.fm + switchub (+postbin)




20 юни 2009, съ...
Questions?



20 юни 2009, събота                60
Upcoming SlideShare
Loading in...5
×

Webhooks - glue for the web

2,447

Published on

Presentation for the 34th Ruby-Kansai meeting. Credits: some of the images inside are from the Jeff Lindsay's presentations "Web Hooks and the Programmable World of Tomorrow" and "Using Web Hooks" (see the presenter notes below the slides)

Published in: Technology, Education
0 Comments
15 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,447
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
110
Comments
0
Likes
15
Embeds 0
No embeds

No notes for slide

Webhooks - glue for the web

  1. 1. Webhooks glue for the Web 20 юни 2009, събота 1
  2. 2. Who am I ? • Name: Stoyan Zhekov • Private: married, 3 kids (boys) • Work: Software Engineer • Contact: xmpp: //zh@jabber.jp 20 юни 2009, събота 2
  3. 3. 20 юни 2009, събота 3
  4. 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. 5. What is this talk about? 20 юни 2009, събота 5
  6. 6. Webhooks glue for the Web 20 юни 2009, събота 6
  7. 7. Hooks? 20 юни 2009, събота 7
  8. 8. Glue? 20 юни 2009, събота 8
  9. 9. Web 3.0 20 юни 2009, събота 9 Don’t worry. We will talk about web :)
  10. 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. 11. Web 3.0 • Real Time • Does it scale? • PubSub 20 юни 2009, събота 11
  12. 12. Real Time 20 юни 2009, събота 12
  13. 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. 14. No Polling! 20 юни 2009, събота 14 Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
  15. 15. Real Time 20 юни 2009, събота 15
  16. 16. Does it scale? 20 юни 2009, събота 16 Recently working a lot with EC2 - pay per use, scale easy - instant start/stop of instances
  17. 17. Clouds... 20 юни 2009, събота 17
  18. 18. Clouds? 20 юни 2009, събота 18
  19. 19. Computer cloud! 20 юни 2009, събота 19
  20. 20. Communications 20 юни 2009, събота 20
  21. 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. 22. PubSub 20 юни 2009, събота 22
  23. 23. Publishers 20 юни 2009, събота 23
  24. 24. Subscribers 20 юни 2009, събота 24
  25. 25. Publishers and Subscribers 20 юни 2009, събота 25
  26. 26. Watercoolr •PubSub •Webhooks •Ruby http://github.com/jcapote/watercoolr/ http://github.com/zh/watercoolr/ 20 юни 2009, събота 26
  27. 27. PubSubHubBub http://code.google.com/p/pubsubhubbub/ 20 юни 2009, събота 27
  28. 28. What are webhooks? 20 юни 2009, събота 28 Image from the presentation “Using Web Hooks” I keep repeating webhooks, webhooks,... So what are they?
  29. 29. Captain Hook 20 юни 2009, събота 29
  30. 30. SVN Hooks 20 юни 2009, събота 30 Image from the presentation “Using Web Hooks”
  31. 31. Hooks • Subversion pre-commit, post-commit • Git, Mercurial - they have hooks too • Rails: :before_save, :after_delete 20 юни 2009, събота 31
  32. 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. 33. UNIX pipes 20 юни 2009, събота 33 Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
  34. 34. The Web 20 юни 2009, събота 34 Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
  35. 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. 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. 37. 20 юни 2009, събота 37 Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
  38. 38. POST /service data={ 'message':'hey guys!' } 20 юни 2009, събота 38
  39. 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. 40. User defined 20 юни 2009, събота 40
  41. 41. URLs = remote 20 юни 2009, събота 41
  42. 42. register URL 20 юни 2009, събота 42 Image from the presentation “Using Web Hooks”
  43. 43. get notification 20 юни 2009, събота 43 Image from the presentation “Using Web Hooks”
  44. 44. Why? 20 юни 2009, събота 44
  45. 45. Service Integration 20 юни 2009, събота 45
  46. 46. Flexibility 20 юни 2009, събота 46
  47. 47. Customization 20 юни 2009, събота 47 Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
  48. 48. Webhooks movement • Jeff Lindsay • http://blogrium.com/?p=70 • http://webhooks.pbworks.com/ • http://blog.webhooks.org/ 20 юни 2009, събота 48
  49. 49. Webhooks • Amazon have Merchant Callback API • PayPal (Instant Payment Notification) • GitHub and Google Code 20 юни 2009, събота 49
  50. 50. Good and bad 20 юни 2009, събота 50
  51. 51. Good • Well known protocol - HTTP • code libraries (software) • infrastructure (hardware) • Easy for vendors (services) • Easy for users (consumers) 20 юни 2009, събота 51
  52. 52. 20 юни 2009, събота 52
  53. 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. 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. 55. Bad • No standard • Google Code: XML • GitHub: JSON • ping.fm - POST parameters • Security (authentication) 20 юни 2009, събота 55
  56. 56. Real Life Usage 20 юни 2009, събота 56
  57. 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. 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. 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. 60. Questions? 20 юни 2009, събота 60
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×