Web Hooks On Pbwiki

14
Web Hooks Near-Real-Time, Simple awesomeness coming soon! [email protected]

description

SHDH23 presentation about web hooks - lightweight event-triggered web plumbing

Transcript of Web Hooks On Pbwiki

Page 1: Web Hooks On Pbwiki

Web HooksNear-Real-Time, Simple awesomeness

coming soon!

[email protected]

Page 2: Web Hooks On Pbwiki

Recall From SHDH 17Jeff Lindsay’s“Web hooks”lightning talk

• RSS relies on polling. • Polling is lame.• Syndication and (re)publishing, not triggering

Page 3: Web Hooks On Pbwiki

Recall From SHDH 17Jeff Lindsay’s“Web hooks”lightning talk

• Often n consumers.• Not 1000n.• Polling is still lame. • Are we there yet?• Are we there yet?• Are we there yet?

NO(for some things)

Page 4: Web Hooks On Pbwiki

Recall From SHDH 17Jeff Lindsay’s“Web hooks”lightning talk

• Event-driven.• Lightweight.• POST to a URL.

Page 5: Web Hooks On Pbwiki

Recall From SHDH 17Jeff Lindsay’s“Web hooks”lightning talk

• Event-driven.• Lightweight.• POST to a URL.

OLD LOGO

Page 6: Web Hooks On Pbwiki

Web hooks in practice

//something ...hook_trigger(‘viewpage’);//more stuff..

async

asyncwhile(1) {

while($queued = $q->get(‘async-queue’)) { post_to_url($queued[‘url’],$queued[‘postargs’]);}

}

Page 7: Web Hooks On Pbwiki

Web hooks in practice

Example hooked events• login/logout• edit a page• revert a page• delete a page• comment on a page• tag/untag pages• join/unjoin wiki• return_after_absence• view_for_first_time

Page 8: Web Hooks On Pbwiki

Web hooks in practice

Page 9: Web Hooks On Pbwiki

Web hooks in practice

Page 10: Web Hooks On Pbwiki

Web hooks in practice

Page 11: Web Hooks On Pbwiki

Web hooks in practice

Page 12: Web Hooks On Pbwiki

Web hooks in practice

Page 13: Web Hooks On Pbwiki

I want this to exist:

Trigger Filter Branch/Merge Transform Route

incoming web hook

$page =~/deploy/i

$to = [‘devel@’,ops@’]

$msg = fmt_to_aim($attrs) out_aim($to,$msg)

$uid == da39a3ee5e6b4b

$to = @all_sms;unset($to[$uid]);

$msg = fmt_to_sms($attrs)

out_sms($to,$msg)

$viewcount == 100 $to = $emails[$uid] $msg = “Wow you’re a power user”

out_email($to,$msg)

$op == ‘edit’ $to = [‘http://my.com/’,‘http://twittr.com/me’] $msg = $attrs out_hook($to,$msg);

= awesome but only polling (RSS)

Page 14: Web Hooks On Pbwiki