Skip to content

Instantly share code, notes, and snippets.

@sh1n0b1
Created June 27, 2018 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sh1n0b1/3fc27cf4672f11c344d3db6817e2e625 to your computer and use it in GitHub Desktop.
Save sh1n0b1/3fc27cf4672f11c344d3db6817e2e625 to your computer and use it in GitHub Desktop.
HashTag Lambda Function
import subprocess, json
def lambda_handler(event, context):
command = ['python','HashTag.py', '-sh', event['pathParameters']['hash']]
process = subprocess.Popen(command, shell=False, stdout=subprocess.PIPE)
message = process.stdout.read()
response = {
"isBase64Encoded": False,
"statusCode": 200,
"headers": {},
"body": message
}
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment