Skip to content

Instantly share code, notes, and snippets.

@sebgoa
Created June 19, 2018 07:15
Show Gist options
  • Save sebgoa/98c215386f461fdd229626261a904c42 to your computer and use it in GitHub Desktop.
Save sebgoa/98c215386f461fdd229626261a904c42 to your computer and use it in GitHub Desktop.
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