Skip to content

Commit

Permalink
removed unused method (after susi removal)
Browse files Browse the repository at this point in the history
  • Loading branch information
Orbiter committed Oct 13, 2016
1 parent 38267fe commit 1866b21
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions src/org/loklak/api/search/ConsoleService.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* TableService
* ConsoleService
* Copyright 13.06.2015 by Michael Peter Christen, @0rb1t3r
*
* This library is free software; you can redistribute it and/or
Expand All @@ -19,21 +19,16 @@

package org.loklak.api.search;

import java.io.IOException;
import java.net.URLEncoder;
import java.util.Date;
import java.util.Set;
import java.util.regex.Pattern;

import org.elasticsearch.search.sort.SortOrder;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;
import org.loklak.api.cms.TwitterAnalysisService;
import org.loklak.data.DAO;
import org.loklak.geo.GeoMark;
import org.loklak.http.ClientConnection;
import org.loklak.objects.AccountEntry;
import org.loklak.objects.QueryEntry;
import org.loklak.objects.ResultList;
Expand Down Expand Up @@ -96,23 +91,6 @@ public String getAPIPath() {

public final static SusiSkills dbAccess = new SusiSkills();

public static void addGenericConsole(String serviceName, String serviceURL, String responseArrayObjectName) {
dbAccess.put(Pattern.compile("SELECT +?(.*?) +?FROM +?" + serviceName + " +?WHERE +?query ??= ??'(.*?)' ??;"), matcher -> {
JSONObject serviceResponse;
try {
ClientConnection cc = new ClientConnection(serviceURL + URLEncoder.encode(matcher.group(2), "UTF-8"));
serviceResponse = new JSONObject(new JSONTokener(cc.inputStream));
cc.close();
} catch (IOException | JSONException e) {serviceResponse = new JSONObject();}
SusiThought json = new SusiThought();
json.setQuery(matcher.group(2));
SusiTransfer transfer = new SusiTransfer(matcher.group(1));
json.setData(transfer.conclude(serviceResponse.getJSONArray(responseArrayObjectName)));
json.setHits(json.getCount());
return json;
});
}

static {
dbAccess.put(Pattern.compile("SELECT +?(.*?) +?FROM +?\\( ??SELECT +?(.*?) ??\\) +?WHERE +?(.*?) ?+IN ?+\\((.*?)\\) ??;"), matcher -> {
String subquery = matcher.group(2).trim();
Expand Down

0 comments on commit 1866b21

Please sign in to comment.