Crowley Code! 
 (Take 12)

Where's my car? 2008/05/16

I have a car and park on the street in San Francisco.  This guarantees me a large quantity of parking tickets and hurried mornings racing the clock to move my car before the ticket arrives.  No more!

Where's my car? keeps track of where your car is parked and sends email and SMS alerts when you need to move it for street cleaning.  It works from your phone or web browser.  It will save you money.

Yes, this is San Francisco only right now.

This is magical, tell me more

The world is powered by screen scraping and this is no exception.  I'm posting and scraping several pages in San Francisco's GIS website.  It's a scary and ill-advised activity but it was worth it.

Because the geoscraping is a pretty slow process, it is handled asynchronously.  The first step is posting the address you enter, which is just a street number and street name, to SF GIS's "geocoder." Whatever.  I feel compelled to write it "geocoder" because the numbers returned are not even a little bit like latitude/longitude.  Well, they're numbers but there end the similarities.

After these magic numbers are found, I post again to scrape out the parking data, doing some assuming to remind the computer what side of the street you're on.  The update form reminds you not to choose the corner address of any block because, despite my best efforts, SF GIS disobeys sometimes at the corner and returns parking data for the cross street.  Sorry.

The last step is deciding when the next street cleaning will take place, to setup email and SMS alerts.  After much trial and error, I found all of the quirks in their expression of the street cleaning schedule and proceeded to walk around the calendar to find the next one.  The algorithm goes like this: decide from the list of calendar days in the SF GIS text which comes next, then take that day and the time immediately following it to create a timestamp.

Timestamp?  But you're only using the day part?

That's right but who knows what the future holds.  Alerts one hour before might be nice and since I've already got a real timestamp, very easy.

There are tons of other possibliities, too.  From showing a map tile of your car's location for the spatially-challenged to a bona-fide API (mostly so I can play with OAuth from the provider side) for, you know, both of the things you can do on this site.

PS: When you see street cleaning data that is inaccurate, please click the "Report as inaccurate" link.  It emails me directly so I can go to the GIS and figure out what went wrong.  I've not exhaustively tested it across the city.  It does work well in the Marina and the Mission.

Comments (6)

  1. That's awesome.  Before I had a garage this definitely would have been a huge help.

    Why is the post tagged 'oauth'?

    Marc Hedlund — 2008/05/17 6:48 am

  2. Dude, where's my car?

    Where's you car, dude?

    Myles — 2008/05/17 6:55 am

  3. @Marc: for the future.

    Richard Crowley — 2008/05/17 7:20 am

  4. Brilliant.

    Sam Quigley — 2008/05/17 1:08 pm

  5. this is brilliant!  almost makes me want to have a car again. can I invest?

    halle — 2008/06/05 4:23 pm

  6. [...  Richard Crowley’s “Where’s My Car” Application [...]

    sarahcpr » Blog Archive » Hyperlocal iPhone App — 2008/06/05 6:13 pm

Richard Crowley?  Kentuckian engineer who cooks and eats in between bicycling and beering.

I blog mostly about programming and databases.  Browse by month or tag.

To blame for...

© 2009 Richard Crowley.  Managed by Bashpress.