mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-15 10:28:46 +00:00
Move to Lambda function setup and add orchestration and word lists for full runs. Credit for the word lists goes to: http://www.desiquintans.com/nounlist
19 lines
559 B
Python
19 lines
559 B
Python
import json
|
|
import boto3
|
|
|
|
def lambda_handler(event, context):
|
|
with open("words.txt") as words_file:
|
|
words = json.load(words_file)
|
|
print(words)
|
|
for word in words:
|
|
client = boto3.client('lambda')
|
|
response = client.invoke(
|
|
FunctionName='KohlsScraper',
|
|
InvocationType="Event",
|
|
LogType="None",
|
|
Payload= """{"toScrape": \"""" + word + "\"}"
|
|
)
|
|
return {
|
|
'statusCode': 200,
|
|
'body': json.dumps('Hello from Lambda!')
|
|
} |