Skip to content

Commit

Permalink
Change project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibF committed Sep 16, 2018
1 parent 3de7208 commit e3946ba
Show file tree
Hide file tree
Showing 29 changed files with 589 additions and 346 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ RUN pip3 install youtube-dl
RUN pip3 install boto3
RUN apt-get install -qqy locales


RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

CMD ["python3", "/src/bin/consumerSQS/main.py"]
CMD ["python3", "/src/bin/main.py"]


3 changes: 3 additions & 0 deletions consumerSQS/config.py.template → config.py.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ config = {
"access_key" : "",
"secret_access_key" : "",
"library_path": ""
"region_name":"",
"endpoint_url":"",
"QueueName":""
}
12 changes: 0 additions & 12 deletions consumerSQS/answer.py

This file was deleted.

43 changes: 0 additions & 43 deletions consumerSQS/consumer.py

This file was deleted.

183 changes: 0 additions & 183 deletions consumerSQS/librarian.py

This file was deleted.

65 changes: 0 additions & 65 deletions consumerSQS/main.py

This file was deleted.

3 changes: 0 additions & 3 deletions consumerSQS/message.py

This file was deleted.

29 changes: 0 additions & 29 deletions consumerSQS/messageFacebook.py

This file was deleted.

Empty file added fifo_parser/__init__.py
Empty file.
24 changes: 24 additions & 0 deletions fifo_parser/facebookmessage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import json


class FacebookMessage:
def __init__(self, body):
self.body = json.loads(body)
if type(self.body) == str:
self.body = json.loads(self.body)
if type(self.body) == str:
self.body = json.loads(self.body)

def get_sender_id(self):
sender_id = self.body["entry"][0]["messaging"][0]["sender"]["id"]
return sender_id

def get_text(self):
text = self.body["entry"][0]["messaging"][0]["message"]["text"]
return text

def get_url(self):
url = ""
if len(url) < 1:
raise AttributeError
return url
Loading

0 comments on commit e3946ba

Please sign in to comment.