A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pusher-community/pusher-datasource-api below:

pusher-community/pusher-datasource-api: An API for streaming data in real time through Pusher channels.

A service that lets users search the Twitter stream for search terms using Pusher.

Using the Pusher JS library, the client should subscribe to a channel name, where the channel name is the search term. Because of restrictions on Pusher channel names, this name should be Base64 encoded:

// Client
var pusher = new Pusher(YOUR_APP_KEY);
var channelName = 'javascript';
var channel = pusher.subscribe(btoa(channelName));

channel.bind('new_tweet', function(data) {
  console.log('got tweet', data.tweet);
  console.log('matched search term', data.searchTerm);
});

You'll need to configure your Pusher app to send channel existence webhooks to this server, which accepts POST /webhook. The server will then start the Twitter stream and trigger events when new tweets are found.

The server supports searching for multiple keywords at once and will stop searching once all users vacate a given channel.

To run the server you'll need to make sure you've set the following environment variables. If you place them in a .env file, they will be loaded automatically by Dotenv.

TWITTER_CONSUMER_KEY="..."
TWITTER_CONSUMER_SECRET="..."
TWITTER_ACCESS_TOKEN="..."
TWITTER_ACCESS_SECRET="..."

PUSHER_APP_ID="..."
PUSHER_APP_KEY="..."
PUSHER_APP_SECRET="..."

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4