Live data from Hacker News

Twitter clients distribution in real-time

twitter-clients.herokuapp.com

11–16 of 16 posts

Re: Twitter clients distribution in real-time

#11
post #8

How did you get access to this data in real time?

It looks like your browser connects to the Twitter API.

Correct me if I'm wrong but wouldn't Same origin policy block that?

Edit: looking through the javascript, it seems that it pretty much just refreshes the page on a interval and the server gets the data from twitter

Re: Twitter clients distribution in real-time

#14

Neat, but the frequent updates make it hard to read anything other than the major apps.

I think the better solution would be to use 2 pie charts, in the first group all I think the suggestion to use a timeline series is not a good idea, pie charts are perfect for visualizing complementing percentages.

If you really want to visualize the movement of the percentages use a stacked percentage chart like this one:

http://www.highcharts.com/demo/area-stacked-percent

Ofcourse I would suggest 2 again, one for the big clients and one for the small ones :)

Re: Twitter clients distribution in real-time

#15
post #11
post #8

Earlier quoted context omitted.

It looks like your browser connects to the Twitter API.

Correct me if I'm wrong but wouldn't Same origin policy block that? Edit: looking through the javascript, it seems that it pretty much just refreshes the page on a interval and the server gets the data from twitter

I'm using a library I made in node.js (https://github.com/danzajdband/Tuiter) to retrieve the tweets server-side via the Twitter Streaming API (https://dev.twitter.com/docs/streaming-apis). Then I send the "Twitter client" to the client using Socket.IO. I'm refreshing the chart, not the entire site, every 500 ms = 1/2 seconds to update the chart.

I'm updating every 500ms and not every time I receive a tweet because of performance issues.

Thanks for the feedback.

Re: Twitter clients distribution in real-time

#16
post #11

Earlier quoted context omitted.

Correct me if I'm wrong but wouldn't Same origin policy block that? Edit: looking through the javascript, it seems that it pretty much just refreshes the page on a interval and the server gets the data from twitter

I'm using a library I made in node.js ( https://github.com/danzajdband/Tuiter ) to retrieve the tweets server-side via the Twitter Streaming API ( https://dev.twitter.com/docs/streaming-apis ). Then I send the "Twitter client" to the client using Socket.IO. I'm refreshing the chart, not the entire site, every 500 ms = 1/2 seconds to update the chart. I'm updating every 500ms and not every time I receive a tweet becau…

Very cool, I was unaware of the streaming API. Nice work!
Post reply on HN