more details and japanese document are here.


How to Register Graphs

To create graphs or update data, make a request to the following URL via a POST method.

http://hayamiz.com:4080/api/:service_name/:section_name/:graph_name

The names of the items within the URL to POST to are shown in the table to the right.

You can use multi-byte strings for each item name as long as it is UTF-8.

The Name Used in the Example Purpose Actual Parameters
:service_name The name of the service that you'd like to graph blog, photo, place, socialgame
:section_name The name of the feature or system to graph, within said service. entry, user, spot, items
:graph_name The actual name of the value being graphed total_entry, kakin_user, muryo_user

For example, if we are graphing the number of registered users in a social game, we would POST to the following URL:

http://hayamiz.com:4080/api/socialgame/member/register

Also, we would use the following parametens when POSTing.

Parameter Description Required/Optional
number The number to give the graph Required
mode Update method for the number: count, modified, gauge。
count
Add the number and update
modified
Overwritten only when the numbers different from the previous
gauge
Always overwritten by the number
derive
Always overwritten by the number. To Display figures in per seconds
Default is "gauge"
The data type is determined at first time. Can't change mode from DERIVE to other and other to DERIVE.
Optional
color The color of the grah. Specify with #FFFFFF format. Optional (auto-generated if unspecified in a new graph)
description short description of this Graph Option

Example: Creating a New Graph

The example below shows how to create a new graph or update an existing one, using Perl's LWP module.

my $ua = LWP::UserAgent->new;
$ua->post('http://hayamiz.com:4080/api/socialgame/member/register', {
    number      => 10,
    color       => '#333399'
});

If using curl:

$ curl -F number=10 http://hayamiz.com:4080/api/socialgame/member/register