From 7c4305d64695022cc0cd2c6bd2db31287b807862 Mon Sep 17 00:00:00 2001 From: Sebastian Steiner Date: Sun, 20 Jan 2019 17:24:16 +0100 Subject: [PATCH] smalle error fixed in sentiment analysis.py, readmes adjusted --- service-analysis/Dockerfile | 2 +- service-analysis/sentiment_analysis.py | 3 +-- service-twitter/README.md | 8 ++------ 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/service-analysis/Dockerfile b/service-analysis/Dockerfile index c9bbb69..508af5e 100644 --- a/service-analysis/Dockerfile +++ b/service-analysis/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.7-slim -LABEL maintainer="Sebastian Steiner" +LABEL maintainer="Sebastian Steiner " WORKDIR /app COPY *.py /app/ diff --git a/service-analysis/sentiment_analysis.py b/service-analysis/sentiment_analysis.py index a190266..e84402f 100644 --- a/service-analysis/sentiment_analysis.py +++ b/service-analysis/sentiment_analysis.py @@ -13,8 +13,7 @@ from flask_restful import Api app = Flask(__name__) api = Api(app) -with open('indico_api_key.txt', 'r') as key: - indicoio.config.api_key = os.environ['INDICO_API_KEY'] +indicoio.config.api_key = os.environ['INDICO_API_KEY'] api.add_resource(Analysis, '/') api.add_resource(Offline_Analysis, '/offline_analysis') diff --git a/service-twitter/README.md b/service-twitter/README.md index 7df93f3..d243d03 100644 --- a/service-twitter/README.md +++ b/service-twitter/README.md @@ -22,15 +22,11 @@ Unfortunately you have to provide your own API Keys, as sharing them is forbidde I really don't want to risk it, as my application for a [Twitter Developer Platform](https://developer.twitter.com/) account was ridiculously complicated. You have to answer four questions, with at least 400 (?) words, and as detailed as possible. My application apparently wasn't detailed enough, so they asked me follow up questions. After two emails, one with ~1.200 words, they were finally satisfied. Furthermore people with an existing account, like I had, can't create new apps anymore, unless they apply again. So I would advise you to [apply for an account](https://developer.twitter.com/en/apply-for-access) yourself, or maybe ask someone else from the group if they have a spare key. - -The twitter api keys can be set in the file `TODO`. - -The keys then go into `application.yml` below `oauth:`, i.e. `consumer-key`, `consumer-secret`, `access-token`, -`access-token-secret`. +The twitter api keys can be set in the file `twitter.env`. ## run with docker - `docker image build -t service-twitter .` -- `docker container run --env-file=` TODO `-d -p YOUR_PORT:8084 service-twitter:latest` +- `docker container run --env-file=twitter.env -d -p YOUR_PORT:8084 service-twitter:latest` ## run local ### requirements -- 2.43.0