Traffic Cam Proof Of Concept
Selecting a camera set.
Selecting a camera from the list...
And viewing the image.
Newest Version
New: Due to the amount of interest in the TrafficCam application, there is now a TrafficCam wiki page, so that people can organize their efforts better without it neededing to go through my inbox. If you have a request for cameras somewhere, that might be the best place to put it so that others can see it.
With feedback from the community, I'm proud to announce the third revision ofthe Traffic Webcam script. This is a complete rewrite of the core of the application, and should be treated as a seperate application for all intents and purposes.
The latest version, rather than storing URLs inside the .py file, loads them dynamically from the web. This means that when loading, the application may take a while to load the menus. You have an option of three built in citys, or the ability to select your own via the "Other..." option.
Image mappings for Dubai were provided by Tarek. London was provided by JimH. Houston and San Antonio were provided by Kashif Khan. San Francisco was provided by miker, on #mobitopia. Devon was provided by Alasdair Allan. Sydney was provided by Dean Maslic. Seattle was provided by Erik Thauvin. Italy was provided by Luca. New York was provided by the author.
For information on the format used for these files, see format documentation.
Older Verisons
In response to rapid Flash development, I'm proving the concept of rapid Python development. This first version was created and functional in 45 minutes.
It was also developed completely without a phone.
To install, simply download the traffic.py file and send it to your Series 60 phone with Python installed. Install it as a script, open Python, and select my\traffic.py from the list.
Version 2 Source - Additional 35 minutes of development to add tabs, one for each burough
Following my development of the Version 2, JimH created a version for London over his lunch break, proving yet again that Python enables rapid development. His code is available from his site.
import appuifw import urllib import e32 class App: def __init__(self): self.manhattan_cams = { '10':u'2 Ave @ 125 Street', '07':u'5 Ave @ 23 Street', '08':u'5 Ave @ 49 Street', '12':u'6 Ave @ 42 Street', '10':u'6 Ave @ 49 Street', '66':u'7 Ave @ 125 Street', '68':u'7 Ave @ 145 Street', '19':u'8 Ave @ 34 Street', '20':u'8 Ave @ 42 Street', '17':u'9 Ave @ 34 Street', '31':u'11 Ave @ 42 Street', '67':u'Amsterdam Ave @ 181 St', '65':u'Broadway @ 169 St', '02':u'Church Street @ Vesey', '15':u'E 57 Street @ QBB (btwn 1 & 2 Ave)', '16':u'E 63 Street @ QBB (btwn 1 & 2 Ave)', '23':u'FDR Dr @ 36 Street', '24':u'FDR Dr @ 78 Street', '25':u'FDR Dr @ 96 Street', '27':u'FDR @ 135 St', '74':u'FDR @ 155 St', '64':u'FDR @ Old Slip', '01':u'Riverside Dr @ 135 St - H Hudson Pkwy', '28':u'Riverside Dr @ 153 St - H Hudson Pkwy', '50':u'West St @ Canal St', '71':u'West St @ Murray St' } self.lock = e32.Ao_lock() self.old_exit_key = appuifw.app.exit_key_handler appuifw.app.exit_key_handler = self.exit_handler self.display_list() self.lock.wait() def exit_handler(self): self.lock.signal() def display_list(self): appuifw.app.body = appuifw.Listbox(self.manhattan_cams.values(), self.load) def load(self): try: id = appuifw.app.body.current() k = self.manhattan_cams.keys() url = "http://207.251.86.248/cctv%i.jpg"%int(k[id]) urllib.urlretrieve(url, "C:\\traffic.jpg") content_handler = appuifw.Content_handler() content_handler.open("C:\\traffic.jpg") except IOError: appuifw.note(u"Could not fetch the image.",'info') except Exception, E: appuifw.note(u"Could not open the data, %s"%E,'info') A = App()