Skip to content

A multi-platform and real-time social media aggregation framework.

License

Notifications You must be signed in to change notification settings

amyzlc/downstream

 
 

Repository files navigation

Downstream · npm version GitHub license PRs Welcome

Downstream is a multi-platform and real-time social media aggregation framework.

Installation

Downstream is released as a Node.js package on the npm registry.

Node.js 12.9 or higher is required to use Downstream in your project.

To install Downstream for your project, run the below command from your terminal:

npm install downstream

Usage

1. Downstream aggregates data via Channels.

  • Built-in Channels aggregate posts from platforms like Facebook, Instagram, or Twitter.
  • Create your own Channels to easily aggregate data from other platforms and sources.
  • Use a WebChannel to expose Downstream on your local network or string multiple Downstream instances together via a simple HTTP interface.
// channels.js

const { builtin } = require('downstream');
const { TwitterStreamChannel } = builtin;

const credentials = {
    consumerKey: process.env.TWITTER_CONSUMER_KEY,
    consumerSecret: process.env.TWITTER_CONSUMER_SECRET,
}

const twitterChannel = new TwitterStreamChannel({ credentials });

module.exports = { twitterChannel };

2. Access and mutate your aggregated data via hooks.

// hooks.js

async function logHook(post, next) {
  console.log(post);
  await next();
}

module.exports = { logHook };

3. Initialize and start a new Downstream instance.

// main.js

const { Downstream } = require('downstream');
const { twitterChannel } = require('./channels');
const { logHook } = require('./hooks');

const downstream = new Downstream();

// register Channels
downstream.register(twitterChannel);

// use hooks
downstream.use(logHook);

// log any errors
downstream.on('error', console.log);

downstream.start();

Documentation

Our detailed API documentation is available in the docs/ folder.

Examples

Several examples are available in the examples/ folder.

Contributing

See our Contributing Guidelines for details. We welcome outside contributions!

People

Downstream is actively built and maintained by the Technologies & International Development (T+ID) Lab at Georgia Tech to support the Aggie platform and other research initiatives.

This project would not be possible without the amazing work done by the original contributors to the Aggie platform whose work on the original backend for Aggie inspired the idea and architecture behind Downstream. Thank you.

License

GNU GPLv3

About

A multi-platform and real-time social media aggregation framework.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%