Welcome to this page where you will learn how to use the json rpc service. Don't worry, it's very easy and simple to implement.
Basically, this json rpc service has been created for the needs of my drupal's weather module : My main goal was to create a rpc service providing city weather codes. This would prevent users to create a big database on their server.
At this point, the database contains up to 35 000 airport/weather stations codes over the world.
This service will grow, but for now, it just provides a simple search functionality for countries or city names.
Download
Feel free to download the client sample with the jsonRPCClient library. It's just all you need to make searches easily.
How to search
Call a method to find a match with 'belg', this should return a list of belgium cities.
require_once ('jsonRPCClient.php');
$weather = new jsonRPCClient('http://jsonrpc.deepbass.net/server.php?class=weather');
try {
$result = $weather->search('belg');
var_dump($result);
} catch (Exception $e) {
var_dump($e->getMessage());
}
Response from the server
string(73) "Unable to connect to http://jsonrpc.deepbass.net/server.php?class=weather"array(0) {
}