blog | projects | resume
Filed under

madison

 

It started with this tweet.

Screen_shot_2012-01-02_at_5
... and then I found myself on the couch during New Year's Eve with a really bad movie. Laptop out...  in the wee hours of the New Year, I released a new web service for Madison. It provides a simple JSON wrapper around Madison's recently released data for parking availability on the isthmus. I added it to the list of services available in the SMSMyBus API.

http://smsmybus.com/api/v1/getparking

I was greeted in the morning by a lot of great feedback so I hooked it up to the SMSMyBus interfaces - SMS, xmpp and email - to create an app for it. For example, you can find the percentage of open spaces in downtown lots by texting 'parking' to the service...

Parking-app
... but what I really hope for, is that others take this and build something creative with it.

Although it's great to get so much positive feedback from the Madison community on these little projects, it's really (really) important to recognize that the work I've done with the API is going in the wrong direction in many ways. I'd rather be building the apps on top of services created by Madison. Eventually, this great city of ours needs to stop building websites and start producing the core feeds that I've done. That's the foundation. That is the government as a platform.

Filed under  //   gov2.0   madison   opengov   projects  

Comments [0]

Over a year ago, I smiled when I found SMSMyBus getting repurposed in the form of a kiosk at the Mother Fool's Coffeehouse.  I wrote then about the personal satisfaction of seeing a pet project growing into something bigger.

Well, last week, that satisfaction blossomed into gratification when I learned that the University of Wisconsin had included the SMSMyBus API in the latest version of their app released for the 2011 academic year. Now students using the app can get real time bus arrival estimates throughout the city rather than relying on the fixed schedule right from their iPhone and Android devices.

Super proud.

Mostly because this is exactly the kind of application that can get the attention of the Metro and the City of Madison as an example of what can be accomplished if more public data becomes accessible in an easy to consume (programmable APIs) interface.

Dear Mayor, please take note. We can achieve more, do so at a lower cost, and generate more economic development if we work together.

Filed under  //   gov2.0   madison   opengov   projects  

Comments [2]

A post on my Madison Transit API homebrew is long overdue. It was an incredibly fun project and when you see how it has enabled others, you realize how much more compelling it is then the simple SMS app I had originally created.

The API has been out for a long time, but there was very little usage early on. I'm not sure what sparked the flame but in the last few months or so there has been a lot of interest and lot of activity from developers. It dawned on me that I've yet to write about it. And that's a shame because the API is actually the most clever piece of the whole SMSMyBus effort. 

In the beginning

In the beginning, there was a very specific goal of creating an SMS app that delivered real-time arrival estimates. That was it. It was in response to my own need - as a commuter - for such an app. It was also going to be an entry into the Twilio developer contest that was run the week they released the SMS API publicly. 

I knew going in that the Metro didn't provide a formal API or even an XML feed, but I'd done enough HTML screen scraping before to know how to overcome it. Little did I know how tedious that would become with the Metro data. So what started out as a simple texting application turned into a day of cursing the poorly formatted HTML I found on my screen. And every minute of the way I could be heard asking the same question, "Why doesn't the Metro have an API?!?"

When I finished, I swore that I would never let anyone else suffer the pain that I endured so decided to abstract the work I did for the texting app and provide access to my data so other developers could get to the transit data through a standard web service interface. 

Why it's clever

The ugly work of screen scraping was now done and buried in the implementation of the SMS application. But by creating a couple of other web handlers, I could easily make the same scheduling data accessible via a web service call.

For example - http://www.smsmybus.com/api/v1/getarrivals?key=nomar&stopID=1101 - will return real-time arrival estimates for routes traveling through the stop at Main and Carrol on the square. That's the way every developer wants to query data from a web service.

With a little more scraping, I could also find the physical location of every stop (latitude and longitude) so developers could query the location of stops by a stop ID and could also query all nearby stops based on a lat/long coordinate. In the end, there was a pretty impressive looking transit API - simple to use and understand for new developers. And it didn't matter if it was ugly in its technique of screen scraping inside the implementation. It had a clean interface for the developers.

Supported API methods include...

getarrivals - Get real-time arrival estimates for any stop ID with the option of filtering by route ID.

getroutes - Get a list of every route in the Metro system.

getstops - Get the details for every stop a route travels through.

getnearbystops - Get the details for all stops within a given distance of a latitude/longitude.

getstoplocation - Get the location details for a stop given a sop ID.

getvehicles (not implemented) - Get details for a particular vehicle on the road.

getservicebulletins (not implemented) - Get a list of service bulletins in the Metro system.

Why I Built It

As I noted, a big reason for building the API was simply to save the next person the trouble of building up a new set of screen scraping tricks to get the data. But I also knew that most people that have attempted this have stopped at the schedule data. I don't know anything that has gone the extra step of getting the route and stop location data as well. 

More importantly, I wanted to find a way to contribute to the larger mission of opening up a public dataset to make it more accessible. Open data systems are important for lots of reasons, but most importantly, it allows communities to operate more efficiently. And nowhere is that more evident than in transit. Every city, state, and national government in the world should be on a path towards open data right now. 

Unfortunately, Madison has been slow to find its course. My dream was that by creating the API and recruiting some more developers to use it, we'd have enough applications to take back to the city to say, "Look! If you open more data, developers will do great things!"

I also did it for the intellectual challenging of build an API. I've been an API consumer for a long time, but had never constructed one myself. It's an exercise I encourage any API consumer to go through. You'll have a whole new perspective for what it takes to build, document and support an API.

Sample Applications

In theory, all of the original interfaces - SMS, google chat, email, and phone - could have been re-implemented using this API, but I didn't go back and do that. But lots of new apps have been built. For example, the bus kiosk displays hanging in a few local businesses use the API to visualize arrival estimates for nearby stops.

Larry Walker used the API to build a Chumby app and also used it to display arrival estimates on a small LED display on an Arduino. He also built a mobile browser app to more easily access arrival estimates. And I used the API to build a Google gadget so you can get scheduling data in the sidebar of gmail. The attached gallery shows off some of these examples.

Go get started building your own Madison transit app! http://www.smsmybus.com/api/

(download)

 

 

Filed under  //   appengine   madison   programming   projects   twilio  

Comments [6]

I spoke at TEDxMadtown in March, and it looks like they just posted the videos. In this talk, I reveal the great life lesson I learned in 2010 - giving back comes in all forms.

I think the only thing more nerve racking than getting up on a TEDx stage is watching yourself on a TEDx stage. :)

Filed under  //   madison   programming   projects  

Comments [5]

It was about this time a year ago that I built the Madison transit app that delivers real-time arrivals estimates for Metro buses via text messages. Little did I realize that it would turn into such a fun adventure.

I took a look at the logs for the past 52 weeks. Here's SMSMyBus by the numbers...

Total number of users : 138
Total number of requests : 2900
Number of unique stops requested : 318
Most popular stop requested : 1878, Jenifer & Ingersoll

Below is a histogram of the requests each week, and the shape is curious. I've never marketed the service so it's only traveled by word of mouth. The cold weather likely led to the recent jump but I can't explain the general lumpiness throughout.

Smsmybus-histogram

I also plotted all of the requests on a map using size to indicate the number of requests for each stop. If you're interested, you can explore the map more at http://smsmybus.com/labs/map

Smsmybus-map

Total cost to me? It was a little more than $75 - all of it going towards costs associated with the SMS messaging (Twilio). With the rising popularity, I'd love your donations. Just press the 'donate' button on the site. :)

 

Filed under  //   madison   programming   projects   twilio  

Comments [9]

If you're in Madison and listening to the social webisphere today, you can't help but notice the massive organization going on for a rally at the Capital later today to protest Gov. Walker's proposal to end collective bargaining rights for the majority of public employees in the state of Wisconsin.

I wonder what would happen if the governor - or any public official for that matter - stopped and tried to solve their hardest problems with the help of these same social media tools. Could the same level of organization seen with the protestors be achieved if the tools were used to organize a solution rather than a protest?

There are so many examples of Facebook, Twitter and other tools being used to raise awareness (see Egypt). But how about if everyone stopped picking sides and used the same mediums to propose solutions? 

 

Filed under  //   madison   observations  

Comments [0]

Filed under  //   madison   opengov   projects  

Comments [1]

This was the talk I gave at last night's PechaKucha in Madison prior to HTHH. It's the story of my epiphany relative to leverage my technical skills as a way to give back to my community.

 

Filed under  //   gov20   madison   opengov   programming   projects  

Comments [0]

Img_5409

I had a huge smile on my face this morning when I scrolled through my Twitter timeline and found @gl33p's pictures of the new display at Mother Fools Coffeehouse. Coffeehouse patrons are now enjoying real time arrival estimates for the Madison Metro buses passing by at the corner of Ingersoll and Jennifer courtesy of SMSMyBus!

It's amazing and gratifying to see this project come to life the way it has. And it reinforces the importance of doing rather than talking when a problem presents itself. You just never know where it will lead you.

A few months ago, Twilio ran a developer contest for their new SMS API. Having already built one Twilio app for blogging to Posterous, I was anxious to create another one and I immediately knew what I'd build with the SMS tools. 
 
I have long wanted a way to query the Madison Metro bus system to understand where my bus is when I'm standing in two feet of snow. I knew that Metro tracked their buses using GPS so I figured why not put that information in my hand using a mobile phone.
 
I was able to build the app in a weekend of hacking and SMSMyBus was born. I could query any bus and any bus stop in the city from my phone. My problem solved... But I quickly discovered that I wasn't alone. Several people around me were having the same problem and immediately started using the service as well. Feedback and bug reports came flying in and the number of users grew without an ounce of publicity outside of a few tweets. Today there are over thirty individuals using the service to make their bus experience better.
 
Since its initial release, I've added a number of other interfaces to extract scheduling data.... You can now receive real time arrival estimates via the phone, email, Twitter, and Google chat.
 
Through the prodding of my first user and biggest evangelist, Preston Austin, I was encouraged to build a truly platform agnostic interface and make the data available through a simple web service. Once made available, Preston championed the creation of the display at Mother Fools and implemented a terrific presentation layer that continuously refreshes throughout the day.
 
This has opened the doors for a number of different opportunities for partnerships throughout the city, and we're looking forward to expanding the number of displays to make the data more accessible and make riding the bus more enjoyable.
 
Do you have an itch? Have a problem that needs to be solved? Go solve it. You never know what it will turn into...

Filed under  //   appengine   gov2.0   madison   opengov   programming   projects   twilio  

Comments [7]

I biked to work with the Mayor of Madison today, and I wish I had a police escort with bagels at the end every day!

(download)

Filed under  //   madison  

Comments [2]