Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: I just made 4sqvision at SuperHappyDevHouse (jazzychad.com)
29 points by jazzychad on April 11, 2010 | hide | past | favorite | 10 comments



Interesting concept, but it would be more useful if I could limit it to my city. Without a local context, it is mostly noise and no signal.

An ideal visualisation would be to show the activity as blips on a Google Map.


yeah, working on adding a map now

EDIT: Added map. Not every tweet has coords, but a good portion of them do.


What's the vibe right now? SHDH goes til midnight... Should I consider heading down from SF, or will it be petering out by that time?


Come down now! Easy parking nearby, or if you're taking transit I can get you a ride home.


It goes till midnight, and there are a bunch of ppl here now...


Can you summarize the tech you're using to build the site?


Sure!

Server/Client stuff:

    - 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.
    
[1] http://orbited.org/

[2] http://apiwiki.twitter.com/Streaming-API-Documentation

[3] http://code.google.com/p/phirehose/


Funny watching the stream. Somebody just checked into a Walmart in CO.


Keep up the good work! Your apps per unit time rate still astounds me.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: