Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
added json(p) endpoint for crawl start
Michael Peter Christen369b8e0e0b86
diff --git a/htroot/Crawler_p.java b/htroot/Crawler_p.javaindex 4d1bae75d..b8b249688 100644--- a/htroot/Crawler_p.java+++ b/htroot/Crawler_p.java@@ -90,6 +90,16 @@ public class Crawler_p {// inital values for AJAX Elements (without JavaScript)final serverObjects prop = new serverObjects();prop.put("rejected", 0);++ // check for JSONP+ if (post != null && post.containsKey("callback") ) {+ final String jsonp = post.get("callback") + "([";+ prop.put("jsonp-start", jsonp);+ prop.put("jsonp-end", "])");+ } else {+ prop.put("jsonp-start", "");+ prop.put("jsonp-end", "");+ }Segment segment = sb.index;Fulltext fulltext = segment.fulltext();diff --git a/htroot/Crawler_p.json b/htroot/Crawler_p.jsonnew file mode 100644index 000000000..b2f6c1fe2--- /dev/null+++ b/htroot/Crawler_p.json@@ -0,0 +1,6 @@+#[jsonp-start]#+{+ "success": "true",+ "comment": "#(info)#::Error with profile management. Please stop YaCy, delete the file DATA/PLASMADB/crawlProfiles0.db and restart. ::Error: #[errmsg]# ::Application not yet initialized. Sorry. Please wait some seconds and repeat the request. ::ERROR: Crawl filter '#[newcrawlingfilter]#' does not match with crawl root '#[crawlingStart]#'.Please try again with different filter.::Crawling of '#[crawlingURL]#' failed. Reason: #[reasonString]#::Error with URL input '#[crawlingStart]#': #[error]#::Error with file input '#[crawlingStart]#': #[error]# ::Crawling of '#[crawlingURL]#' started.#(/info)#"+}+#[jsonp-end]#\ No newline at end of file