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

Webhooks - glue for the web (japanese)

Embed Size (px)

DESCRIPTION

第34回 Ruby/Rails勉強会@関西. 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)

Citation preview

Page 1: Webhooks - glue for the web (japanese)

Webhooksglue for the Web

120 юни 2009, събота

Page 2: Webhooks - glue for the web (japanese)

自己紹介

• 名前: ストヤン ジェコフ

• 3人の男の子のパパ

• 職業: Software Engineer

• Contact: xmpp: //[email protected]

220 юни 2009, събота

Page 3: Webhooks - glue for the web (japanese)

320 юни 2009, събота

Page 4: Webhooks - glue for the web (japanese)

420 юни 2009, събота

Page 5: Webhooks - glue for the web (japanese)

今日の予定•ナぜそんな話?

• webhooksって何?

•何ができる?

•いいニュースと悪いニュース

• Real life usage

520 юни 2009, събота

Maybe you already forget the presentation title, so one more time...

Page 6: Webhooks - glue for the web (japanese)

ナぜそんな話?

620 юни 2009, събота

Page 7: Webhooks - glue for the web (japanese)

Webhooksglue for the Web

720 юни 2009, събота

Page 8: Webhooks - glue for the web (japanese)

フーク?820 юни 2009, събота

Page 9: Webhooks - glue for the web (japanese)

Glue (のり)?920 юни 2009, събота

Page 10: Webhooks - glue for the web (japanese)

Web 3.01020 юни 2009, събота

Don’t worry. We will talk about web :)

Page 11: Webhooks - glue for the web (japanese)

Web x.0?

• Web 1.0 - static

• Web 2.0 - dynamic? social?

• Web 3.0 - real time?

1120 юни 2009, събота

Google Wave, iPhone push notifications

Page 12: Webhooks - glue for the web (japanese)

Web 3.0

• Real Time

• Does it scale?

• PubSub

1220 юни 2009, събота

Page 13: Webhooks - glue for the web (japanese)

Real Time1320 юни 2009, събота

Page 14: Webhooks - glue for the web (japanese)

Real Time Web

• RSSでは不十分(SUP)

• XMPP

• Webhooks

1420 юни 2009, събота

I spoke in Kobe about SUP and XMPP (see my other presentations - http://www.slideshare.net/zhesto/microblogging-via-xmpp

Page 15: Webhooks - glue for the web (japanese)

No Polling!1520 юни 2009, събота

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

Page 16: Webhooks - glue for the web (japanese)

Real Time1620 юни 2009, събота

Page 17: Webhooks - glue for the web (japanese)

Does it scale?

1720 юни 2009, събота

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

Page 18: Webhooks - glue for the web (japanese)

Clouds...

1820 юни 2009, събота

Page 19: Webhooks - glue for the web (japanese)

Clouds?1920 юни 2009, събота

Page 20: Webhooks - glue for the web (japanese)

コンピュータ cloud!2020 юни 2009, събота

Page 21: Webhooks - glue for the web (japanese)

Communications2120 юни 2009, събота

Page 22: Webhooks - glue for the web (japanese)

Communications

• Messaging (AMQP): RabbitMQ

• XMPP, Ejabberd, Prosody

• Webhooks

2220 юни 2009, събота

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)

Page 23: Webhooks - glue for the web (japanese)

PubSub

2320 юни 2009, събота

Page 24: Webhooks - glue for the web (japanese)

Publishers2420 юни 2009, събота

Page 25: Webhooks - glue for the web (japanese)

Subscribers2520 юни 2009, събота

Page 26: Webhooks - glue for the web (japanese)

Publishers and Subscribers

2620 юни 2009, събота

Page 27: Webhooks - glue for the web (japanese)

Watercoolr

•PubSub

•Webhooks

•Ruby

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

2720 юни 2009, събота

Page 28: Webhooks - glue for the web (japanese)

PubSubHubBubhttp://code.google.com/p/pubsubhubbub/

2820 юни 2009, събота

Page 29: Webhooks - glue for the web (japanese)

Webhooksって何?2920 юни 2009, събота

Image from the presentation “Using Web Hooks”I keep repeating webhooks, webhooks,... So what are they?

Page 30: Webhooks - glue for the web (japanese)

Captain Hook3020 юни 2009, събота

Page 31: Webhooks - glue for the web (japanese)

SVN Hooks3120 юни 2009, събота

Image from the presentation “Using Web Hooks”

Page 32: Webhooks - glue for the web (japanese)

Hooks

• Subversion pre-commit, post-commit

• Git, Mercurial - あります

• Rails: :before_save, :after_delete

3220 юни 2009, събота

Page 33: Webhooks - glue for the web (japanese)

3320 юни 2009, събота

Page 34: Webhooks - glue for the web (japanese)

Unix Philosophy

• do ONE THING and do it well

• programs WORK TOGETHER

• UNIVERSAL INTERFACE (text)

3420 юни 2009, събота

Insert here more about the webhooks - POST, etc.example cat | grep | mail -> make this with web too (demo)

Page 35: Webhooks - glue for the web (japanese)

UNIX pipes3520 юни 2009, събота

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

Page 36: Webhooks - glue for the web (japanese)

The Web3620 юни 2009, събота

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

Page 37: Webhooks - glue for the web (japanese)

Web 3D3720 юни 2009, събота

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”

Page 38: Webhooks - glue for the web (japanese)

WebApp pipes?3820 юни 2009, събота

Can we make a simple applications and connect them like a pipe?Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”

Page 39: Webhooks - glue for the web (japanese)

3920 юни 2009, събота

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

Page 40: Webhooks - glue for the web (japanese)

POST /service data={ 'message':'hey guys!' }

4020 юни 2009, събота

Page 41: Webhooks - glue for the web (japanese)

英語どう?4120 юни 2009, събота

Page 42: Webhooks - glue for the web (japanese)

What are WEBhooks?

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

certain event

4220 юни 2009, събота

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.)

Page 43: Webhooks - glue for the web (japanese)

User defined4320 юни 2009, събота

Page 44: Webhooks - glue for the web (japanese)

URLs = remote4420 юни 2009, събота

Page 45: Webhooks - glue for the web (japanese)

register URL4520 юни 2009, събота

Image from the presentation “Using Web Hooks”

Page 46: Webhooks - glue for the web (japanese)

get notification4620 юни 2009, събота

Image from the presentation “Using Web Hooks”

Page 47: Webhooks - glue for the web (japanese)

Why?

4720 юни 2009, събота

Page 48: Webhooks - glue for the web (japanese)

Service Integration4820 юни 2009, събота

Page 49: Webhooks - glue for the web (japanese)

Flexibility4920 юни 2009, събота

Page 50: Webhooks - glue for the web (japanese)

Customization5020 юни 2009, събота

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

Page 51: Webhooks - glue for the web (japanese)

Webhooks ムーブメント

• Jeff Lindsay

• http://blogrium.com/?p=70

• http://webhooks.pbworks.com/

• http://blog.webhooks.org/

5120 юни 2009, събота

Page 52: Webhooks - glue for the web (japanese)

Webhooks

• Amazon have Merchant Callback API

• PayPal (Instant Payment Notification)

• GitHub and Google Code

5220 юни 2009, събота

Page 53: Webhooks - glue for the web (japanese)

Good and bad5320 юни 2009, събота

Page 54: Webhooks - glue for the web (japanese)

いいニュース

• Well known protocol - HTTP

• code libraries (software)

• infrastructure (hardware)

• Easy for vendors (services)

• Easy for users (consumers)

5420 юни 2009, събота

Page 55: Webhooks - glue for the web (japanese)

5520 юни 2009, събота

Page 56: Webhooks - glue for the web (japanese)

require ‘net/http’require ‘json’

class Userdef commit(message)

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

endend

5620 юни 2009, събота

For service providers (publishers)

Page 57: Webhooks - glue for the web (japanese)

require ‘net/smtp’require ‘json’require ‘sinatra’

post ‘/hook’ dodata = JSON.parse(params[:data])# do something with the dataNet::SMTP.start(‘localhost’) do |smtp|

smtp.send_message data[‘message’], from, to end

end

5720 юни 2009, събота

For service consumers (subscribers)

Page 58: Webhooks - glue for the web (japanese)

悪いニュース

•スタンダードがない

• Google Code: XML

• GitHub: JSON

• ping.fm - POST パラメーター

•セキュリティー (authentication)

5820 юни 2009, събота

Page 59: Webhooks - glue for the web (japanese)

Real Life Usage

5920 юни 2009, събота

Page 60: Webhooks - glue for the web (japanese)

どこでうごかせる?

• http://heroku.com/ - Ruby

• GAE - Python, Java, JRuby

• http://scriptlets.org/ - Python, JS

• PHP - almost everywhere

6020 юни 2009, събота

Page 61: Webhooks - glue for the web (japanese)

できてるツール

• GitHub - RunCodeRun

• http://ping.fm/ - IM, email, Skype

• http://postbin.org/ - debug

• SwitchHub, TarPipe

• http://superfeedr.com/ - RSS

• http://bot.im/ - IMified XMPP bot

6120 юни 2009, събота

Page 62: Webhooks - glue for the web (japanese)

Demoping.fm + postbin

ping.fm + switchub (+postbin)

6220 юни 2009, събота

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

Page 63: Webhooks - glue for the web (japanese)

質問タイム

6320 юни 2009, събота