Reddit Insight, dropstore-ng

15 Jul 2013 | By Alex Young | Tags node mongodb express apps AngularJS

Reddit Insight

Reddit Insight

Patrick Stapleton sent in Reddit Insight (GitHub: gdi2290 / RedditInsight, License: MIT), a project for tracking and visualising statistics about reddit. It can track posts, users, and display interactive charts for words and topics. There’s also a frequency analysis of nouns, and a graph for comments per-post and average karma per-post.

If you want to install it, check the code out from GitHub and install the Node dependencies:

git clone https://github.com/gdi2290/RedditInsight.git
cd RedditInsight
npm install

If you don’t have nodemon installed you can install that too – the authors use it to automatically reload the code when server-side code changes:

npm install -g nodemon
npm start

I haven’t yet figured out where they got the data from – the post and user trackers call reddit’s APIs, but the clusters have locally cached JSON files.

dropstore-ng

dropstore-ng

More AngularJS bindings! dropstore-ng by Jason Kulatunga is a wrapper around Dropbox Datastore. Dropbox’s API has bindings for iOS, Android, and JavaScript – this library allows you to fit it into an AngularJS-style workflow. You can DI it, authenticate with Dropbox, then add datastore items to the current $scope:

...
.then(function(datastore){
  var taskTable = datastore.getTable('tasks');
  $scope.tasks =  taskTable.query();
});

And display them as you might expect:

<ul>
  <li ng-repeat="task in tasks">
    
  </li>
</ul>

I haven’t yet used the Dropbox Datastore API, but this looks like idiomatic AngularJS to me. There are no directives as far as I can see, but I can’t think of any that would make sense…


blog comments powered by Disqus