How to Build an RSS-to-email Alert Mashup with the Webhose.io API and MailChimp

Everyone needs to keep track of who said what when. The no-brainer default approach is to set up an email alert feed, which is free and easy to set up. Most email alerts tools are keyword based. That means you can easily monitor who is mentioning you, your company, or a term. But it can get tricky to filter your alert content based on social reach or incoming links.

Most of us are somewhere in the middle - we’d like to customize a content monitoring feed, but would rather not have to work it into the budget or spend too much time on maintenance.

This tutorial shows you how to create a free yet highly customizable email alert feed using the Webhose.io API and MailChimp. As an example, we’ll start with a basic query to monitor content mentioning Donald Trump. Then we’ll add some filtering parameters to the API query and show how to plug the API URL into a MailChimp RSS campaign. This one time setup will send you consistent daily updates for as long as you like. 

1. We’ll use a free Webhose account as it should meet your basic content monitoring requirements. Once the account is set up, select “Live Data” on the dashboard, and log into the API wizard

2. Click the More Filters icon 

3. Define the content you’d like to monitor on the wizard - language, country, specific sites, etc. As a basic starting point we’ll set language to English for websites in the United States. You can use the wizard to generate the API call URL or code it yourself.

4. To set the format parameter to RSS, replace the default JSON field. Here's what the cURL integration looks like:

curl --get --include 'https://webhose.io/search?token=xxxx&format=RSS&q=%22Donald%20trump%22%20language%3A(english)%20thread.country%3AUS%20format%3DRSS%20language%3A(english)%20thread.country%3AUS' \     -H 'Accept: text/plain'

5. Review the filter parameters on the API documentation to narrow your query. Setting the format parameter to RSS automatically retrieves the latest 100 crawled posts. Narrowing results down to fewer than that is a benchmark for a relevant, easy-to-scan feed. Setting social signals to filter for results with over 30 shares on both Facebook and LinkedIn gets the job done in this case. 

In the wizard, simply append the filters in the form: 

Which looks like this as a cURL integration:

curl --get --include 'https://webhose.io/search?token=xxxx&format=RSS&q=%22Donald%20trump%22%20language%3A(english)%20thread.country%3AUS%20social.facebook.shares%3A%3E30%20social.linkedin.shares%3A%3E30%20language%3A(english)%20thread.country%3AUS' \     -H 'Accept: text/plain'

Here’s what an output sample looks like in JSON:

{
 "posts": [
   {
     "thread": {
       "uuid": "xxxx",
       "url": "http://qz.com/841099/what-a-trump-presidency-means-for-nasa-and-the-future-of-space-exploration/",
       "site_full": "qz.com",
       "site": "qz.com",
       "site_section": "http://qz.com/re/technology/feed/",
       "site_categories": [
         "education",
         "business"
       ],
       "section_title": "Technology – Quartz",
       "title": "What a Trump presidency means for NASA and the future of space exploration",
       "title_full": "What a Trump presidency means for NASA and the future of space exploration",
       "published": "2016-11-19T12:19:54.270+02:00",
       "replies_count": 0,
       "participants_count": 1,
       "site_type": "blogs",
       "country": "US",
       "spam_score": 0.0,
       "main_image": "https://qzprod.files.wordpress.com/2016/11/donald-trump-moon-nasa.jpg?quality=80&strip=all&w=1600",
       "performance_score": 2,
       "domain_rank": 1461,
       "social": {
         "facebook": {
           "likes": 275,
           "comments": 0,
           "shares": 275
         },
         "gplus": {
           "shares": 8
         },
         "pinterest": {
           "shares": 0
         },
         "linkedin": {
           "shares": 47
         },
         "stumbledupon": {
           "shares": 0
         },
         "vk": {
           "shares": 0
         }
       }
     }

OK time to integrate with MailChimp!

6. Log into your MailChimp account and create a new RSS campaign

7. Paste your webhose.io query URL as the RSS feed and set timing frequency, then click next:

8. Enter yourself as the only recipient (or include a list of colleagues), fill out the campaign info on the setup screen and select a simple design template. The default single column version will get the job done.

9. Select the RSS content icon and drag it into the design template as a new block.

10. Customize your markup display format

11. Confirm, send yourself a test, then schedule your campaign and enjoy your new alerts!

Ohad Flinker Ohad Flinker is Director of Content Marketing for Webhose.io, the crawled web data API. When he's not too busy transforming web data into insights, he enjoys Tai Chi, community-generated desret festivals, and of course being a dad. His name is pronounced like "Oh g-d" with an H.

Comments