def amazon(album): conn = ECSConnection(aws_access_key_id='AKIAJBGKXZBAD2PVHD6A',aws_secret_access_key='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') music = conn.item_search('MP3Downloads', Title=album)#, Count=1, Sort='salesrank') for result in music: return result.DetailPageURL
def amazonSearch(): title = request.GET.get('title') artist = request.GET.get('artist') conn = ECSConnection(aws_access_key_id='AKIAJBGKXZBAD2PVHD6A',aws_secret_access_key='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') music = conn.item_search("Music", Title=title, Artist=artist) for result in music: return json.dumps({'url' : result.DetailPageURL})