Skip to content

Instantly share code, notes, and snippets.

@miztiik
Created August 23, 2016 06:51
Show Gist options
  • Save miztiik/e917ceb6e3a2084c6d5954b9bfcfbcc3 to your computer and use it in GitHub Desktop.
Save miztiik/e917ceb6e3a2084c6d5954b9bfcfbcc3 to your computer and use it in GitHub Desktop.
AWS Lamda experiment to fetch media metadata from OMDB using their API
def lambda_handler(event, context):
import requests, json
r = requests.get('http://www.omdbapi.com/?t=titanic&y=1997&plot=short&r=json')
mediaMetadata = r.json()
print json.dumps( mediaMetadata, indent=4, sort_keys=True )
return {json.dumps( mediaMetadata, indent=4, sort_keys=True )}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment