mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2026-03-10 18:55:03 +00:00
Lambdaify Kohls scraping
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
This commit is contained in:
19
Lambdas/Scraping/runOrchestrator.py
Normal file
19
Lambdas/Scraping/runOrchestrator.py
Normal file
@@ -0,0 +1,19 @@
|
||||
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!')
|
||||
}
|
||||
Reference in New Issue
Block a user