Anope IRC Services

MagIRC => MagIRC Support => Topic started by: Matze on December 12, 2013, 09:04:14 PM

Title: Serverstatus-Icon incorporate into new page
Post by: Matze on December 12, 2013, 09:04:14 PM
Hello,

there is a possibility, to get the Status from the Server on a other site?
I have build a serverlist on a other site and i want to take the status of the servers from the MagIRC-serverlist

Is there a walkthrough?

greetz,
matze
Title: Re: Serverstatus-Icon incorporate into new page
Post by: Hal9000 on December 14, 2013, 11:44:59 AM
Hi Matze, yes you can.
You can use the REST service, for MagIRC 0.8.x it's rest/denora.php, for MagIRC 0.9.x it's rest/service.php
Unfortunately there is no comprehensive documentation yet, but the file itself provides some inline documentation with example calls.
So what you need is to use the /servers (to get all servers) or /server/<servername> (to get the specified server). A good way would be to make an AJAX call.
As a response you will get a JSON object which you can easily use in JavaScript or other means.
So for example you can do http://www.denorastats.org/magirc/rest/denora.php/servers
or http://www.denorastats.org/magirc/rest/denora.php/servers/colossus.teranova.net