DEV Community

Max Katz
Max Katz

Posted on • Originally published at maxkatz.org on

Tutorial: building a no-code application to text positive news with Parabola, News API, Watson NLU and Twilio

I wanted to take an app build with code and rebuild it using no-code tools. Gwyneth Peña built a wonderful app that sends a daily positive news article about COVID-19 via a text message so I decided to build this app using no-code tools. I shared a high-level overview of the app in an earlier blog post.

In this blog post I will share a more step-by-step how I built the app. You should be able to follow the steps and build it as well.

Tools you need

You will need the following tools to build the application. All four services offer a free plan.

  1. Parabola – no-code platform
  2. News API – news service
  3. Watson NLU – sentiment service
  4. Twilio – SMS service

Parabola

Parabola is a no-code tool where I built the app. Parabola is a drag-and-drop workflow builder. You build a flow with multiple steps (nodes) and connections between steps. Each step has input and output. Output from one step is passed as input to the next step. You can also look at it as a serverless application – where each step represents a serverless function. But, instead of writing code, each step is dropped onto the flow and configuring. This is how the application flow looks:

Application flow in Parabola

Register for a free Parabola account.

News API

News API provides an API to search world wide news. In our application we are going to search for COVID-19 news.

Register for a free account, you will get an API key and can start making requests

Watson NLU

IBM Watson NLU (Natural Language Understanding) service is used to determine if a news article has positive or negative sentiment. The application we are building should only send positive news.

  1. Create a free IBM Cloud account
  2. From the main Dashboard, click to create New Resource
  3. Search for sentiment and click on Natural Language Understanding to create a service

nocode-tutorial-nlu
Watson NLU service

  1. Once the service is created it should look like this:

nocode-tutorial-nlu2
IBM Cloud Watson NLU service

We will come back to this service in Parabola flow. You will need the API key and the URL.

Twilio

You will need a Twilio account to send text messages. You can sign up for free account. You will need to use Account SID and Auth Token later to setup the Twilio SMS step in Parabola.

nocode-tutorial-twilio
Twilio dashboard

Creating application flow

In this step we are going to create the application flow. What’s really amazing is that we will not write a single line of code. Let’s get started.

Adding and connecting steps

To create a connection between steps:

  1. Drag and drop a step onto the flow
  2. Select the dot on the left-hand side and drag it over to the next step to create a connection

nocode-tutorial-connect2
Connecting steps

Do delete a connection, select the connection arrow and then drag it to the side.

API Import step

Drag and drop API Import step on to the flow. This step allows to call an external API. In our case we are going to call the News API service.

nocode-tutorial-apiimport
API Import step

The API endpoint is entered on the left and the result is shown on the right side.

https://newsapi.org/v2/top-headlines?q=COVID-19&apiKey={apiKey}_

This step only invokes the API. Next step is to format the results in a format that we can use later in the flow.

JSON Flattener step

Parabola works with tables and rows of data. We want to convert data from articles array (API endpoint) into columns and rows. This step will do that for us.

nocode-tutorial-jsonflattener-2
JSON Flattener step

We select articles column to be flattened and each object property in flattened into a column (articles.source.id, articles.source.name and so on). The data is now in table format and that’s what we need. The column that we need is the articles.url column. It is the news article URL which we next going to pass to Watson NLP and determine if an article has a positive sentiment.

API Enrichment step

API Enrichment step allows to loop over data and invoke an API for each row. In this step we are passing the news article URL from each row to Watson NLU service and determine the article sentiment. A sentiment score is between -1 and 1. The closer the score to 1 the more positive the sentiment is and that’s the article we would like to send.

The URL and the endpoint you can copy from IBM Cloud console:

https://api.eu-gb.natural-language-understanding.watson.cloud.ibm.com/instances/572b4fa1-5770-4215-b27f-e14524347e3a/v1/analyze?version=2019-07-12&url={articles.url}&features=sentiment_

You will need to add v1/analyze?version=2019-07-12&url={articles.url}&features=sentiment to the URL. {articles.url} is referencing a column in the data.

nocode-tutorial-apienrichment
API Enrichment step

Next we want to pick the URL with the highest sentiment score.

Sort step

The Sort steps allows to sort the result. In our application we are sorting using the sentiment score in order to know which news article (URL) has the highest sentiment score.

nocode-tutorial-sort
Sort step

Next we need to add a row number to each row.

Row Numbers step

Row Numbers step adds a row number to each row. We need this in order to be able to pick the row with the highest sentiment number after this step.

nocode-tutorial-rownumbers
Row Numbers step

Now that each row has a number we can easily pick the row that we need in the next step.

Row Filter

The Row Filter steps allows to select rows based on row number. In our example we only want row number 1 (as it holds the highest sentiment news article).

nocode-tutorial-rownumbers
Row Numbers step

We are almost ready to send the text message. First we need to create the actual message we would like to sent.

Add Columns step

The Add Columns step allows to add a new column to data. In this step we are adding a new column which will hold the number where to send the message.

nocode-tutorial-addcolumn
Add Columns step

One more step before sending the actual message. In the next step you will create the actual message to send.

Text Merge step

The Text Merge step allows to combine multiple columns data into a new column.

nocode-tutorial-textmerge
Text Merge step

The final step is to send the text message using Twilio.

Twilio SMS step

The Twilio SMS steps allows to send a text message using Twilio.

nocode-tutorial-twiliosms
Twilio SMS step

That’s it. Next you can test the flow and schedule it to run.

Running the application

When you are done with the flow click the Publish button. You will see the following page where you can test run the flow (Run Flow button) or schedule it to run periodically (like a cron job).

nocode-tutorial-run
Setting up when to run the flow

This is an example of a text message received:

nocode-tutorial-sms
Text message with positive news

Summary

This tutorial showed you how to build an application that texts positive COVID-19 news. You can easily configure to send any other news as well (just update the query in News API). What I find incredible is that we used three different services: News API, Watson NLU, Twilio and built a flow in Parabola all without writing a single line of code.

Let me know if you have any questions about this tutorial in comments or on Twitter.

Top comments (1)

Collapse
 
roikra profile image
roikra

Hi Max!
May I suggest considering our new News API:
usearch.com/news-api
I am sure you will find it way better than newsapi.org, with many more appealing features.