Wednesday, December 2, 2015

Posting to Twitter Part 2

Welcome to the second installment on how I automate my twitter posts.

Part 2: Decoding the pages
Sending the Fire/EMS pages to twitter  is similar to the CAD system.  I still use the TTYtter program, however another program is needed to create the mp3's.

I run Twotonedetect (http://www.twotonedetect.net/) which decodes the pages.  Currently I run it on a windows machine, however I would eventually like to migrate it over to a raspberrypi setup.

The system starts running at 7:15pm and shuts down at 5:59pm.  This allows the county to do their nightly pager tests and not flood my twitter account with useless pages.

TTD has a nice feature where after it decodes and creates the mp3, it will run a command.  This is where it calls my script that moves the file to the webserver, creates the link and posts to twitter.  The process is a bit different than the CAD posts, but the end result is the same.  The mp3's are kept for 7 days before being automatically deleted, so if you want to save the file, you have a week to do so before it is gone forever.

Part 3: So how did this all start anyway?
I'm not sure of the exact year, probably around 2007, we knew of a News/Fire notification service that sent out text pages on 900Mhz using the old text pagers.  I setup a decoder program called PDW (which would email you the decoded pages), along with an old Pro-2004 scanner with a discriminator tap and set out to find the frequency.  Few days later we found it and had it up and running and were sending pages to our phones.

That got old quick.  We had stuff coming in from NJ, PA, NY, CT and beyond.  I changed it to email it to my server and then I wrote a script to filter out only the things we wanted to see.  During this time, I learned more scripting than I had from the $3000 shell scripting course my company sent me to.

It wasn't long before I decided I didn't want to look at my phone every 10 minutes, so I set it up to send the pages to AOL IM via a program called centerim.  Eventually, AOL shut the account down thinking I was spamming and eventually we moved over to gtalk.  More people wanted in and eventually we had about 10 people on the system and the script ballooned to over 1000 lines of code, mainly for filtering.  It was ugly but it worked.

At the time, many of us were on the County TAMI system, but we only had access to a few departments.  The Warren County CAD one day showed up and after looking at it, I set out to add that to our system (the script for that hasn't changed much since).  Now we had access to everything.

Eventually, the 900Mhz Frequency went away and most people outside of the county dropped off.  It was at this time I got tired of seeing everything from the county on my IM, and started to filter by specific towns.  I still did want access to see everything in case I needed it.  I first experimented with RSS which worked but did not refresh automatically.  Eventually I went with twitter, where we are today.

Today we are at over 500 follows, many who do not have access to a police scanner, and now can keep up with what is happening around them.  In addition to twitter, IM has been replaced with a mobile app called Pushover.  There are about 10 user's who get alerted through it now (mostly Firefighters & OEM members).



That is the history of @WCAlerts and now @NorCoAlerts.



No comments:

Post a Comment