added json(p) endpoint for crawl start

This commit is contained in:
Michael Peter Christen 2017-06-16 08:44:40 +02:00
parent 83ba45ebae
commit 369b8e0e0b
2 changed files with 16 additions and 0 deletions

View File

@ -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();

6
htroot/Crawler_p.json Normal file
View File

@ -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]#