Skip to content

Rezaldy/RainAccuracy

Repository files navigation

RainAccuracy

This Rain Accuracy meter shows the accuracy of rain forecasts on a specified times, between 2 different (or equal) specified times.

The application has a simple login form, generated by Laravel's Auth Facade. For the most part, Bootstrap was used to build up the pages, and all data is requested through API's.

Data is crawled from the Buienradar API every 5 minutes, and then saved to the DB.

Only two Models are present. User (Provided by Laravel's Auth Façade) and Data.

API Info

#general

Get the last data from DB from a certain time to the end

Example request:

curl -X GET "http://app.fluxdev.nl/api/lastData/{hour}/{minute}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://app.fluxdev.nl/api/lastData/{hour}/{minute}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

[
	"12:50:00",
	"12:55:00",
	"13:00:00",
	"13:05:00",
	"13:10:00",
	"13:20:00",
	"13:25:00",
	"13:30:00",
	"13:35:00",
	"13:40:00",
	"13:45:00",
	"13:50:00",
	"13:55:00",
	"14:00:00",
	"14:05:00",
	"14:10:00",
	"14:15:00",
	"14:25:00",
	"14:35:00",
	"14:40:00",
	"14:45:00",
	"14:50:00",
	"14:55:00",
	"15:00:00",
	"15:05:00",
	"15:10:00",
	"15:15:00",
	"15:30:00",
	"15:35:00",
	"15:55:00",
	"16:05:00",
	"16:15:00",
	"16:25:00",
	"16:30:00",
	"16:40:00",
	"16:45:00"
]

HTTP Request

GET api/lastData/{hour}/{minute}

HEAD api/lastData/{hour}/{minute}

Compare two data and return intersecting times

Example request:

curl -X GET "http://app.fluxdev.nl/api/intersectData/{hour1}/{minute1}/{hour2}/{minute2}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://app.fluxdev.nl/api/intersectData/{hour1}/{minute1}/{hour2}/{minute2}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
	14:00: {
		rainAmount: "000",
		time: "14:00"
	},
	14:05: {
		rainAmount: "000",
		time: "14:05"
	},
	14:10: {
		rainAmount: "000",
		time: "14:10"
	},
	14:15: {
		rainAmount: "000",
		time: "14:15"
	},
	14:20: {
		rainAmount: "000",
		time: "14:20"
	},
	14:25: {
		rainAmount: "000",
		time: "14:25"
	},
	14:30: {
		rainAmount: "000",
		time: "14:30"
	},
	14:35: {
		rainAmount: "000",
		time: "14:35"
	},
	14:40: {
		rainAmount: "000",
		time: "14:40"
	},
	14:45: {
		rainAmount: "000",
		time: "14:45"
	}
}

HTTP Request

GET api/intersectData/{hour1}/{minute1}/{hour2}/{minute2}

HEAD api/intersectData/{hour1}/{minute1}/{hour2}/{minute2}

api/data/{hour1}/{minute1}/{hour2}/{minute2}/{hourIntersect}/{minuteIntersect}

Example request:

curl -X GET "http://app.fluxdev.nl/api/data/{hour1}/{minute1}/{hour2}/{minute2}/{hourIntersect}/{minuteIntersect}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://app.fluxdev.nl/api/data/{hour1}/{minute1}/{hour2}/{minute2}/{hourIntersect}/{minuteIntersect}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
        early: {
                rainAmount: "000",
                time: "13:00"
        },
        late: {
                rainAmount: "000",
                time: "13:00"
        }
}

HTTP Request

GET api/data/{hour1}/{minute1}/{hour2}/{minute2}/{hourIntersect}/{minuteIntersect}

HEAD api/data/{hour1}/{minute1}/{hour2}/{minute2}/{hourIntersect}/{minuteIntersect}

About

Measures rain accuracy at one location.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published