Your favorite Twitter updates, now on Flock

A constant challenge for professionals is keeping up with topics that interest them. Whether you are a forerunner in your industry or new to the game, it is vital to keep abreast with everything latest.

As a communication product, we are also interested in what others have to say about us on various social media platforms. More often than not, our team keeps track of our competitor’s latest updates.

Therefore, at Flock, we are all about productivity! We don’t believe in wasting time by checking Twitter every now and then for latest updates.

Instead, we love to keep it organized.

Enter Flock WebHook. With Flock WebHook, we get consolidated updates on any selected Twitter handle. This serves as a timely Twitter newspaper including all your favorite topics. If you belong to the marketing team, and are looking to get live updates from a twitter handle, you can look into our previous post about it.

So, let’s get started:

Step 1 : Setup the incoming Flock Web hook

Go to https://admin.flock.co/webhooks and configure an incoming web hook. Choose the group and the icon you want to use for the message that is being posted. After creation, this will give you a Webhook Url . Take note, as we will use it when we will configure our app to send messages back to Flock.

Step 2 : Setup your Twitter App Keys

Twitter has a great developer API. Just go to https://apps.twitter.com and click on ‘Create new app’.

Enter the details and create a new app.

Once the app is created, go to ‘Keys and Access Tokens’ tab to get the required keys, and note your

  • Consumer Key (API Key)
  • Consumer Secret (API Secret)
  • Access Token
  • Access Token Secret

Step 3 : Setup your node server

Install node.js and npm on your machine.

Once that is done, install the twitter-webhook-flock package https://www.npmjs.com/package/twitter-webhook-flock by running

npm install twitter-webhook-flock

This `npm` package installs the required dependencies that you need. Now, just create a new file and insert your respective keys that you have created above, in the sample code that follows.

var twitterWebHook = require(‘twitter-webhook-flock’);
var loginKeys = {
consumerKey: <twitter.Consumer Key >,
consumerSecret: <twitter.Consumer Secret>,
accessToken: <twitter.Access Token>,
accessTokenSecret: <twitter.Access Token Secret>
};
var flockPostUrl = <Incoming flock webhook URL >;
var keyword = ‘flockchat’; // keyword to search
var postInterval = 24*60*60*1000; // defaults to 24 hrs if not specified
var T = new twitterWebHook(loginKeys, flockPostUrl, keyword, postInterval);
T.startTwitterInterval();

Save the file and run it using

node <your file name>.js

And that’s it. Now every interval, you will get messages in the configured group on Flock with search results of the desired keyword in the last 24 hours.

That how it looks inside flock app ….. Sweet !!

Voila ! 
That’s about it. Now, you can comfortably get all your daily twitter updates, within Flock itself. Flock helps teams be productive together. Cheers 🍻

-Authored by Sukhmeet Singh