Skip to content

badgerherald/mifflin-revelry-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Badger Herald Mifflin-Revelry Dashboard

The node.js app that ran the Mifflin-Revelry Dashboard app.

How it works

In the backend, it uses ntwitter to listen to a public stream of tweets for a list of Mifflin- and Revelry-related search terms and save them in a MongoDB database. In the frontend, it runs a dashboard that connects to the backend and streams tweets with Socket.IO.

Modules

The code is (somewhat arbitrarily -- see below) divided into a series of smaller modules inside lib/:

  1. auth/: Exports Twitter authentication information. Structure like index.js.template.
  2. common/: Exports objects and functions used in multiple places: The MongoDB collection, the keyword trackers, and the emit_tweet function used to send tweets to the client.
  3. listen/: Exports the track function for sending the recent tweet history to clients. This is the main communication from the client to the server -- hence, the server "listens". track takes a socket.io object and a list of trackers as arguments.
  4. stream/: Exports new_stream, the function for opening a connection with the Twitter streaming API and emitting them as tweets to the client. new_stream takes a socket.io object as its argument.
  5. update_herald/: Exports a function that adds functionality to GET a custom XML file of Herald articles about Mifflin on the /update_herald endpoint to an Express app given as an argument.

NOTE: This code is the result of a code rush. For posterity's sake, the unpolished code is here.

About

Code for running streaming dashboards.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published