NewsAlarm – wiring in to the NYT NewsWire API

NewsAlarm: Process

Holding a smoke alarm, battery installed, is somewhat like holding an unwound jack-in-the-box. While you know that it shouldn’t go off, there’s still a nagging suspicion that it might. I get a similar feeling when I check news websites in the morning – somewhere in the back of my mind, I suspect that the world might have caught on fire while I was asleep. So, it made at least some degree of sense to me to build a News Alarm – a device that sounds an alarm when specific new stories are detected ‘off the wire’.

Last week, I wrote a simple set of Classes in Processing which connect to the New York Times NewsWire API. The NewsWire has been described by the NYT R&D guys as a ‘firehose’ – it send out a live stream of articles as (or before) they are posted or published by the Times. The Processing Classes allow you to hook up to the feed, and to set up alerts that are triggered when stories with specific keywords or descriptors are published. By attaching filters, you can in effect adjust the tolerance of the alerts, so that you can be notified when a key word, person, or location appears at all, or when it appears repeatedly over a period of time. For example, I might want to be alerted when any story about Canadian Prime Minister Stephen Harper comes across the NewsWire. I can set this up like so:

NYTNewsWire wire = new NYTNewsWire();
wire.addListener(this);
wire.addFilter(”person”, “HARPER, STEPHEN”, 0);

I’ve asked the NYTNewsWire object to listen for stories tagged with Mr. Harper. I’ve set a tolerance of 0, which means that I’ll be alerted if stories come up at any frequency. If I wanted the alert to only be published if a LOT of stories about Harper came across the wire (if he were, say, to resign, or be impeached, or disappear, or other such good news), I can adjust this frequency number. Here, I’ll only be alerted if more than 25% of the wire stories are about him:

NYTNewsWire wire = new NYTNewsWire();
wire.addListener(this);
wire.addFilter(”person”, “HARPER, STEPHEN”, 0.25);

Obviously, we can set up any number of filters and get our alerts to be specific as possible. Which is useful if you are going to, say, be hooking up the alert to a 85 dB smoke alarm.

NewsAlarm: Process

Smoke detectors work by detecting small particles of smoke as they pass through the sensor inside the device itself. There is a good parallel here to what our software ‘news detector’ does (detecting small particles of news as they pass through the feed), so I thought it would be an interesting proof-of-concept to wire up a smoke alarm to the NewsWire and bring the virtual news stream into the physical world. As it turned out, this was fairly simple. All smoke detectors have a text button which sounds the alarm – you can see the bracket-shaped metal contact for the test button on our alarm above. What we ended up doing was wiring into the test contacts, then running these wires through a breadboard to a programmed Arduino, and from the Arduino via USB to my MacBook.

NewsAlarm: Process

I am not particularly skilled with electronics, so I asked my friend and colleague Dennis Rosenfeld to do most of the dirty work. Dennis has a wealth of electronics and software knowledge, as well as being a talented artist in various media. ‘Hacking’ the smoke detector took about 30 minutes all told, and in short order we had a device that was ready to be connected to my simple Processing App.

NewsAlarm: Process

In the photo above, you see a list of news items that have been broadcast over the NewsWire while the application has been running. As each of these news stories appears, they are checked against a filter. If the filter is matched, a signal is sent through the Arduino to the NewsAlarm, which sounds for about 1 second (this duration can be controlled in the Processing app, to produce a short chirp or a long alarm). A successful ‘hit’ also lights a small LED on the breadboard.

NewsAlarm - LEDs
Trapper John & The NewsAlarm

As you can see, it works! Our next step will be to put the components onto a small circuit board, and to implement a wireless relay so that the alarm doesn’t need to be connected to the computer via a cable.

Ultimately, I’d like to produce an array of these devices that can be installed as a sort of ‘News Alarm Centre’.

In the meantime, I have the news alarm running – queued up to sound if more than 50% of the NYTimes headlines contain the word ‘aliens’. You never know… right?

Share:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Reddit
  • StumbleUpon
  • Tumblr
Bookmark the permalink. Follow any comments here with the RSS feed for this post. Post a comment or leave a trackback: Trackback URL.

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

4 Comments

  1. Posted March 21, 2009 at 7:27 pm | Permalink

    While I applaud your ingenuity, I must raise the question as to whether it’s wise to use a smoke alarm as the alert signal.
    Smoke alarms have a distinctive, fairly-unique alarm sound that has so far been reserved for the event of smoke or fire. It is a well-recognized sound that requires little or no explanation in a home or office setting. Using this sound for another purpose diminishes its capacity to do its intended purpose effectively.
    Undoubtedly the number of news alerts that come in will be greater in frequency than the number of smoke or fire events. If you or your family get too accustomed to this sound signifying a non-life-threatening event, they will likely not recognize it when it is, in fact, trying to save their life. Even if it caused them to hesitate to respond for a very few minutes, that could be the difference between living and dying.
    Please, please reconsider using this sort of alert for your project.

  2. Jer
    Posted March 21, 2009 at 8:36 pm | Permalink

    Jim,

    This is an art project. It was never intended to be a device that is functional, or would be used in the real world. Quite frankly, you’d have to be insane to want an 85 dB alarm telling you when news has arrived.

    News agencies work very hard to foster anxiety surrounding the news – it’s a way for them to increase readership and advertising revenue. I wanted to embody this in a device which is quite literally alarming; an object that is associated with emergency and threat to one’s safety.

    Networks like FOX News would have us believe that news ‘alerts’ are just as important as a house on fire, but of course in real life they never are.

  3. Posted April 8, 2009 at 5:11 am | Permalink

    Hi Jer, just thought that I would take a look at your blog. This is quite ingenius. I understand the process but for me to instigate this would be way beyond me. I like the concept of making the news literally alarming!

    I love your studio! So clean and relaxing. A great space.

  4. Posted November 6, 2009 at 9:04 am | Permalink

    I loved your innovation about creating a new alarm and I must admit that it is really good. The problem lies in the use of the device, I am not sure, as where is it going to be used on a daily basis?
    Thank you for enlightening us on this very innovative device.

12 Trackbacks

  1. By NewsAlarm: smoke alarm meets NYT - SlashGear on March 20, 2009 at 7:28 am

    [...] it; for Jer Thorp, it’s a useful notifier whenever a key news story hits the wire.  Jer rigged up a smoke alarm to sound when a keyword-identified article appears, creating the incredibly annoying [...]

  2. [...] NewsAlarm – wiring in to the NYT NewsWire API Read more | Permalink | Comments | Read more articles in Computers | Digg this! Source: MAKE Magazine [...]

  3. [...] blrprnt blog: “NewsAlarm – wiring in to the NYT NewsWire API” [...]

  4. By trae1 (Trae Clevenger) on April 9, 2009 at 1:25 pm

    Twitter Comment


    newswire + fire alarm = NEWS ALARM! world’s loudest #mashup [link to post] #hack #api #bwimy

    – Posted using Chat Catcher

  5. By mtascon (mtascon) on April 10, 2009 at 8:10 am

    Twitter Comment


    Reinventan el timbre de los teletipos: [link to post]

    – Posted using Chat Catcher

  6. By bgerst (Ben Gerst) on April 10, 2009 at 2:30 pm

    Twitter Comment


    best newswire mash-up yet [link to post]

    – Posted using Chat Catcher

  7. [...] NewsAlarm – wiring in to the NYT NewsWire API [...]

  8. By guchagucha (Mark Thompson) on April 18, 2009 at 5:43 am

    Twitter Comment


    RT Fire alarm alerts you to catastrophic news, like alien invasions or Oprah’s last tweet [link to post] @katoshiko

    – Posted using Chat Catcher

  9. By jpwhite_mtl (Joshua White) on April 18, 2009 at 11:33 am

    Twitter Comment


    RT @katoshiko: NewsAlarm – wiring in to the NYT NewsWire API [link to post] from: @blprnt

    – Posted using Chat Catcher

  10. [...] Jer Thorp uses the NYT NewsWire API to control a smoke detector called the NewsAlarm [...]

  11. [...] month, I built NewsAlarm – a modified smoke alarm wired into the NYTimes NewsWire API. It can be configured to sound in [...]

  12. [...] site that I came recently, which is really relevant and interesting to my project, has an example called NewsAlarm that incorporates both Processing and Arduino. Taking the NewsWire API from the New York Times [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*