OLD | NEW |
1 function get(url, callback) | 1 function get(url, callback) |
2 { | 2 { |
3 let request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"] | 3 let request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"] |
4 .createInstance(Ci.nsIXMLHttpRequest); | 4 .createInstance(Ci.nsIXMLHttpRequest); |
5 request.mozBackgroundRequest = true; | 5 request.mozBackgroundRequest = true; |
6 request.open("GET", url); | 6 request.open("GET", url); |
7 if (callback) | 7 if (callback) |
8 request.addEventListener("load", callback.bind(undefined, request)); | 8 request.addEventListener("load", callback.bind(undefined, request)); |
9 request.send(); | 9 request.send(); |
10 } | 10 } |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 Client.fetchCrawlableSites = function(backendUrl, callback) | 29 Client.fetchCrawlableSites = function(backendUrl, callback) |
30 { | 30 { |
31 get(backendUrl + "/crawlableSites", function(request) | 31 get(backendUrl + "/crawlableSites", function(request) |
32 { | 32 { |
33 let sites = request.responseText.trim().split("\n"); | 33 let sites = request.responseText.trim().split("\n"); |
34 callback(sites); | 34 callback(sites); |
35 }); | 35 }); |
36 }; | 36 }; |
37 | 37 |
38 Client.sendCrawlerDataFile = function(backendUrl, dataFilePath, callback) | 38 Client.sendRequestsFile = function(backendUrl, requestsFilePath, callback) |
39 { | 39 { |
40 postFile(backendUrl + "/crawlerData", dataFilePath, callback); | 40 postFile(backendUrl + "/crawlerRequests", requestsFilePath, callback); |
41 }; | 41 }; |
OLD | NEW |