PageSourceSearch

https://www.freshwater-science.org/includes/javascript/libs/api-reporting.js

js freshwater-science.org collected 2026-10-03 20:59:46 UTC 819 bytes, 31 lines download raw bytes

1
2var reportingAPI = function( endpoint ){
3
4    //pass in endoint to be called when initiating.  e.g. 'statistics/read'
5
6    if (typeof msDataBaseUrl !== 'undefined' && msDataBaseUrl) {
7        this.serviceURL = msDataBaseUrl + endpoint;
8    } else if (window.location.hostname === 'localhost') {
9        this.serviceURL = "http://localhost:3000" + endpoint;
10    } else {
11        this.serviceURL = "https://ms-data.membes-ams.com" + endpoint;
12    }
13
14    //get data from endpoint
15    this.getData = function(filters, cb){
16
17        var url = this.serviceURL;
18        for ( const [key,value] of Object.entries(filters) ){
19            url = url + '/' + value;
20        }
21
22        $.ajax({
23            url: url,
24            dataType: "json"
25        }).done(function(response) {
26            cb(response);
27        });
28    };
29
30
31}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.