<commit_before><!doctype html>
<html lang="en">

	<head>
		<meta charset="utf-8">

		<title>Talk generated by Markdown to Reveal</title>

		<meta name="description" content="Generate a Reveal.js talk from a Markdown file.">
		<meta name="author" content="<NAME>">

		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">

		<link rel="stylesheet" href="css/reveal.css">
		<link rel="stylesheet" href="css/theme/black.css" id="theme">

		<!-- Code syntax highlighting -->
		<link rel="stylesheet" href="lib/css/zenburn.css">

		<!-- Printing and PDF exports -->
		<script>
			var link = document.createElement( 'link' );
			link.rel = 'stylesheet';
			link.type = 'text/css';
			link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
			document.getElementsByTagName( 'head' )[0].appendChild( link );
		</script>

		<!--[if lt IE 9]>
		<script src="lib/js/html5shiv.js"></script>
		<![endif]-->
	</head>

	<body>

		<div class="reveal">

			<!-- Any section element inside of this container is displayed as a slide -->
			<div class="slides">

        <section>
<h1 id="an-intro-to-implementing-webhooks-in-ruby">An Intro to Implementing Webhooks in Ruby</h1>

<p>With Real Examples, Too!</p>

<aside class="notes">

</aside>
</section>
<section>

<h1 id="who-am-i">Who am I?</h1>

<h2 id="kyle-tolle"><NAME></h2>

<p><a href="http://kyletolle.com">kyletolle.com</a> |
<a href="https://twitter.com/kyletolle">@kyletolle</a></p>

<p>Software Engineer at <a href="http://spatialhetworks.com">Spatial Networks</a></p>

<p>Implemented webhooks in <a href="http://fulcrumapp.com">Fulcrum</a>, our mobile data
collection service</p>


<aside class="notes">

Ours have been in operation for about a year and a half. I wanted to share
what I've learned. Maybe you'll find it useful or interesting. And I would
love to get your feedback as well.

</aside>
</section>
<section>

<h1 id="first-off">First off</h1>

<p>Ask questions at any time!</p>

<aside class="notes">

If I don't know the answer, I can always ignore you!

</aside>
</section>
<section>

<h2 id="slides-for-this-talk">Slides for this talk</h2>

<h3 id="presentation">Presentation:</h3>

<p><a href="https://kyletolle.github.io/ruby_webhooks_intro">https://kyletolle.github.io/ruby_webhooks_intro</a></p>

<h3 id="code">Code:</h3>

<p><a href="https://github.com/kyletolle/ruby_webhooks_intro">https://github.com/kyletolle/ruby_webhooks_intro</a></p>

<aside class="notes">

</aside>
</section>
<section>

<h1 id="overview">Overview</h1>

<ul>
  <li>How clients use APIs</li>
  <li>Why webhooks are a thing</li>
  <li>Barebones webhooks demo</li>
  <li>Webhooks integration demo</li>
  <li>Other things we can do</li>
  <li>Recapping and wrapping up</li>
</ul>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="our-fictional-client">Our fictional client</h2>

<p>Government Agency for Bear Attacks</p>

<aside class="notes">

This fictional organization will help make things a little more concrete.
Explain how they'll use Fulcrum.

</aside>
</section>
<section>

<h3 id="vicious">Vicious</h3>

<p><img src="bear_boxing_attack.gif" alt="bear boxing attack" /></p>

<aside class="notes">

</aside>
</section>
<section>

<h3 id="relentless">Relentless</h3>

<p><img src="cute_bear_attack.gif" alt="cute bear attack" /></p>

<aside class="notes">

</aside>
</section>
<section>

<h3 id="unexpected">Unexpected</h3>

<p><img src="eagle_attacks_bear.gif" alt="eagle attacks bear" /></p>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="so-im-here">So I’m here</h2>

<p>to talk about webhooks</p>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="but-first">But first</h2>

<p>we need some background</p>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="lets-start-with">Let’s start with</h2>

<p>what we know</p>

<aside class="notes">

</aside>
</section>
<section>

<h1 id="apis">APIs</h1>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="why-do-we-have-apis">Why do we have APIs?</h2>

<aside class="notes">

Can you shout out some reasons for why we have APIs?
Those are all great ideas.
And I want to focus on one in particular.

</aside>
</section>
<section>

<h2 id="apis-allow">APIs allow</h2>

<h2 id="people-to-get-their-data">people to get their data</h2>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="how-do-apis-work">How do APIs work?</h2>

<h3 id="the-client-calls-us">The client calls us</h3>

<aside class="notes">

When our clients want their data, they make a request to our servers.
The people in the office will use our API to get our their data on bear
attacks.

</aside>
</section>
<section>

<h2 id="why-are-they-really-trying-to-get-their-data">Why are they really trying to get their data?</h2>

<h3 id="to-do-things-with-it">To do things with it!</h3>

<aside class="notes">

Their data is important. Taking action on it is valuable. Acting quickly gives
them an advantage.
They can share it with the public. Analyze it. Try to prevent more bear
attacks.

</aside>
</section>
<section>

<h2 id="how-do-they-use-the-api">How do they use the API?</h2>

<ul>
  <li>Call our API</li>
  <li>Frequently</li>
  <li>In a script/application</li>
</ul>

<aside class="notes">

They write a script to hit our API every few days, or hours, or seconds
and do something with the data they get back.

</aside>
</section>
<section>

<p>This is</p>

<h2 id="polling">polling</h2>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="polling-is-straight-forward">Polling is straight-forward</h2>

<aside class="notes">

And there are some upsides to it, which we won't get into here

</aside>
</section>
<section>

<p>But there are some</p>

<h2 id="downsides">Downsides</h2>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="section">#1</h2>

<h3 id="your-client-writes-the-code">Your client writes the code</h3>

<aside class="notes">

</aside>
</section>
<section>

<h3 id="how-long-until">How long until</h3>

<p>someone murders your servers?</p>

<aside class="notes">

They're likely to push the limits. Maybe they'll write an infinite loop which
hits your API as fast as it can.

Or, they'll have some "mission critical" need for ONE MILLION calls per month.
That's not a made up number. We had someone whose script really did this.

It's bad enough if one person does this, but imagine a few more people doing
the same thing. These legitimate requests can end up swamping your servers.

</aside>
</section>
<section>

<h2 id="section">#2</h2>

<h3 id="to-react-faster-they-have-to-poll-more">To react faster, they have to poll more</h3>

<aside class="notes">

</aside>
</section>
<section>

<h3 id="more-polling-means">More polling means</h3>

<h2 id="more-resources">more resources</h2>

<ul>
  <li>development time</li>
  <li>support time</li>
  <li>processors</li>
  <li>memory</li>
  <li>bandwidth</li>
</ul>

<aside class="notes">

For you, and for them. These costs add up, especially when you have more
customers.

</aside>
</section>
<section>

<h2 id="section">#3</h2>

<h3 id="its-mostly-useless">It’s mostly useless</h3>

<aside class="notes">

This isn't an existential crisis, I promise.
So what do I mean?

</aside>
</section>
<section>

<h3 id="most-polls-wont-return-new-data">Most polls won’t return new data</h3>

<aside class="notes">

The rate of their polling is constant.
They do it once every few seconds.
But the rate of their data changing is variable.
Maybe it only changes every couple days, or only during business hours.

Meaning, a majority of their polls won't return anything to act on.

They're hitting up yuor server all the time, and usually it's for nothing.
Talk about disappointing.

</aside>
</section>
<section>

<h2 id="section">#4</h2>

<h3 id="and-its-still-not-real-time">And it’s still not Real-Time™</h3>

<aside class="notes">

Additionally, to approach acting in real-time, they have to poll more and
more frequently. Except that, even when polling faster, they won't have truly
Real-Time™ data.

</aside>
</section>
<section>

<h2 id="okay">Okay</h2>

<h3 id="we-see-the-disadvantages">we see the disadvantages</h3>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="but-so-what">But so what?</h2>

<h3 id="we-already-have-an-api">We already have an API</h3>

<ul>
  <li>It exsits</li>
  <li>It works</li>
</ul>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="lets-come-back-to-whats-important">Let’s come back to what’s important</h2>
<commit_msg>Fix typo in exists<commit_after><!doctype html>
<html lang="en">

	<head>
		<meta charset="utf-8">

		<title>Talk generated by Markdown to Reveal</title>

		<meta name="description" content="Generate a Reveal.js talk from a Markdown file.">
		<meta name="author" content="<NAME>">

		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">

		<link rel="stylesheet" href="css/reveal.css">
		<link rel="stylesheet" href="css/theme/black.css" id="theme">

		<!-- Code syntax highlighting -->
		<link rel="stylesheet" href="lib/css/zenburn.css">

		<!-- Printing and PDF exports -->
		<script>
			var link = document.createElement( 'link' );
			link.rel = 'stylesheet';
			link.type = 'text/css';
			link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
			document.getElementsByTagName( 'head' )[0].appendChild( link );
		</script>

		<!--[if lt IE 9]>
		<script src="lib/js/html5shiv.js"></script>
		<![endif]-->
	</head>

	<body>

		<div class="reveal">

			<!-- Any section element inside of this container is displayed as a slide -->
			<div class="slides">

        <section>
<h1 id="an-intro-to-implementing-webhooks-in-ruby">An Intro to Implementing Webhooks in Ruby</h1>

<p>With Real Examples, Too!</p>

<aside class="notes">

</aside>
</section>
<section>

<h1 id="who-am-i">Who am I?</h1>

<h2 id="kyle-tolle"><NAME></h2>

<p><a href="http://kyletolle.com">kyletolle.com</a> |
<a href="https://twitter.com/kyletolle">@kyletolle</a></p>

<p>Software Engineer at <a href="http://spatialhetworks.com">Spatial Networks</a></p>

<p>Implemented webhooks in <a href="http://fulcrumapp.com">Fulcrum</a>, our mobile data
collection service</p>


<aside class="notes">

Ours have been in operation for about a year and a half. I wanted to share
what I've learned. Maybe you'll find it useful or interesting. And I would
love to get your feedback as well.

</aside>
</section>
<section>

<h1 id="first-off">First off</h1>

<p>Ask questions at any time!</p>

<aside class="notes">

If I don't know the answer, I can always ignore you!

</aside>
</section>
<section>

<h2 id="slides-for-this-talk">Slides for this talk</h2>

<h3 id="presentation">Presentation:</h3>

<p><a href="https://kyletolle.github.io/ruby_webhooks_intro">https://kyletolle.github.io/ruby_webhooks_intro</a></p>

<h3 id="code">Code:</h3>

<p><a href="https://github.com/kyletolle/ruby_webhooks_intro">https://github.com/kyletolle/ruby_webhooks_intro</a></p>

<aside class="notes">

</aside>
</section>
<section>

<h1 id="overview">Overview</h1>

<ul>
  <li>How clients use APIs</li>
  <li>Why webhooks are a thing</li>
  <li>Barebones webhooks demo</li>
  <li>Webhooks integration demo</li>
  <li>Other things we can do</li>
  <li>Recapping and wrapping up</li>
</ul>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="our-fictional-client">Our fictional client</h2>

<p>Government Agency for Bear Attacks</p>

<aside class="notes">

This fictional organization will help make things a little more concrete.
Explain how they'll use Fulcrum.

</aside>
</section>
<section>

<h3 id="vicious">Vicious</h3>

<p><img src="bear_boxing_attack.gif" alt="bear boxing attack" /></p>

<aside class="notes">

</aside>
</section>
<section>

<h3 id="relentless">Relentless</h3>

<p><img src="cute_bear_attack.gif" alt="cute bear attack" /></p>

<aside class="notes">

</aside>
</section>
<section>

<h3 id="unexpected">Unexpected</h3>

<p><img src="eagle_attacks_bear.gif" alt="eagle attacks bear" /></p>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="so-im-here">So I’m here</h2>

<p>to talk about webhooks</p>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="but-first">But first</h2>

<p>we need some background</p>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="lets-start-with">Let’s start with</h2>

<p>what we know</p>

<aside class="notes">

</aside>
</section>
<section>

<h1 id="apis">APIs</h1>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="why-do-we-have-apis">Why do we have APIs?</h2>

<aside class="notes">

Can you shout out some reasons for why we have APIs?
Those are all great ideas.
And I want to focus on one in particular.

</aside>
</section>
<section>

<h2 id="apis-allow">APIs allow</h2>

<h2 id="people-to-get-their-data">people to get their data</h2>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="how-do-apis-work">How do APIs work?</h2>

<h3 id="the-client-calls-us">The client calls us</h3>

<aside class="notes">

When our clients want their data, they make a request to our servers.
The people in the office will use our API to get our their data on bear
attacks.

</aside>
</section>
<section>

<h2 id="why-are-they-really-trying-to-get-their-data">Why are they really trying to get their data?</h2>

<h3 id="to-do-things-with-it">To do things with it!</h3>

<aside class="notes">

Their data is important. Taking action on it is valuable. Acting quickly gives
them an advantage.
They can share it with the public. Analyze it. Try to prevent more bear
attacks.

</aside>
</section>
<section>

<h2 id="how-do-they-use-the-api">How do they use the API?</h2>

<ul>
  <li>Call our API</li>
  <li>Frequently</li>
  <li>In a script/application</li>
</ul>

<aside class="notes">

They write a script to hit our API every few days, or hours, or seconds
and do something with the data they get back.

</aside>
</section>
<section>

<p>This is</p>

<h2 id="polling">polling</h2>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="polling-is-straight-forward">Polling is straight-forward</h2>

<aside class="notes">

And there are some upsides to it, which we won't get into here

</aside>
</section>
<section>

<p>But there are some</p>

<h2 id="downsides">Downsides</h2>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="section">#1</h2>

<h3 id="your-client-writes-the-code">Your client writes the code</h3>

<aside class="notes">

</aside>
</section>
<section>

<h3 id="how-long-until">How long until</h3>

<p>someone murders your servers?</p>

<aside class="notes">

They're likely to push the limits. Maybe they'll write an infinite loop which
hits your API as fast as it can.

Or, they'll have some "mission critical" need for ONE MILLION calls per month.
That's not a made up number. We had someone whose script really did this.

It's bad enough if one person does this, but imagine a few more people doing
the same thing. These legitimate requests can end up swamping your servers.

</aside>
</section>
<section>

<h2 id="section">#2</h2>

<h3 id="to-react-faster-they-have-to-poll-more">To react faster, they have to poll more</h3>

<aside class="notes">

</aside>
</section>
<section>

<h3 id="more-polling-means">More polling means</h3>

<h2 id="more-resources">more resources</h2>

<ul>
  <li>development time</li>
  <li>support time</li>
  <li>processors</li>
  <li>memory</li>
  <li>bandwidth</li>
</ul>

<aside class="notes">

For you, and for them. These costs add up, especially when you have more
customers.

</aside>
</section>
<section>

<h2 id="section">#3</h2>

<h3 id="its-mostly-useless">It’s mostly useless</h3>

<aside class="notes">

This isn't an existential crisis, I promise.
So what do I mean?

</aside>
</section>
<section>

<h3 id="most-polls-wont-return-new-data">Most polls won’t return new data</h3>

<aside class="notes">

The rate of their polling is constant.
They do it once every few seconds.
But the rate of their data changing is variable.
Maybe it only changes every couple days, or only during business hours.

Meaning, a majority of their polls won't return anything to act on.

They're hitting up yuor server all the time, and usually it's for nothing.
Talk about disappointing.

</aside>
</section>
<section>

<h2 id="section">#4</h2>

<h3 id="and-its-still-not-real-time">And it’s still not Real-Time™</h3>

<aside class="notes">

Additionally, to approach acting in real-time, they have to poll more and
more frequently. Except that, even when polling faster, they won't have truly
Real-Time™ data.

</aside>
</section>
<section>

<h2 id="okay">Okay</h2>

<h3 id="we-see-the-disadvantages">we see the disadvantages</h3>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="but-so-what">But so what?</h2>

<h3 id="we-already-have-an-api">We already have an API</h3>

<ul>
  <li>It exists</li>
  <li>It works</li>
</ul>

<aside class="notes">

</aside>
</section>
<section>

<h2 id="lets-come-back-to-whats-important">Let’s come back to what’s important</h2>

{'fraction_non_alphanumeric': 0.17165668662674652, 'fraction_numerical': 0.01140575990875392, 'mean_word_length': 4.445962732919255, 'pattern_counts': {'":': 0, '<': 657, '<?xml version=': 0, '>': 657, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1483091', 'n_tokens_mistral': 6823, 'n_tokens_neox': 6448, 'n_words': 1877}