Build this media monitoring Slack bot in 20 minutes without writing code

Media monitoring has become a vital tool for marketers in every industry – being aware of the stories about you or your competitors that are being published in the news or shared on social media is simply a central part of how we work today. This is why, by 2022, the spend on media monitoring solutions is set to hit is set to hit $4.2 billion.

 

In this blog, we’re going to show you how easy it is to build an NLP powered media monitoring solution in a matter of minutes without writing a single line of code. This solution will let you monitor the world’s news content and alert you in Slack whenever stories about the brands or people that matter to you are published by news sites or shared on social media.

 

In order to make things super simple we’re going to use Zapier, a popular automation platform, to build our app.

 

Here’s what your completed Zapier app’s workflow will look like – it’s so simple it will only take about 15 minutes to build this from scratch we’re going to take you through each step in detail:

 

Here’s what is happening in each of these steps:

  1. Our News API is constantly crawling and analyzing tens of thousands of news sources in near-real time and tracking how these stories are shared on social media. You will decide which brands, people, or things you want your app to monitor, and Zapier’s webhooks feature will check with our News API every 10/15 minutes to see if anything new meeting your criteria has been published or shared.

  2. If something new has appeared, Zapier will send a notification to a Slack channel or user you specify.

To complete these two steps, you will need the following:

 

With that in mind, let’s get building our app!

Step 1. Give your app the URL that will return intelligent news alerts

Our News API is a simple and powerful tool for keeping track of the world’s news content. Each month, the News API crawls tens of thousands of sources, gathering, analyzing, and indexing millions of stories as they are published.

 

For each of these stories, it analyzes dozens of data points, from the sentiment of the story to the entities mentioned to the subjects discussed. It also tracks how these stories are shared online in the hours and days following their publication.

 

To leverage the News API in our app, we’re going to provide Zapier with a query in the form of a URL. This query will return stories that meet the criteria we set. For example, the query below will return stories about Ryanair that were published in the last day that have gotten 10 or more shares on social media:

 

https://api.newsapi.aylien.com/api/v1/stories?title=Ryanair_by=recency_shares_count.min=10[]=en_at_start=NOW-1DAY_at_end=NOW

 

If we supply Zapier with this URL, every time a story published that matches our query in the last day mentioning Ryanair in the title is shared more than 10 times, you will be notified in Slack. We’ve included the minimum social shares parameter because there is so much published about Ryanair we really only want to be notified when a story begins to be shared.

 

To make your own query, just change the title and share count in this URL to whatever you need.

(** If you want to put together a query that leverages more of the News API’s capabilities, you should check out Postman. Postman makes it easy to select the parameters you want in your query and give you a URL in return. We have a tutorial for downloading and using Postman – it’s free and it should only take you a couple of minutes to set up. The app in this blog just uses the ‘title,’ ‘social_shares,’ and ‘published_at’ parameters, but the News API offers dozens more that will refine your query. Once you’ve put together this app it’s highly recommended that you look through the rest of the parameters. **)

 

Supplying this URL to Zapier

At this point, you’ll need to sign up to Zapier and click ‘Make a Zap’ on your dashboard. From here, you’ll be taken to the dashboard where you’ll build your Zap. The first thing you need to do is create your  “Trigger” using the widget on the left.

 

To get this step up and running, click on the Choose App tab and search for ‘Webhooks by Zapier,’ and once you’ve selected the Webhooks app, click on the Choose Action tab in the widget. In the Choose Action tab, select the *Retrieve Poll *option.

 

After you have selected Retrieve Poll as your app’s trigger, you’ll be taken to the Set Up Options tab. You’ll enter three things in the fields on this tab:

  • In the *URL *field, copy and tweak the sample URL that we talked you through above

  • In the Key tab, enter ‘stories’

 

Then, in the Headers field, you’ll make two entries (using the ‘+’ button to create another field). These entries will be your AYLIEN News API credentials that you get when you sign up for the free trial:

  • First, enter ‘X-AYLIEN-NewsAPI-Application-Key’ and your News API Application Key in the field next to it.

  • Then enter ‘X-AYLIEN-NewsAPI-Application-ID’ and your App ID in the corresponding field.

 

Once you have done this, you can proceed to the Pull in Samples tab, where Zapier will send a test query to your URL and show you the results. This should take a couple of seconds, after which you can proceed to the next step.

 

Step 2. Set your Zap to notify you in Slack when something happens

After you have completed the first step, assigning the Webhooks feature to the Trigger widget, you can complete the second step, which involves getting Zapier to alert you or others when your URL returns something new. In this case, we’re going to show you how to get notified in Slack.

 

To do this, select Slack from the Choose App tab in the Action widget, and Send Channel Message from the *SelectAction *tab ( you can also send this alert via Direct Message if you like). In the next tab, you’ll sync up your Slack account and workspace with you app.

 

In the Edit Template tab, you’ll be able to access the sample response that Zapier received from your URL in the previous step, and use this sample to show Zapier which parts of the response you want to send to your Slack channel.

 

For our example, we want to be notified whenever any story about Ryanair published in the last day had been shared 10 times or more, so we added in the title, the sentiment, the link, and some filler text to make the message understandable. But remember, there are dozens of data points generated by the News API, so if you want to include things like summary or concepts mentioned, just select them from the list.

To do this, in the *Message Text * field, we entered: “This story, published in the last day, has just been shared 10 times: “, and then added the story title from the response. Remember you can choose from all of the News API’s response, so feel free to add in the story’s sentiment, a link to the story, or whatever else you find useful.

You’ll also need to select the Slack Channel you want to send the alert to. You’ll also have to choose a name for the bot that sends the messages. Once you’ve done this, you can test your step, and your app will send its first alert to the channel you specify:

As we have said, this is a simple template to get you up and running with a media monitoring Slack bot. The real benefit is how customizable it is – play around with the steps and leverage the News API to keep you informed about the media coverage that matters to you.