- Clone this repository to your computer
git clone https://github.com/TID-Lab/downstream
cd
into the example folder you want to run- Run
npm install
in the folder to install example dependencies - Set the necessary environment variables, if required.
- Run
node index.js
in the folder to run the example
1. Basic
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 tokenINSTAGRAM_DASHBOARD_TOKEN
- a CrowdTangle Instagram dashboard tokenTWITTER_CONSUMER_KEY
- a Twitter v2 API consumer keyTWITTER_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 keyTWITTER_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