Upload
stoyan-zhekov
View
1.720
Download
1
Tags:
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
Webhooksglue for the Web
120 юни 2009, събота
自己紹介
• 名前: ストヤン ジェコフ
• 3人の男の子のパパ
• 職業: Software Engineer
• Contact: xmpp: //[email protected]
220 юни 2009, събота
320 юни 2009, събота
420 юни 2009, събота
今日の予定•ナぜそんな話?
• webhooksって何?
•何ができる?
•いいニュースと悪いニュース
• Real life usage
520 юни 2009, събота
Maybe you already forget the presentation title, so one more time...
ナぜそんな話?
620 юни 2009, събота
Webhooksglue for the Web
720 юни 2009, събота
フーク?820 юни 2009, събота
Glue (のり)?920 юни 2009, събота
Web 3.01020 юни 2009, събота
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?
1120 юни 2009, събота
Google Wave, iPhone push notifications
Web 3.0
• Real Time
• Does it scale?
• PubSub
1220 юни 2009, събота
Real Time1320 юни 2009, събота
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
No Polling!1520 юни 2009, събота
Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
Real Time1620 юни 2009, събота
Does it scale?
1720 юни 2009, събота
Recently working a lot with EC2 - pay per use, scale easy - instant start/stop of instances
Clouds...
1820 юни 2009, събота
Clouds?1920 юни 2009, събота
コンピュータ cloud!2020 юни 2009, събота
Communications2120 юни 2009, събота
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)
PubSub
2320 юни 2009, събота
Publishers2420 юни 2009, събота
Subscribers2520 юни 2009, събота
Publishers and Subscribers
2620 юни 2009, събота
Watercoolr
•PubSub
•Webhooks
•Ruby
http://github.com/zh/watercoolr/http://github.com/jcapote/watercoolr/
2720 юни 2009, събота
PubSubHubBubhttp://code.google.com/p/pubsubhubbub/
2820 юни 2009, събота
Webhooksって何?2920 юни 2009, събота
Image from the presentation “Using Web Hooks”I keep repeating webhooks, webhooks,... So what are they?
Captain Hook3020 юни 2009, събота
SVN Hooks3120 юни 2009, събота
Image from the presentation “Using Web Hooks”
Hooks
• Subversion pre-commit, post-commit
• Git, Mercurial - あります
• Rails: :before_save, :after_delete
3220 юни 2009, събота
3320 юни 2009, събота
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)
UNIX pipes3520 юни 2009, събота
Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
The Web3620 юни 2009, събота
Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
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”
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”
3920 юни 2009, събота
Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
POST /service data={ 'message':'hey guys!' }
4020 юни 2009, събота
英語どう?4120 юни 2009, събота
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.)
User defined4320 юни 2009, събота
URLs = remote4420 юни 2009, събота
register URL4520 юни 2009, събота
Image from the presentation “Using Web Hooks”
get notification4620 юни 2009, събота
Image from the presentation “Using Web Hooks”
Why?
4720 юни 2009, събота
Service Integration4820 юни 2009, събота
Flexibility4920 юни 2009, събота
Customization5020 юни 2009, събота
Image from the presentation ”Web Hooks and the Programmable World of Tomorrow”
Webhooks ムーブメント
• Jeff Lindsay
• http://blogrium.com/?p=70
• http://webhooks.pbworks.com/
• http://blog.webhooks.org/
5120 юни 2009, събота
Webhooks
• Amazon have Merchant Callback API
• PayPal (Instant Payment Notification)
• GitHub and Google Code
5220 юни 2009, събота
Good and bad5320 юни 2009, събота
いいニュース
• Well known protocol - HTTP
• code libraries (software)
• infrastructure (hardware)
• Easy for vendors (services)
• Easy for users (consumers)
5420 юни 2009, събота
5520 юни 2009, събота
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)
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)
悪いニュース
•スタンダードがない
• Google Code: XML
• GitHub: JSON
• ping.fm - POST パラメーター
•セキュリティー (authentication)
5820 юни 2009, събота
Real Life Usage
5920 юни 2009, събота
どこでうごかせる?
• http://heroku.com/ - Ruby
• GAE - Python, Java, JRuby
• http://scriptlets.org/ - Python, JS
• PHP - almost everywhere
6020 юни 2009, събота
できてるツール
• 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, събота
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?
質問タイム
6320 юни 2009, събота