De-Coder’s Ring

Software doesn’t have to be hard

Month: April 2013

Area of Interest: Boston Marathon

If you read yesterday’s post, you can see I was trying to dig into the open intelligence available on the Internet.
Today, an article showed up on Hacker News (What happens when you give 4chan images of the Boston Marathon? http://basedheisenberg.tumblr.com/post/48181500129/what-happens-when-you-give-4chan-images-of-the-boston)

The area of interest is around those flags. I reran my script this morning, with a little more output, and sure enough, there’s at least one focused on those flags. I dont see anything in there, but maybe you do?

RIMACTSOFTWARE http://www.flickr.com/photos/39549208@N07/8652878659/in/photostream/

RIMACTSOFTWARE
http://www.flickr.com/photos/39549208@N07/8652878659/in/photostream/

All rights go to: http://www.flickr.com/photos/39549208@N07/8652878659/in/photostream/

Timeline: Boston Marathon 2013 Bombing

On April 13th, I ran the Monument 10k in Richmond, VA. It’s a great, fun race, that bring about 35-40k people to the famed Monument Avenue. Bands, costumes and a ton of runners. This is my second time running, and as usual, this type of atmosphere is the most positive and supportive place on earth. I’ve been to many races, some I’ve run in, some I’ve cheered friends and family on, but it’s always the most uplifting environment you can be in. If you aren’t a runner, get out there, work on it, get to events like this. Bring your kids, show them the positive sides of exercise.

On April 15th, the unthinkable happened. Some whacko decided to place a few explosives near the finish line of the Boston Marathon. It’s another senseless act of violence, that can never be explained. It hit home, due to the type of environment, and how recently I had been in a very similar situation.

Every day, I live network security, network surveillance and data extraction. I was curious to how I could ‘help’ in a situation like this, as part of the global group of good guy coders. This post isn’t going to be anything new, or novel, but it was a quick way for me to get some photos of the area that the bomb occurred, and out of curiosity, see if there were any clear shots in the time around the event. More may come , depending on how much I can dig into this problem (and potential tool to help solve it), but here’s a quick script to do some flickr API searches around a geo-coordinate, over a time range, sort them in chronological order, and have a little time series on the events of the day.

Pretty straight forward process:
search_pics = {}
searchURL = 'http://api.flickr.com/services/rest/'
search_pics['method']='flickr.photos.search'
search_pics['api_key']='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
search_pics['format']='json'
search_pics['nojsoncallback']='1'
search_pics['min_taken_date']='1366005600'
search_pics['max_taken_date']='1366052400'
search_pics['lat']='42.349778'
search_pics['lon']='-71.078917'
search_pics['has_geo']='1'
search_pics['safe_search']='3'
search_pics['radius']='.50'
search_pics['radius_units']='mi'
search_pics['per_page']='300'
search_response = requests.get(searchURL,params=search_pics)
print search_response.status_code
parsed_search_response = search_response.json()

Set up some search parameters. Time bound on ‘taken date’ of each photo. Lat/Long coordinates were pulled from the wikipedia article on the bombings. Safe search is set to 3 (basically, off), radius of one half mile, and I want as many results as I can get. Pagination and going past 300 records isn’t build, since I didn’t get that many results yet. I’m going to continue to run this over time to see if more photos are uploaded, and to fill into my time series.

Then, for each photo, I need the timestamp, and since I like UTC Epochs, I build it from the flickr.photos.getInfo end point:

photos = parsed_search_response['photos']
for photo in photos['photo']:
photo_info_url = 'http://api.flickr.com/services/rest/'
photo_info_parms = {}
photo_info_parms['api_key']='xxxxxxxxxxxxxxxxxxxxxxxxxxx'
photo_info_parms['method'] = 'flickr.photos.getInfo'
photo_info_parms['format']='json'
photo_info_parms['nojsoncallback']='1'
photo_info_parms['photo_id']=photo['id']
photo_info_parms['secret']=photo['secret']

photoinfo = requests.get(photo_info_url,params=photo_info_parms)
photod = photoinfo.json()
dttm = photod['photo']['dates']['taken']
mysql_time_struct = time.strptime(dttm, '%Y-%m-%d %H:%M:%S')
ts = calendar.timegm(mysql_time_struct)
print ts

Then, I write the picture data to a file on disk, with a file name in the format of (timestamp_id_secret.jpg)
photo_url = 'http://farm%s.staticflickr.com/%s/%s_%s_b.jpg' % ( photo['farm'], photo['server'], photo['id'],photo['secret'])
r = requests.get(photo_url)
with open("./downloadedfiles/%d_%s_%s.jpg"%(ts, photo['id'],photo['secret']), "wb") as code:
code.write(r.content)

The result is a big list of pictures, and it’s almost like a slideshow of the area. I have ideas on how to make this better, but for now, it’s a start.

slideshow photots of boston marathon

slideshow photots of boston marathon

© 2017 De-Coder’s Ring

Theme by Anders NorenUp ↑