CData Python Connector for Twitter

Build 24.0.9062

TweetStream

Query public data flowing through Twitter.

ビュー固有の情報

TweetStream は、処理が終了させられるまで継続して読み出される公開ツイートのストリームです。TweetStream ビューにクエリを実行すると、利用可能なルールに一致するツイートのみを受信します。ルールを管理するには、StreamRules テーブルを使用します。

Select

以下は、結果をフィルタリングするために使用できるフィールドです。

BackfillCountこのパラメータを渡すことで、切断時に取りこぼしたデータを最大5分相当分まで復元できます。バックフィルされたツイートは、再接続されたストリームを自動的に流れ、通常古いツイートは新しくマッチしたツイートより先に配信されます。このパラメータの値として、1~5までの整数を含める必要があります。これを使用するためには、使用するシステムが重複データを許容できることを確認してください。

1分間分のデータを回収するクエリの例を次に示します。

SELECT Id, Tweet FROM TweetStream WHERE BackfillMinutes = 1

Columns

Name Type Description
Id [KEY] String Unique identifier of the Tweet.
RuleId [KEY] String ID of the filter rule that matched against the Tweet delivered.
AuthorId String Unique identifier of the author.
ContextAnnotations String Contains context annotations for the Tweet.
ConversationId String The Tweet ID of the original Tweet of the conversation (which includes direct replies, replies of replies).
CreatedAt Datetime Creation time of the Tweet.
Entities String Contains details about text that has a special meaning in a Tweet.
InReplyToUserId String If this Tweet is a Reply, indicates the user ID of the parent Tweet's author.
Lang String Language of the Tweet, if detected by Twitter. Returned as a BCP47 language tag.
PossiblySensitive Bool Indicates if this Tweet contains URLs marked as sensitive, for example content suitable for mature audiences.
ReferencedTweets String A list of Tweets this Tweet refers to.
ReplySettings String Shows who can reply to this Tweet. Fields returned are everyone, mentionedUsers, and following.
Source String The name of the app the user Tweeted from.
Text String The content of the Tweet.
EditHistoryTweetIds String Unique identifiers indicating all versions of an edited Tweet. For Tweets with no edits, there will be one ID. For Tweets with an edit history, there will be multiple IDs.
GeoCoordinates String A pair of decimal values representing the precise location of the user (latitude, longitude). This value be null unless the user explicitly shared their precise location.
GeoCoordinatesType String Describes the type of coordinate.
GeoPlaceId String The unique identifier of the place, if this is a point of interest tagged in the Tweet.
AttachmentsMediaKeys String List of unique identifiers of media attached to this Tweet.
AttachmentsPollIds String List of unique identifiers of polls present in the Tweets returned.
EditsRemaining Int Indicates the number of remaining edits for the tweet.
IsEditEligible Bool Indicates if a Tweet is eligible for edit.
EditableUntil Datetime Indicates how long the tweet is editable for.
RetweetCount Int Number of times this Tweet has been Retweeted.
ReplyCount Int Number of Replies of this Tweet.
LikeCount Int Number of Likes of this Tweet.
QuoteCount Int Number of times this Tweet has been Retweeted with a comment (also known as Quote).
ImpressionCount Int Number of times this Tweet has been viewed.
WithheldCopyRight String Indicates if the content is being withheld for on the basis of copyright infringement.
WithheldCountryCodes String Provides a list of countries where this content is not available.
WithheldScope String Indicates whether the content being withheld is a Tweet or a user.

Pseudo-Columns

SELECT ステートメントのWHERE 句では、疑似列フィールドを使用して、データソースから返されるタプルを詳細に制御することができます。

Name Type Description
BackfillMinutes Int By passing this parameter, you can recover up to five minutes worth of data that you might have missed during a disconnection. The backfilled Tweets will automatically flow through a reconnected stream, with older Tweets generally being delivered before any newly matching Tweets. You must include a whole number between 1 and 5 as the value to this parameter. To use this, please make sure your system is tolerant of duplicate data.

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9062