Post by trapped on Feb 18, 2014 19:21:32 GMT -5
UPDATE 2/25: Today, 25th of February 2014, between 17:21 and 17:22 GMT+1, Rob apparently banned my account and blocked my IP. The service will still run, but of course it will return an error explaining that it isn't possible to connect to the game server. Curious thing, Rob hasn't even replied to my PM in which I ask him the reasons why he'd like the service to be shut down.
UPDATE 2/25, 2nd: Today, 25 of February 2014, at around 22:28 GMT+1, Rob disabled the block/ban. This service will no longer retrieve new updates about the server status, although it will still allow you to access cached data.
So this evening I decided to put up this thing.
Basically you GET my server, and it gives you a JSON string with the data you need (and even some more).
You can also embed this little widget I made, which automatically retrieves the status (always from my server): embed.html embed.css embed.js
The gridstatusd daemon on my server caches new data every15 1 minutes.
I'm open to suggestions and/or feature requests.
Have fun with this thing!
(also sorry Rob but I was impatient and just put it online, tell me if I have to take it down)
Changelog 2/19 7:40 AM GMT+1:
UPDATE 2/25, 2nd: Today, 25 of February 2014, at around 22:28 GMT+1, Rob disabled the block/ban. This service will no longer retrieve new updates about the server status, although it will still allow you to access cached data.
So this evening I decided to put up this thing.
Basically you GET my server, and it gives you a JSON string with the data you need (and even some more).
| -> OR
(x) -> x is an optional field
-> GET http://www.pellero.it/gridstatus/(?{name=NAMEARG|pack(=PACKARG)|unpack(=UNPACKARG)|new})
where:
- name Triggers the "name" mode; shows all the cache entries with ID starting with ARGNAME; shows "[]" on error; the shown data is a JSON array
- ARGNAME Argument for "name"
- pack Triggers the "pack" mode; if PACKARG is omitted, shows the latest cached entry in packed form, else packs PACKARG and shows it; shows nothing on error
- PACKARG Argument for "pack"
- unpack Triggers the "unpack" mode; if UNPACKARG is omitted, shows the latest cached entry in unpacked form, else unpacks PACKARG and shows it; shows nothing on error
- UNPACKARG Argument for "unpack"
[s]- new Triggers the "new" mode; shows a on-the-fly retrieved status - always avoid if possible[/s]
<- {"grid12":{"status":true,"id":"201402190053","errno":"","errstr":""}}
"status" = whether the server is online or not
"id" = the cache ID of the server reply, which is just YYYYMMddHHmmss; you can also use it to load an old cached reply: GET http://www.pellero.it/gridstatus/cache/{your ID here}
"errno" = string representation of an integer: 0 for unknown error, 1 for temporary connection problems, 2 for connection timeout; empty if the server is online and the connection is possible
"errstr" = string representing the error (the actual error, not the "errno" field); empty if the server is online and the connection is possible
Packed data format: .[0/1].[DATETIME].[ERRNO].[ERRSTR].
Dumb one but I was too tired to do something more elaborate with PHP.
You can also embed this little widget I made, which automatically retrieves the status (always from my server): embed.html embed.css embed.js
- Add the reference to the CSS file in your page's <head> tag:
<link rel="stylesheet" type="text/css" href="http://www.pellero.it/gridstatus/embed.css">
- Add the HTML code in your page wherever you want to place it; you are free to add the id attribute to the main div of the widget and change its position in your own stylesheet
- Add the reference to the JS file in your page's <head> tag:
<script type="text/javascript" src="http://www.pellero.it/gridstatus/embed.js"></script>
The gridstatusd daemon on my server caches new data every
I'm open to suggestions and/or feature requests.
Have fun with this thing!
(also sorry Rob but I was impatient and just put it online, tell me if I have to take it down)
Changelog 2/19 7:40 AM GMT+1:
- Now checking the server status every minute (thanks Jufda for the suggestion)
- The widget now automatically shows the last check date in the users' local timezone
- Internal changes (usage logging, small attempts at drawing usage/server availability graphs)
- Internal cache storage changes: now the data is packed, allowing me to save 67 bytes of data; with the web API you'll still be able to get the uncompressed data, but if you try to get the single cache file manually it will be packed - you'll have to use the "unpack" feature or unpack it yourself to get the regular JSON output
- Rewrote the basic code for NodeJS in preparation to an eventual future movement to Heroku (free plan of course - hence the storage problem, but it will be solved on another way there)
- Added "new" feature: on-the-fly status checking - please avoid unless necessary, use the normal method
- Added "pack" feature: packs the latest (or the user-provided) data
- Added "unpack" feature: unpacks the latest (or the user-provided) data
- Added "name" feature: returns all the (already unpacked) statuses starting with the string given as argument
- Dropped the use of (G)UIDs: datetimes are unique, so they're just a waste of storage space
Changelog 2/25 10:33 PM GMT+1:
- The service will no longer retrieve new updates about the server status, but will still be able to give you cached data.