Created
June 19, 2018 07:15
-
-
Save sebgoa/98c215386f461fdd229626261a904c42 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import boto3 | |
access_key="" | |
secret_key="" | |
def tweets_processor(event, context): | |
tweet = event['data'] | |
print tweet | |
# we found a tweet that is of interest push the record to SNS for mobile notification | |
client = boto3.client('sns', | |
region_name='eu-west-1', | |
aws_access_key_id=access_key, | |
aws_secret_access_key=secret_key) | |
response = client.publish(TargetArn="arn:aws:sns:eu-west-1:587264368683:kubeless-tweets", Message=json.dumps({'default': json.dumps(tweet)}),MessageStructure='json') | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment