Calling Scrabbled programmers
I’ve got a coding inquiry for you..
So I’m on the data team at the Star-Ledger and part of what I’m supposed to be doing here is creating data viz apps for the web. I’ve got a project I could use some help with, if y’all could lend your collective expertise…
Since snow stories tend to be king for web traffic, I wanted to create an interactive map for snowstorms.
I want to fashion it off of what this guy did: http://uksnowmap.com/
Here’s it in action: http://www.youtube.com/watch?v=Q2RKqfGve_0
What I’m wondering is how you would set up a script (presumbly in Java) to pull in live tweet data. Is that something you’ve ever worked with?
There’s more to it than that, such as having icons disappear after a certain time period and factoring in the intensity to how the icon displays, but I’m just trying to start with the basics. I’ll likely tweak his idea and make it my own anyways. Any thoughts on those aspects are welcome too.
I’m very much still a novice at all this, but I want to give myself a project that’s more ambitious than my current skill set.
Ideally, I’d be able to do this in Google Maps (as he has) and iFrame it into our site. Any thoughts?
Comments
Java is most certainly not the way to go. Most likely you’d be building this entirely with javascript (which, despite the name similarity, is a completely different language in every respect). You’d poll twitter’s API every however many seconds (the video you linked is likely too fast and you’ll get blocked by twitter right quick) via JS and have another part of the JS update the DOM — either via an overlay on top of the map block, or within the map block itself (I believe maps has its own API for interacting with it).
This is definitely not beginner stuff, though. I’d start with simply reading up on how to access the Twitter API via javascript AJAX calls and try writing a small script that simply spits out tweets. From there, try adding in tweet filtering (e.g., looking for the word “snow”). Seperately, I’d build another little page to start playing with the Google maps API and using JS to interact with the map and edit it in real time. Then it’s on you to figure out how to get those pages working together.
Also, you may want to look into jQuery as there’s a good chance these APIs have been cleaned up a bit for use with the framework. Makes writing javascript a little easier and a little more cross-browser compatible.
Absolutely. I’ll be working with the rest of my team on this, so I’m not in the woods alone.
But yeah, certainly a lot of individual issues to address. I think we’re going to put it on bitbucket to collab privately and maybe open source it on github once we’re closer. I’ll pass along any troubleshooting or tangible progress as we go.
In case you guys are interested.. Slowly but surely, we’re actually getting this done.
It’s almost certainly not the best or smartest way to accomplish this, but here’s what we’ve done so far
- We used a Python script to scrape Twitter under a certain hashtag and parse the data from the Tweet we needed
- That gets dumped into a PostGres database
- We used PHP to pull out the data and display it on a map.
- Developed a search function to display all Tweets from a certain zip on a side rail.
Here’s what it looks like (mind the aesthetics)
http://imgur.com/7RXKk
In the next week we’re hoping to add:
- map key, explainer
- a click listener so if you click on an icon it automatically displays all the Tweets in the side rail.
a graph that shows the average intensity of precipitation, as stated by Tweeters, throughout a given storm.
A work in progress to be sure, but at least one that IS progressing. Thanks for your guidance when i was clueless.