updating sendToSQS.py

This commit is contained in:
2019-10-05 20:55:59 +01:00
parent 8320c7ec09
commit 68dc885110
2 changed files with 14 additions and 1 deletions

View File

@@ -1,7 +1,20 @@
import boto3
import os
import sys
sys.path.append(os.getcwd())
from pullTrafficInfo import getTrafficInfo
import base64
import emoji
session = boto3.Session(profile_name='plex-aws')
sqs = session.resource('sqs')
queue = sqs.create_queue(QueueName='test', Attributes={'DelaySeconds': '5'})
# queue = sqs.create_queue(QueueName='test', Attributes={'DelaySeconds': '5'})
inst = getTrafficInfo.getTrafficURL('A50').findIncidents() \
.getIncidentInformation().generateOutput()
inst.output
encoded = base64.b64encode(inst.output[0].encode())
decoded = base64.b64decode(encoded).decode()