From f930dfeb875968dc15e96f98e7624646d70ba046 Mon Sep 17 00:00:00 2001 From: Swapnil Agarwal Date: Wed, 20 Apr 2016 08:48:00 +0000 Subject: [PATCH] Add support for HTTPS requests --- README.md | 7 ++++--- modules/src/joke.py | 4 ++-- requirements.txt | 10 ++++++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index eaf702cc..b55c37b2 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ More examples can be found [here](https://github.com/swapagarwal/JARVIS-on-Messe ### Local Development / Testing 1. Clone this repo. -2. `pip install -r requirements.txt` -3. `python jarvis.py` -4. Visit `http://localhost:5000/test/?q=` to see results. +2. `sudo apt-get install python-dev libffi-dev libssl-dev` +3. `pip install -r requirements.txt` +4. `python jarvis.py` +5. Visit `http://localhost:5000/test/?q=` to see results. diff --git a/modules/src/joke.py b/modules/src/joke.py index c17f924e..df6d2068 100644 --- a/modules/src/joke.py +++ b/modules/src/joke.py @@ -7,10 +7,10 @@ def match(input): def process(input): output = {} try: - r = requests.get('http://api.icndb.com/jokes/random') + r = requests.get('https://api.chucknorris.io/jokes/random') data = r.json() output['input'] = input - output['output'] = data['value']['joke'] + output['output'] = data['value'] output['success'] = True except: output['success'] = False diff --git a/requirements.txt b/requirements.txt index 4bdfcec1..5dbc528d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,18 @@ +cffi==1.5.2 +cryptography==1.3.1 +enum34==1.1.3 Flask==0.10.1 +idna==2.1 +ipaddress==1.0.16 itsdangerous==0.24 Jinja2==2.8 MarkupSafe==0.23 +ndg-httpsclient==0.4.0 py==1.4.31 +pyasn1==0.1.9 +pycparser==2.14 +pyOpenSSL==16.0.0 pytest==2.9.1 requests==2.9.1 +six==1.10.0 Werkzeug==0.11.8