Video source http://www.ustream.tv/embed/recorded/19034432
One interesting aspect of the Occupy movement has been the widespread use of live streaming to document the camps, actions, and mobilizations in real time using computers, webcams, and cameraphones. On October 24th, I ran across the Occupy Streams site that provides a list of links to all of the livestreams run by Occupiers. I forwarded a link to the site to the general email list used by researchers at the Center for Civic Media:
>> On 10/24/2011 10:36 PM, Sasha Costanza-Chock wrote:
>> Someone make a map, with thumbnails, already 🙂
>> http://occupystreams.org/>>
>> schock
By the next morning, I found this reply in my inbox:
>> > On Tue, Oct 25, 2011 at 7:25 AM, Charlie DeTar wrote:
> ok.
> http://web.media.mit.edu/~cfd/occupystreamsmap/
> http://github.com/yourcelf/occupystreamsmap/
>> -charllie
Later, Charlie DeTar wrote a blog post describing the map that he created. Today, during the #OccupyData hackathon, CDT gave us a more detailed overview of the process he used to code the map. The video at the beginning of this post is a full recording of that overview, shot by Pablo Rey Mazon. Check it out!
Key Links
- Map: http://web.media.mit.edu/~cfd/occupystreamsmap/
- Post: http://civic.mit.edu/blog/cfd/occupy-streams-map
- Code: http://github.com/yourcelf/occupystreamsmap
- More info+ How to guide: http://brownbag.me:9001/p/occupystreamsmap
Content of http://brownbag.me:9001/p/occupystreamsmap
http://media.mit.edu/~cfd/occupystreamsmap
http://github.com/yourcelf/occupystreamsmapA simple little mapping hack to show occupy live streams.
Source: https://github.com/yourcelf/occupystreamsmap/blob/master/get_livestreams_and_names.py
1. Scraping: http://occupystreams.org/
Look for patterns.
Caching http requests during development.
Deduplicating.2. Geocoding
Google: https://code.google.com/apis/maps/documentation/javascript/usage.html
result = json.loads(get_cached_page(“https://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=%s” % urllib.quote_plus(locname.encode(‘utf8’))
))
Don’t be afraid to hard-code results.
if locname.startswith(“Wall Sreet”): # [sic]
locname = “Wall Street, NY”
elif “London” in locname:
locname = “London”
elif “Denver” in locname:
locname = “Denver”…
Source: https://github.com/yourcelf/occupystreamsmap/blob/master/index.html3. Mapping
Leaflet: http://leaflet.cloudmade.com
Removing overlaps
Alternatives: http://padmapper.com, http://olwidget.org/olwidget/v0.4/doc/examples/info_cluster.html
Simplest, dirty hack: just add intentional error.
while (overlaps[[lat, lng].join(” “)]) {
lng += 0.02;
}Popup generation — hackish javascript -> html
Mapquest OSM tiles: http://developer.mapquest.com/web/products/open/map
Construct icons for each point, with the livestream thumbnail.
I couldn’t find a thumbnail API for ustream. So I just used the ustream icon for those.
Live thumbnail updates for livestream: http://www.livestream.com/userguide/index.php?title=Live_Thumbnail_API
4. Geo-Search
Cloudmade API: http://developers.cloudmade.com/projects/show/geocoding-http-api
Automatically took first result.
Pros:
no tricky rules about displaying data on google maps from cloudmade.
Cons:
Some first results aren’t quite what you expect. Search for “Paris”.
To fix this issue, I tried contextualizing the result with the next-largest geographic entity, so when it was wrong, you’d at least know:
var names = [data.features[0].properties.name];
if (data.features[0].properties[“is_in:country”]) {
names.push(data.features[0].properties[“is_in:country”]);
} else if (data.features[0].properties[“is_in:continent”]) {
names.push(data.features[0].properties[“is_in:continent”]);
} else if (data.features[0].properties[“is_in”]) {
names.push(data.features[0].properties[“is_in”]);
}if (data.features[0].properties.population) {
names.push(“<br />Population: ” + data.features[0].properties.population);
}$(“.results”, “.search”).html(names.join(“, “));
Leave Your Response