From b0752cff47fead1ed0db26d061674eff4b5fbaeb Mon Sep 17 00:00:00 2001 From: george Date: Tue, 22 Sep 2020 13:14:18 +0300 Subject: [PATCH 1/2] change print to python 3 format --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a5fc9fc..1fd2f8f 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,15 @@ A simple way to access the [Webhose.io](https://webhose.io) API from your Python ```python import webhoseio - + webhoseio.config(token=YOUR_API_KEY) output = webhoseio.query("filterWebContent", {"q":"github"}) - print output['posts'][0]['text'] # Print the text of the first post - print output['posts'][0]['published'] # Print the text of the first post publication date + print(output['posts'][0]['text']) # Print the text of the first post + print(output['posts'][0]['published']) # Print the text of the first post publication date # Get the next batch of posts output = webhoseio.get_next() - print output['posts'][0]['thread']['site'] # Print the site of the first post - + print(output['posts'][0]['thread']['site']) # Print the site of the first post ``` From 75e8553a18204665b4882277b8ca5c9c38898059 Mon Sep 17 00:00:00 2001 From: george Date: Tue, 22 Sep 2020 13:14:57 +0300 Subject: [PATCH 2/2] change request schema to https --- webhoseio/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webhoseio/__init__.py b/webhoseio/__init__.py index 0fdb3fc..b3c006d 100644 --- a/webhoseio/__init__.py +++ b/webhoseio/__init__.py @@ -13,8 +13,8 @@ def query(self, end_point_str, param_dict=None): if param_dict is not None: param_dict.update({"token": self.token}) param_dict.update({"format": "json"}) - - response = self.session.get("http://webhose.io/" + end_point_str, params=param_dict) + + response = self.session.get("https://webhose.io/" + end_point_str, params=param_dict) if response.status_code != 200: raise Exception(response.text)