Przeskocz do zawartości głównej Przejdź do treści uzupełniającej

Twitter

The Qlik Twitter connector uses the Twitter API to extract Twitter data, such as all Tweets that include a hashtag or a search term, and load that data into your Qlik Sense app.

InformacjaThe Qlik Sense connector for Twitter was deprecated after Twitter changed the structure for the available API access levels and removed the broader access to analytics via Twitter API v1.1. Twitter API v2 is now required, which is not supported in the current connector for Twitter. A new connector for Twitter is intended to be released in the fourth quarter of 2023. For more information, see Qlik Analytics connectors: Twitter connector to be updated in the Qlik Support Community.

Ways to access your data

To access your Twitter data, you will need to authenticate the connector with your Twitter account credentials. After you create a connection and select Twitter as your data source, you will be redirected to a Twitter login page to retrieve your authentication token.

Creating a data source connection

Loading data from tables

After you authenticate the connector with your account credentials, you can use the following tables to select and load data. Some tables are only available in the Data load editor, and are not available in the Add data interface. They are indicated below by the Available in column.

Tables that can be loaded in Qlik Sense
Table Available in Description
DirectMessages Menedżer danych and Edytor ładowania danych Returns direct messages sent and received within the past 30 days by the authenticated user, sorted in reverse chronological order.
Favorites Edytor ładowania danych Returns the liked Tweets for a specified user. If you do not enter a user name, the table will show the liked Tweets for the authenticated user.
Followers Edytor ładowania danych Returns a list of users who are followers of the specified user ID.
Following Menedżer danych and Edytor ładowania danych Returns a list of users the specified user ID is following.
HomeTimeline Menedżer danych and Edytor ładowania danych Returns a collection of the most recent Tweets and Retweets posted by the authenticating user and the users they follow.
LocationsWithTrends Menedżer danych and Edytor ładowania danych Returns the locations that Twitter has trending topic information for.
Mentions Menedżer danych and Edytor ładowania danych Returns up to 800 Twitter mentions for the authenticated user. You can specify a Since ID and a Max ID to reduce the mentions shown.
RateLimit Edytor ładowania danych Returns the current rate limits for the different API end points.
RetweetsOfMe Edytor ładowania danych Returns the most recent tweets from the authenticated user that have been retweeted.
Search Menedżer danych and Edytor ładowania danych Returns the Tweets based on a search term and other parameters.
SearchAdvanced Edytor ładowania danych Returns the Tweets based on a search term and other parameters. This table shows more columns than the simple Search table.
TweetLookup Edytor ładowania danych Returns the details for up to 100 Tweet objects. Tweet IDs are entered as comma-separated values: tweetid1,tweetid2,...
UserSearch Menedżer danych and Edytor ładowania danych

Returns information about a public Twitter account based on a search query.

UserTimeline Menedżer danych and Edytor ładowania danych Returns the most recent Tweets posted by the specified user name.

To select and load data from a table, enter the required table parameters and click Preview data. Required parameters are marked with an asterisk (*) in the dialog. The table fields are displayed under the Data preview tab. You can select fields individually by selecting the box beside each field name. Select Insert script after you have made your selection.

Creating a connection and selecting data

Search API Query Operators

The table below lists the official Twitter query operators.

Officially supported query operators
Operator Finds tweets...
watching now containing both “watching” and “now”. This is the default operator.
“happy hour” containing the exact phrase “happy hour”.
love OR hate containing either “love” or “hate” (or both).
beer -root containing “beer” but not “root”.
#haiku containing the hashtag “haiku”.
from:interior sent from Twitter account "interior".
list:NASA/astronauts-in-space-now sent from an account on the NASA list; account name: "astronauts-in-space-now"
to:NASA

sent to person Twitter account "NASA".

@NASA mentioning Twitter account "NASA".
politics filter:safe containing "politics" and Tweets marked as potentially sensitive removed.
puppy filter:media containing "puppy" and an image or a video.
puppy filter:native_video containing “puppy” and an uploaded video, Amplify video, Periscope, or Vine.
puppy filter:periscope containing “puppy” and a Periscope video URL.
puppy filter:vine containing “puppy” and a Vine.
puppy filter:images containing “puppy” and links identified as photos, including third parties such as Instagram.
puppy filter:twimg containing “puppy” and a pic.twitter.com link representing one or more photos.
hilarious filter:links containing “hilarious” and linking to URL.
puppy url:amazon containing “puppy” and a URL with the word “amazon” anywhere within it.
superhero since:2015-12-21 containing “superhero” and sent since date “2015-12-21” (year-month-day).
puppy until:2015-12-21 containing “puppy” and sent before the date “2015-12-21”.
movie -scary :) containing “movie”, but not “scary”, and with a positive attitude.
flight :( containing “flight” and with a negative attitude.
traffic ? containing “traffic” and asking a question.

To learn more about the Twitter Query Operators, refer to the search API documentation.

Informacja

You can add RT or -RT to include or exclude retweets. For example, "Qlik RT" will search for retweets only and "Qlik -RT" will exclude retweets.

Using Twitter Action URLs (Web Intents)

You can respond to tweets or follow users from your Qlik Sense app by usingTwitter Web Intents. You can add Web Intent URLs in your Qlik Sense app, which launch Twitter on the appropriate page when they are clicked. The following table shows the URL, with the token to replace, for the popular actions:

Web intent URLs
Action URL
Reply to a tweet https://twitter.com/intent/tweet?in_reply_to=[TWEET_ID]
Retweet a tweet https://twitter.com/intent/retweet?tweet_id=[TWEET_ID]
Favorite a tweet https://twitter.com/intent/favorite?tweet_id=[TWEET_ID]
Short user profile, with option to Follow https://twitter.com/intent/user?screen_name=[SCREEN_NAME]

To learn more about use Twitter Web Intents, refer to the Twitter web contents documentation.

Working with the Twitter Search API quota limits

The Twitter Search API imposes a set of API limits for each access token for a given Łączniki internetowe Qlik connection.

Each Twitter table will affect the rate limit differently. Details on how the table will contribute to the total API rate limit is displayed when you select the table.

To learn more about the Twitter API rate limits, refer to the Twitter API documentation.

WskazówkaSelect the Ignore Rate Limit Errors option to avoid failing the table. If you reach the API rate limits and you have this option selected, the connector will return all of the data that has been received up to that point.

Reference - Twitter Developer documentation

You can refer to the Twitter Developer documentation to learn more about the requirements and restriction imposed by the Twitter API.

Troubleshooting

You receive an error message that you have reached the API rate limit

Możliwa przyczyna

You have exceeded the API limits that are imposed on the Łączniki internetowe Qlik by the Twitter Search API.

Proponowane działanie

To reduce the impact of reaching the API rate limits, develop your app with the following in mind:

  • Extract only the data you need.
  • Reload one Twitter-based application at a time.
  • Ensure that loops in your script that make API calls will not result in infinite loops.
  • Select the Ignore Rate Limit Errors option to retrieve all data that is received before exceeding the rate limit.

You receive error code 130 - Twitter is over capacity

Możliwa przyczyna

Twitter is temporarily over capacity.

Proponowane działanie

Wait a short while and then try again.

You receive an error message when trying to preview data with direct message tables

Możliwa przyczyna

The Twitter account that you are connected to does not have direct message permissions enabled. You can verify your permissions from your Twitter account.

Wykonaj następujące czynności:

  1. From your Twitter account, go to Settings and PrivacyApps.
  2. Find the Łączniki internetowe Qlik and verify your permissions.

Proponowane działanie

From your Twitter account settings, click Revoke access. Then, from the Data load editor, click Edit on your Twitter connection to update the connection. Click Update and then reauthenticate your connector with a new Twitter authentication token.

You receive an error message when trying to verify your account

You try to verify a connection to your Twitter account but you receive an error message saying that you are unauthorized to verify the connection or that the PIN you used is incorrect.

Możliwa przyczyna

You did not use the right password when trying to authenticate the connection to your Twitter account.

Proponowane działanie

Send an authorization request again by clicking on Authenticate. Copy the provided PIN and retry the verification process.

Czy ta strona była pomocna?

Jeżeli natkniesz się na problemy z tą stroną lub jej zawartością — literówkę, brakujący krok lub błąd techniczny — daj nam znać, co możemy poprawić!