Skip to content

Latest commit

 

History

History

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Examples

Running an example

  1. Clone this repository to your computer
git clone https://github.com/TID-Lab/downstream
  1. cd into the example folder you want to run
  2. Run npm install in the folder to install example dependencies
  3. Set the necessary environment variables, if required.
  4. Run node index.js in the folder to run the example

Logs each item from a Channel to the console.

This example demonstrates:

  • Writing your first Hook
  • Registering your first Channel
  • Running Downstream for the first time

Uses every built-in Channel available to aggregate social media posts about dogs across Facebook, Instagram, and Twitter.

This example demonstrates:

  • Using the built-in Channels for Facebook, Instagram, and Twitter

To run this example, you'll need to set the following environment variables to securely pass in API keys and secrets:

  • FACEBOOK_DASHBOARD_TOKEN - a CrowdTangle Facebook dashboard token
  • INSTAGRAM_DASHBOARD_TOKEN - a CrowdTangle Instagram dashboard token
  • TWITTER_CONSUMER_KEY - a Twitter v2 API consumer key
  • TWITTER_CONSUMER_SECRET- a Twitter v2 API consumer secret

If you do not possess any of the secrets or keys listed above, you can simply comment out the corresponding channel, as well as the line that registers it with Downstream.

Uses a custom Channel to aggregate data from a custom fruit API.

This example demonstrates:

  • Writing your own Channel
  • Aggregating data from your own Channel

Annotates the sentences of each item with their language.

This example demonstrates:

  • Using multiple hooks
  • Mutating items in your hook
  • Writing your own Channel

An example that saves tweets about cats to your local MongoDB database.

This example demonstrates:

  • Saving aggregated data to a database

To run this example, you'll need to set the following environment variables to securely pass in API keys and secrets:

  • TWITTER_CONSUMER_KEY - a Twitter v2 API consumer key
  • TWITTER_CONSUMER_SECRET- a Twitter v2 API consumer secret

An example that demonstrates how a WebChannel might be used to connect two Downstream instances together.

This example demonstrates:

  • Using a WebChannel
  • Linking two Downstream instances together