In fact, even less. The main tool for writing such an application is Node-RED on Bluemix.
A few years ago, our company developed the
Node-RED tool. This is an open-source service that helps to create applications on a modular basis - you just need to connect the finished blocks. The blocks are not only software modules, but also various devices, web APIs and online services. To work with Node-RED you need basic knowledge of HTML, CSS and JavaScript. Of course, the deeper your knowledge, the more perfect the application can be created.
')
Today, as an example, we will show how, based on Node-RED, you can create applications for analyzing tweets of a given topic in real time (the source is an
English-language article ). Subject (keyword) is not the only criterion, you can search by author or hashtag. But the example uses exactly keyword search. In addition to the topic, the application we write will be able to evaluate the emotional coloring of the message. We will search only negative tweets of a certain subject. The necessary messages will be shown for a couple of seconds after someone has written them.
How will all this look?
Well, for example, we are looking for reviews about the restaurant "Jim's fries". Remember, we will only look for negative reviews. For example, such:
“Jim's fries is the worst restaurant I've ever been to!” And the card did not give pay! I do not advise anyone! ”
I want such an application, how to write it?

So, in order to create such a tool, you need to initially open the Node-RED editor. Then we will create an application by dragging the required modules (these are pre-written parts of the code that perform the desired action) from the panel on the left in the Node-RED editor to the central field of the editor. Here we will build our algorithm. In order to connect the modules, you need to click on the exit point of one module, pulling it to the entry point of another.
Each module must receive certain parameters. To assign them, click on the module twice and fill out the form that appears.
Tip : if there are several parameters for the search, add them separated by commas and no spaces. Comma = OR, space = AND. Twitter's software interface will not give out 100% of all tweets. Tweets of those you follow will include their retweets and what has been added to your favorites.
Once the necessary actions are completed, you need to click the application launch button (Deploy). The button is located in the upper right corner of the editor. If everything is correct, everything starts working right away, without any “fine-tuning”.
And here is the application
Search tweet -> Get the value EMOTIONAL COLOR -> Debug the value EMOTIONAL COLOR + Analyze the level of negative -> Send a message via e-mail if the value of EMOTIONAL COLOR is less than or equal toWritten as an example, the Node-RED application includes only five modules. The first is analyzing Twitter for tweets with the necessary keywords (they are set just in the parameters of the module). In order for all this to work, you need to set your credentials for Twitter. In the For field, add the username of the microblogging service, whose tweets will be searched, hashtags, plus keywords. The current example used the hashtag #testnegative.
Finished with the first module, go to the second. Here we add an analysis of the emotional coloring of the tweet, connecting the input of the second module with the output of the first. As mentioned above, we will only search for tweets with negative coloring. But you can search for positive tweets, why not? The emotionality of the message is rated on a scale from -5 to 5, where -5 is a very negative tweet, 0 is neutral and 5 is extremely positive feedback.
Next is the “debug” module for recording the assigned values ​​of the emotional coloring of a tweet in the Node-RED log. If there is no time, it is possible not to use such a module, but in this case a certain kind of malfunction is possible. As an example, we give the following types of reviews:
• EMOTIONAL PAINT Value 4: #testnegative Jim's fries restaurant is awesome!
• EMOTIONAL COVERING -3: #testnegative Jim's fries is the worst restaurant I've ever been to!
• EMOTIONAL COLOR -4 Value: #testnegative Jim's fries is the worst restaurant I've ever been to! And the card did not give pay!
• EMOTIONAL COLORING value -5: #testnegative Jim's fries is the worst restaurant I've ever been to! And the card did not give pay! I do not advise anyone!
• EMOTIONAL COLORING value -8: #testnegative Jim's fries is the worst restaurant I've ever been to! And the card did not give pay! I do not advise anyone! Terrible service!
After that, we use the selection module, where all responses with an emotional coloring greater than or equal to -5 are eliminated. The module was named "Analyze the level of negativity."
And the last is the notification module, which informs the application owner about the appearance of a tweet with the desired level of emotional coloring. Notification comes to work email:

As output
The Bluemix Node-RED environment is extremely simple and user friendly. To create an application, special programming knowledge is not needed. Of course, basic knowledge and logic are needed, but nothing more is required. Except, perhaps, the task you want to solve. Created applications can be much more complex than our example. Here is another example where a functional application is created in Node-RED to manage smart devices at home:

After the application is ready, it can be modified in accordance with the current task. For example, an application already written by us can be used to search for only positive tweets. In addition, you can make so that notifications will be sent to Slack or other instant messengers.
Separately, it is worth emphasizing that all the work on creating an application takes a few minutes. Modifying the application takes even less time - here the score is already in seconds.
Well, in order to get additional information on the environment Node-RED and Bluemix, we suggest to take part in the
webinar, which will be held on June 23 . Come, it will be interesting :)