Ein paar kleine Tutorials wie man die API in versch. Programmiersprachen am einfachsten benutzt.
<?php
// you need to have curl installed / file_get_contents() is very slow!
$curl = curl_init();
$day = 2;
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'http://e2fi.eu/s/api/day/'.$day,
));
$data = curl_exec($curl);
curl_close($curl);
$array = json_decode($data, true); // json string to array
var_dump($array);
curl http://e2fi.eu/s/api/day/2
// requires jQuery
$.getJSON( "http://e2fi.eu/s/api/day/2", function( data ) {
console.log( data );
});
import requests
data = requests.get('http://e2fi.eu/s/api/day/2').json()
print data
require "net/http"
require "uri"
uri = URI.parse("http://e2fi.eu/s/api/day/2")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
puts response.body
<h1>This is a flower pot.</h1>