pip install kpireport-twitter
- class kpireport_twitter.TwitterDatasource(report, **kwargs)¶
A datasource that can fetch metrics from Twitter’s V2 API.
Currently the following queries are supported:
tweets: request a list of the user’s latest Tweets via the Timeline API. If requesting the authenticated user’s own timeline, “non-public” metrics such as impression counts are included in the output table result. Otherwise, only public metrics such as like, reply, and retweet counts are retrieved. The text and ID of the Tweet are also included in the output table.
The Twitter application consumer public key.
The Twitter application consumer secret.
The user-scoped access token public key.
The user-scoped access token secret.
The number of seconds to wait before fetching the next page of results from Twitter’s API. It is recommended to set this to at least 1 to avoid rate limits or downstream errors from the API. (Default 5)
Tweets are now displayed in the timezone configured in the report.
Always use OAuth2 when authenticating, even when using consumer key/secret application-only authentication. OAuth1.0 will throw an error from the TwitterAPI module.
A new View
twitter.engagementis available. The view will show a scatter plot of recent tweets, displaying their like/reply/retweet counts. The highest- liked tweet is called out visually as well.