KNIME logo
Contact usDownload
Read time: 1 min

@KNIME Twitter Nodes

December 20, 2021
knime-twitter-connectors.jpg
Stacked TrianglesPanel BG

Harvest social media data in just a few clicks

The KNIME Twitter Connectors allow you to search for tweets on Twitter, retrieve information about users, post tweets via KNIME and much more.

1-knime-twitter-nodes.png
Figure 1. Retrieved tweets containing the hashtag #KNIME.

Setup

To use the Twitter nodes you first need a regular Twitter account and a Twitter Developer account. You can then create a Twitter App and configure the Twitter API Connector node following the steps described below:

  1. Go to: https://developer.twitter.com/en/apply-for-access.
  2. Select “Apply for a developer account”.
  3. Select the option that best describes you (Figure 2).
  4. Fill in all required information about your account identity
  5. Click 'Create New App'.
  6. Generate an API key and secret API key, an access token and secret access token (check this guide for more information).
  7. Use the API key, API secret, Access token and Access token secret to configure the Twitter API Connector node (Figure 3).
2-knime-twitter-nodes.png
Figure. 2. Application view for a Twitter developer account. We chose to explore the API as Hobbyists.

In Figure. 2, we selected Hobbyist and not Professional or Academic, because that was the scope of the example. Then you can choose any of the next three options: “Exploring the API”, “Making a bot”, and “Building tools for Twitter users”.

3-knime-twitter-nodes.png
Figure 3. Input your credentials to configure the Twitter API Connector node.

Search

The Twitter Search node allows you to search for tweets by specific queries. Use the same syntax for these queries as for web-based queries https://twitter.com/search-home. You can specify the maximum number of results as well as what kind of tweets will be returned as result: the most popular Tweets, the most relevant, or a mixture of both. Note that the actual number of results might vary. Loading the profile images can slow down the execution of the node considerably.

Timeline

The Twitter Timeline node downloads tweets as a timeline. They can either be tweets of the home timeline, mentions, retweets, or tweets from a specific user.

The home timeline contains the tweets shown on your Twitter 'Home' page, which are your own tweets as well as tweets of users you follow. The mentions timeline contains tweets in which you are mentioned. The retweets timeline contains retweets of your tweets. With the user timeline, you can get all recent tweets of a specific user.

Users

The Twitter Users node allows you to retrieve detailed information on Twitter users, such as their location, number of followers, and much more. The node requires a data table containing a column of Twitter user names as input and can be used in combination with the Twitter Search and Twitter Timeline nodes.

Post Tweet

With the Twitter Post Tweet node, you can post tweets directly from KNIME. The text is specified in the dialog and variables can be inserted anywhere in the text. The tweet will be posted on execution (Figure 4).

4-knime-twitter-nodes.png
Figure 4. Post a tweet directly from KNIME Analytics Platform.

Don't forget to follow KNIME on Twitter!

Author

Rosaria.jpg
by Rosaria Silipo
Rosaria Silipo is not only an expert in data mining, machine learning, reporting, and data warehousing, she has become a recognized expert on the KNIME data mining engine, about which she has published three books: KNIME Beginner’s Luck, The KNIME Cookbook, and The KNIME Booklet for SAS Users. Previously Rosaria worked as a freelance data analyst for many companies throughout Europe. She has also led the SAS development group at Viseca (Zürich), implemented the speech-to-text and text-to-speech interfaces in C# at Spoken Translation (Berkeley, California), and developed a number of speech recognition engines in different languages at Nuance Communications (Menlo Park, California). Rosaria gained her doctorate in biomedical engineering in 1996 from the University of Florence, Italy.
Sign up for our mailing list
Twitter meets PostgreSQL: More than Idle Chat?
Company blog

Twitter meets PostgreSQL: More than Idle Chat?

November 28, 2016 | by Rosaria Silipo
Data Exploration in #66DaysOfData with KNIME
Company blog

Data Exploration in #66DaysOfData with KNIME

September 20, 2021 | by Roberto Cadili, Rosaria Silipo
Machine Learning for Sentiment Analysis: A Tutorial
Company blog

Machine Learning for Sentiment Analysis: A Tutorial

July 19, 2021 | by Kilian Thiel, Lada Rudnitckaia