{"id":34,"date":"2005-02-20T05:42:21","date_gmt":"2005-02-20T10:42:21","guid":{"rendered":"http:\/\/crschmidt.net\/blog\/?p=34"},"modified":"2005-02-20T05:42:21","modified_gmt":"2005-02-20T10:42:21","slug":"trafficcam-version-3","status":"publish","type":"post","link":"https:\/\/crschmidt.net\/blog\/archives\/34\/trafficcam-version-3\/","title":{"rendered":"TrafficCam, Version 3"},"content":{"rendered":"<p>Apparently, when the TrafficCam flash program was released, Justin was opening a can of worms that was bigger than I could have imagined.<\/p>\n<p>After my example of quick development on the Python app, I got a lot of interest in my own <a href=\"http:\/\/crschmidt.net\/symbian\/traffic\/\">TrafficCam<\/a> application. Suddenly, there was a London version. And a Dubai version. And every time I mentioned it, someone else wanted to create their own version and load it in so that they could use the same nifty features. If there&#8217;s one thing that I do right, it&#8217;s listen to what my users are telling me. So, this afternoon, upon the arrival about my new Nokia 6600, I got to work.<\/p>\n<p>First step: Build a file loader. This function should take a file of predefined format and read it in over the web, letting you specify some parameters to the program. This data should then be returned in a way that the application can use. We can&#8217;t make the file format too complex: the default Python install comes with no XML support, remember, so we&#8217;re using a very basic, tab delimited layout for this. The format is pretty simple: It&#8217;s described in the <a href=\"http:\/\/crschmidt.net\/symbian\/traffic\/format\">TrafficCam Format Documentation<\/a>, for those of you who may want to use it.<\/p>\n<p>Step two: Build the app around the data. Given a specific URL, construct the entire application setup, from the tabs to the title to listings, from that returned data. Not too hard: required a little bit of changing how I did things so that it could be reloaded easily, but as always, Python was cooperative.<\/p>\n<p>Step Three: Build a frontend to choosing URLs to load data from. Store a title an a URI, and let people choose which to load. Not too bad: using the popup_menu that symbian provides, can easily associate the resulting choice with your earlier list.<\/p>\n<p>Step Four: Add support for reloading. Once I&#8217;m done with one set of cameras, I want to view another without having to exit and restart. This is a bit more complex: it requires me to move some of the logic around so that the application flow stays mostly the same. In the end, I ended up cleaning up some ugly repetition of the code this way, which was useful.<\/p>\n<p>Step Five: Make it more user friendly. Add an &#8220;Other&#8221; for choosing their own URLs, add progress meters and information boxes, put in exception support for when a URI doesn&#8217;t load correctly, and in general, make the app work better.<\/p>\n<p>All in all, I spent six hours yesterday working on the application, and basically rewrote it from top to bottom. It&#8217;s now easy to use, and extendable to do whatever people want. I can admit that it&#8217;s probably the single most user-friendly application I&#8217;ve ever written: almost all my work in the past has been command line based, but this is truly a cool application.<\/p>\n<p>If you have a phone which supports Python, I highly recommend this application. Although I&#8217;m sure there are better apps out there, this one is my personal favorite: lets you get a glimpse of the world through your phone. Of course, you should be aware that this is not a low bandwidth application: the camera listings are only about 3-4k apiece, but each camera image can be anywhere from 10-15k, sometimes more depending on the cameras you&#8217;re using. Yesterday, while doing development, I used up a megabyte of GPRS bandwidth &#8211; luckily, I have unlimited GPRS through my provider.<\/p>\n<p>If you live in an area where there are traffic cameras, and you&#8217;d like to see them added, simply construct a file according to the format documentation, and drop me a line.<\/p>\n<p>Have I mentioned lately that I love Python?<\/p>\n<p>Now, to get working on that contact database export I had in mind&#8230; <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apparently, when the TrafficCam flash program was released, Justin was opening a can of worms that was bigger than I could have imagined. After my example of quick development on the Python app, I got a lot of interest in my own TrafficCam application. Suddenly, there was a London version. And a Dubai version. And [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,10],"tags":[],"class_list":["post-34","post","type-post","status-publish","format-standard","hentry","category-python","category-symbian-python"],"_links":{"self":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":0,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"wp:attachment":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}