Search tweets by keywords and post it on Slack

  1. Add and configure Twitter 'Search Tweets' action

    Add ‘Twitter 'Search Tweets' action to the canvas. Connect this action with the ‘Start’ icon , and configure it.

    On the configuration page, you will notice a few fields. Enter values in the fields as per the instructions given below.

    Authorize Twitter: In order to use this action, first you will have to authorize Twitter account to Built.io Flow. Select 'Add new', and fill in the required details. If you have already authorized the account, select it from the drop-down list.

    Search Keyword: Enter the keyword by which you wish to search the tweets. Please note you need not include '#' symbol before the string.

    Count: Enter the maximum number of results you want to retrieve per page. The default value of this field is '15'.

    1.PNG

    Once you have entered all the details, click on 'NEXT', test the action, and click 'DONE'. This will take you back to the canvas.

  2. Add and configure Slack 'Post Message to Channel' action.

    Add Slack 'Post Message to Channel 'action to your canvas, and connect it with the previous action. Configure this action and enter value in the fields as per the instructions given below.

    Authorize Slack: In order to use this action, first you will have to create an access token. Select 'Add new', and fill in the required details. If you have already created a token, you can select it from the drop-down list.

    Select channel type: Select the type of slack channel (Public, Private group or Direct messages) on which you wish to post the tweets from the drop-down list.

    Public Channel ID or Channel Name: Select/specify the ID or name of the public channel on which you wish to post the tweets. Clicking the ‘Refresh’ icon will fetch the list of all public channels of your Slack account—based on the access token selected—and display it in the drop-down list. You can then select the ID or name of the public channel. Alternatively, you can enter the ID or name manually, (in case you are entering the name manually, make sure to append '#' symbol to it).

    Text: Add the {{$a6.statuses[0].text}} key listed under the array output on the right hand side of the configuration window as an input for this field.

    3.png

    Once you have entered all the details, click on 'NEXT', test the action, and click 'DONE" to return to canvas. Connect this action to ‘Stop’ and 'Save' the workflow.

    Now, whenever you execute this workflow, it will search all the tweets by specified hashtag and will post the latest tweet on the specified Slack channel.

    output