- One 256MB instance on Rackspace Cloud (spare one I had laying around)
- Apache webserver
- PHP to render webpage (largely unnecessary, I don't think there's anything but straight HTML markup anyway)
- Orbited [1] for browser TCP socket emulation (runs using Python on top of Twisted). This piece handles the communication between browsers and the message broadcast server in the backend.
- Node.js to create the aforementioned message broadcast server. Each browser subscribes to "channels" and for each new message being sent to that channel the server broadcasts it to each subscriber (browser). I wrote this code for a previous project and just used it as a drop-in piece unmodified.
- Javascript in the client (browser) to interpret incoming messages from the backend server and render them on the screen and add markers on the map. I left the code unminified, so feel free to explore it.
APIs:
- Twitter Streaming API [2] using the "filter" stream searching for "4sq" (each tweet contains a link to 4sq.com). I have two PHP processes running to handle this stream. One consumes the stream (using the Phirehose library [3]) and puts each tweet on a SysV message queue to be picked up by the second PHP script. The second script polls on the message queue and then parses and processes each tweet. After preparing the tweet data for the browser, it sends it over a local TCP socket to the Node.js message broadcast server on a "control" socket separate from the listener sockets.
- Foursquare Image "API" to serve the different badge and mayor images. I basically just reverse engineered the badge-to-image mapping.
- Google Maps API. I just copied and pasted some code from the v2 API that I had written a few years ago. It still works even though the current version is v3.
An ideal visualisation would be to show the activity as blips on a Google Map.