1

I want to gain experience using cubism.js

I found this dataset nyc real-time traffic I want to graph.

I need some tips on how to get this done. I know I can use python to query the txt file every N minutes. I would then store the last M minutes of traffic data server-side. When the user visits the site, the server will serve the last M minutes of data. But then what? The client queries the server via cubism.js? or does the server push updates to the user?

I've read through the cubism.js wiki but there aren't any examples on how to do this without cube or graphite.

Also, this would be my first project since my jsp days, so any tips on that front are welcome as well.

Harry Moreno
  • 10,231
  • 7
  • 64
  • 116
  • I don't know the answer but just as a general idea, having a site that relies on scraped data is never a good idea. All the other person has to do is figure a way to block you and your site will be over. – Lostsoul Apr 26 '12 at 03:49
  • oh no lostsoul, it's meant to be used https://nycopendata.socrata.com/Transportation/Real-Time-Traffic-Speed-Data/xsat-x5sa sucks they don't provide is as an api though – Harry Moreno Apr 26 '12 at 04:26

1 Answers1

1

You would create a new cubism context that knows how to get ranges of the data. It could either re-get and parse the file each time or it could have some sort of in-memory database.

Another option is to have a separate process pull the data and put it into Graphite. Then you can use the built-in Graphite backend.

Dave
  • 13,518
  • 7
  • 42
  • 51