Introduction - use case



Your computer is going to do the work for you. You will receive alerts when something you find interesting happens.

You can now consume datasets without effort, and you've made your first step into data-journalism and computer-assisted reporting!

"Stringers" and "use cases"

A stringer is just a function.

              function stringer(parameter1, parameter2, callback) {
  // with the parameters, the stringer fetches the data and does some process over it
  // if an alert is to be fired, the callback is called with the stringer's
  // name and the reason for the alert.
A use case aggregates a stringer file name and a set of parameters for it. With that, one can load the stringer and pass it the set of parameters, plus a callback. It allows to re-use the stringer multiple times with different parameters.

What we're going to do

Datastringer comes with two built-in stringers based on API

  • The first example will monitor a local police force, by sending you all the news your editor wouldn't want you to miss
  • The second one will monitor crime progression in a neighbourhood. This is done by fetching a bunch of statistics from, mashing them together, calculating averages and deltas... and finally checking if the thresholds you defined were crossed.

Let's just demo it.

because "demo or didn't happen."

Going beyond the examples

Creating your own stringer is easy:

  • You select your favourite dataset that you want to monitor
  • You write some Javascript to explain how to get the data ( GET method, $.getJSON, curl, Atom feed...)
  • Optional: you write the operations to perform with the data ( calculate averages...)
  • You work normally as if nothing happened
  • Hooray! You receive an email when your alerts are triggered!

Questions ?


Github repo:

Contributor (the man with a beard):
Clément Geiger,

(Upvote us on Hacker News now!)