Computer code that writes stories

It’s about the power of code, and it’s also about a UF J-school alum, Ken Schwencke (JM – 2009), who works on the Data Desk at the Los Angeles Times.

Whenever there’s an earthquake, the U.S. Geological Survey (USGS) sends out email alerts. Schwencke set up an email account to receive those emails. This past Monday, an email landed in that inbox. Automatically, because the email had arrived, a program (written by Schwencke) parsed the text of the email to find answers to these three questions:

  • Is the quake in LA, with greater than 2.5-magnitude?
  • Is the quake in California, with greater than 3.0-magnitude?
  • Is the quake in the U.S., with greater than a 4.5-magnitude?

If only the last question is answered affirmatively, the bot emails the paper’s national reporters and editors — a kind of early alert to a developing story. If either of the first two questions are affirmative, though, it both alerts the metro desk to the quake and writes a simple post.

The Atlantic published a first-rate story about it: How a California Earthquake Becomes the News: An Extremely Precise Timeline. The quote above comes from that story.

Slate published the shorter, more hip-sounding The First News Report on the L.A. Earthquake Was Written by a Robot. This one reproduces the complete text of the very first report (written by the program) — this was later expanded and updated by humans at the same URL.

Schwencke was interviewed on NPR’s morning Weekend Edition news program on March 22 (2 min. 59 sec.).

Not every journalism story lends itself to this kind of treatment. Most don’t. I like it as an example of what a journalist can do if — like Schwencke — he or she can think algorithmically. Learning how to write programs in a computer programming language (any language, with some popular examples being JavaScript, Python, and Ruby) benefits journalists because it opens up new ways to solve problems. This earthquake case is only one example.

A version of this post also appeared on the course website for MMC 4341 Advanced Online Media Production.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.