diff --git a/loklak.py b/loklak.py index 0fa5f35..9612dad 100644 --- a/loklak.py +++ b/loklak.py @@ -287,34 +287,6 @@ def settings(self): ' only localhost clients are granted.') return json.dumps(return_to_user) - def susi(self, query=None): - """Retrieve Susi query response. - - Args: - query (str): Query term. - - Returns: - json: Susi response. - - """ - susi_application = 'susi/chat.json' - url_to_give = self.baseUrlSusi + susi_application - self.query = query - if query: - params = {} - params['q'] = self.query - return_to_user = requests.get(url_to_give, params=params) - if return_to_user.status_code == 200: - return return_to_user.json() - else: - return_to_user = {} - return_to_user['error'] = ('Looks like there is a problem in susi replying.') - return json.dumps(return_to_user) - else: - return_to_user = {} - return_to_user['error'] = ('Please ask susi something.') - return json.dumps(return_to_user) - def search(self, query=None, since=None, until=None, from_user=None, count=None): """Handle the searching. diff --git a/sample.py b/sample.py index 322116e..e6e2495 100644 --- a/sample.py +++ b/sample.py @@ -25,10 +25,6 @@ hello = l.hello() pprint(hello) -# Loklak Susi API -susi = l.susi('Hi I am Sudheesh') -pprint(susi) - # Loklak Peers API peers = l.peers() diff --git a/tests/test.py b/tests/test.py index c0d6d4a..56dd756 100644 --- a/tests/test.py +++ b/tests/test.py @@ -97,11 +97,6 @@ def test_user(self): self.assertTrue('name' in result['user']) self.assertTrue('screen_name' in result['user']) - def test_susi(self): - """Susi test.""" - result = self.loklak.susi('Hi I am Sudheesh') - self.assertTrue(len(result['answers']) >= 1) - def test_search(self): """Test search result.""" result = self.loklak.search('doctor who', count=18)