Posts Tagged ‘HamOntFire’

Articles

BitBucket -> GitHub migration

In Uncategorized on October 9, 2013 by Matt Grande Tagged: , , ,

The Move

Many moons ago I started releasing some of my projects out into the wild. I used BitBucket, rather that GitHub, for a few reasons. One of the biggest ones was how frustrating Git was as a Windows user when I first tried it. Coming from SVN, Hg was a much gentler introduction to the world of DVCS (thanks in large part to Joel Spolsky’s HgInit).

Now, several years later, Git is as easy to use as anything else and GitHub has a much larger community that BitBucket.

The long and short of it is, if you want the latest version of anything I’ve done, check me out on GitHub.

Other News

HamOntFire is no longer working, due to Twitter removing v1 of their API in favour of the more secure (but less open) v1.1 API. I plan on upgrading the site, but I don’t currently have time or motivation. Hopefully sometime in early 2014.

I’m currently working on another project that mixes my three greatest loves: Ruby, Rugby, and statistics. That will be done in time for the Women’s Rugby World Cup in 2014. I have a (basic) design, a database full of results, and a stats calculator built; now I just need to put them all together.

Advertisements

Articles

HamOntFire – Visualizing @HFS_Incidents

In .Net,Hamilton on January 14, 2013 by Matt Grande Tagged: , , , , ,

Awhile back, I came across the @HFS_Incidents twitter account. It broadcasts all of the calls that Hamilton Fire Services responds to.

Being an Open Data guy, I was pretty happy to see this, but I thought Twitter wasn’t the best format. If I see an event, I might have no idea where it refers to. “0 Block GERTRUDE ST” isn’t helpful unless you already know where Gertrude Street is.  I also thought that this might be a good opportunity to get my hands dirty with Google Maps, Web Sockets, the Twitter API, and image generation.

The format of the tweets was pretty easy to parse, so I decided to throw together a few services and map the data out. And with that, HamOntFire was born.

At a high level, here’s what’s happening:

  • SuperWebSocket is constantly polling the Twitter API for new tweets
  • When new tweets are found…
    • I parse the data into an object (mostly to get the address into a Google-appropriate format)
    • I geocode the location using Google’s Geocoding API
    • I store the data in RavenDB
    • The event is pushed to the browser
  • The browser displays the tweets using Google Maps.

This was all fairly easy, with one exception: Both RavenDB and SuperWebSocket are dependent on Json.Net (Newtonsoft’s fantastic Json parser which has become the de facto standard), but each required very different versions (=4.0.8 and ≥4.5.4, respectively). After some research, I discovered that this was easy to take care of in .Net, thanks to binding redirects:

</pre>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.6.0.0" newVersion="4.0.8.0" />
 </dependentAssembly>
<pre>

This says “For any versions of Newtonsoft.Json between v0.0.0.0 and 4.6.0.0, just use version 4.0.8.0.”

Once that was taken care of, everything else was a piece of cake.

You can check out the site for yourself here, and check out the code on GitHub here.

Post Script: I’m also trying to come up with other statistics to display on the Stats page. If you can think of any, please let me know!