Module: LambdaSharp.Twitter.Query
Version: 0.8.3.5
Overview
The LambdaSharp.Twitter.Query module conducts a Twitter search at regular intervals and publishes found tweets to a dedicated SNS topic.
This module requires a Twitter developer account. See the Twitter Developer Documentation for more information.
Resource Types
This module defines no resource types.
Parameters
TwitterApiKey
-
The
TwitterApiKey
parameter sets the API key for accessing Twitter.Required: Yes
Type: Secret
TwitterApiSecretKey
-
The
TwitterApiSecretKey
parameter sets the secret API key for accessing Twitter. This parameter must either be encrypted with the default deployment tier KMS key, or the corresponding KMS key must be passed in via theSecrets
parameter.Required: Yes
Type: Secret
TwitterLanguageFilter
-
The
TwitterLanguageFilter
parameter is a comma-delimited list of ISO 639-1 language filters for tweets (empty value disables filter). This parameter must either be encrypted with the default deployment tier KMS key, or the corresponding KMS key must be passed in via theSecrets
parameter.Required: No (Default: en)
Type: String
TwitterQuery
-
The
TwitterQuery
parameter sets the query expression for finding tweets.Required: Yes
Type: String
TwitterQueryInterval
-
The
TwitterQueryInterval
parameter sets the interval between queries (in minutes).Required: No (Default: 60)
Type: Number (between 2 and 1,440)
TwitterSentimentFilter
-
The
TwitterSentimentFilter
parameter sets the sentiment filter (one of:SKIP
,POSITIVE
,NEUTRAL
,NEGATIVE
,MIXED
,ALL
).NOTE: Analyzing tweets for sentiment incurs additional costs. Please check pricing for the AWS Comprehend Sentiment Analysis API.
Required: No (Default: SKIP)
Type: String
The
TwitterSentimentFilter
parameter must have one of the following values:ALL
-
Analyze and publish all tweets.
MIXED
-
Only publish tweets with mixed sentiment.
NEGATIVE
-
Only publish tweets with negative sentiment.
NEUTRAL
-
Only publish tweets with neutral sentiment.
POSITIVE
-
Only publish tweets with positive sentiment.
SKIP
-
Publish all tweets without analyzing them.
Output Values
TweetTopic
-
The
TweetTopic
output contains the ARN of the SNS topic to which tweets that match theTwitterQuery
are published to.Type: AWS::SNS::Topic
Examples
Use LambdaSharp.Twitter.Query to invoke a Lambda function
- Stack: TwitterNotify
Module: LambdaSharp.Twitter.Query
Parameters:
TwitterApiKey: !Ref TwitterApiKey
TwitterApiSecretKey: !Ref TwitterApiSecretKey
TwitterQuery: LambdaSharp
- Resource: TwitterNotifyTopic
Type: AWS::SNS::Topic
Allow: Subscribe
Value: !GetAtt TwitterNotify.Outputs.TweetTopic
- Function: NotifyFunction
Memory: 256
Timeout: 30
Sources:
- Topic: TwitterNotifyTopic