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.
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:
- Go to: https://developer.twitter.com/en/apply-for-access.
- Select “Apply for a developer account”.
- Select the option that best describes you (Figure 2).
- Fill in all required information about your account identity
- Click 'Create New App'.
- Generate an API key and secret API key, an access token and secret access token (check this guide for more information).
- Use the API key, API secret, Access token and Access token secret to configure the Twitter API Connector node (Figure 3).
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”.
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.
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.
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.
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).
Don't forget to follow KNIME on Twitter!