A simple example of a Tumblr trending wall
CSS JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
data
lib
public
scripts
views
.gitignore
README.md
app.js
config.json
package.json
stream.csdl

README.md

Simple Tumblr Trending Wall

This code demonstrates a very simple trending wall for fashion brands on Tumblr, by consuming a DataSift stream.

The application relies heavily on two excellent libraries to do the heavy lifting:

Tumblr is a great data source for measuring engagement with products and brands. In this case I've chosen fashion brands, and the number of reblogs their original content generates.

Pre-Requisites

  • A local (or accessible) Redis server
  • Node.js installed
  • A DataSift account (if you register you get some free credit to play with!)

Running the Application

  • Make sure you have the Tumblr data source activated in you DataSift account
  • Clone the repository to your machine
  • Run npm install, to install node packages
  • Run node scripts/generate-csdl.js data/brands.csv to generate the CSDL definition to stream.csdl.
  • Copy the contents of stream.csdl into a new DataSift stream. Save the stream, and make a note of the resulting stream hash.
  • Create a config.json file in the project root
{
    "port": "[port to run a local webserver, e.g. 8000]",
    "datasift": {
        "username": "[your DataSift user name]",
        "apikey": "[your DataSift API key]",
        "stream": "[stream hash from above]"
    },
    "store":
    {
        "prefix": "[prefix for keys in Redis, e.g. wall1]",
        "host": "[redis server address, e.g. 127.0.0.1]",
        "port": [redis port, e.g. 6379]
    },
    "publishing":
    {
        "interval": [in milliseconds the time between pushes of results to the front-end, e.g. 5000]
    }
}
  • Check your Redis server is running
  • Run node app.js
  • Open your browser to http://localhost:8000 (or whatever port you specified)