[WEB/ADMIN/API] BukGet: The Unofficial BukkitDev JSON API

Discussion in 'Bukkit Tools' started by SteveMcGrath, Dec 4, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Bertware

    Maybe you could redirect notifications from the github bug tracker to [email protected] .
    A small form on bukget.org could be used to let others send some feedback on availability issues, feedback would be sent to that email address.
    If the parser encounters severe problems, it could send a mail too.

    Then, all mails would be collected in this one mail address, and you can either forward them to you and other people, or view them on this account. This would give you some sort of real-time updates if the server needs to be checked.

    Just an idea.
     
  2. Offline

    SteveMcGrath

    I have had some ideas along this line, however I also wanted to do some sort of a dashboard showing up/down availability of the API's various functions. As it has been just me, all of these features have been back-burnered to more pressing needs. If someone is willing to assist, then these needs will get a higher priority.
     
  3. Offline

    Bertware

    PHP:
    <?
        
    $bukget_available=GetServerStatus("bukget.org");
        
    $api_bukget_available=GetServerStatus("api.bukget.org");
        
    $bukkitdev_available=GetServerStatus("dev.bukkit.org");
     
        if (
    $bukget_available) { echo('<a style="color:green">bukget.org main server online</a><br>');}else { echo('<a style="color:red">bukget.org main server offline!</a><br>');}
        if (
    $api_bukget_available) { echo('<a style="color:green">api.bukget.org server online</a><br>');}else { echo('<a style="color:red">api.bukget.org server offline!</a><br>');}
        if (
    $bukkitdev_available) { echo('<a style="color:green">dev.bukkit.org is available</a><br>');}else { echo('<a style="color:red">dev.bukkit.org is unavailable!</a><br>');}
     
     
     
        if (
    $api_bukget_available) {
            
    $status=file_get_contents("http://api.bukget.org/3/geninfo");
            
    $status_decode=json_decode(trim($status,"[], "));
            echo(
    'Last update on ' date("Y-m-d H:s",$status_decode->{"timestamp"}) . '<br>');
            echo(
    'Update type: ' $status_decode->{"type"} . '<br>');
        } else {
            echo(
    '<a style="color:red">api.bukget.org server offline!</a><br>');
        }
     
    function 
    GetServerStatus($site){
        
    //Based upon http://corpocrat.com/2009/03/01/php-script-to-check-server-status-onlineoffline/
        
    $fp = @fsockopen($site80$errno$errstr2);
        if (!
    $fp) {
            return 
    false;
        } else {
            return 
    true;
        }
    }
    ?>
    Small script that checks the server, it's something that could be worked out a little more to a user-friendly status panel.
    ( http://bertware.net/bukget/status.php )
    Maybe with an option to report server problems.
    A cron job could do this check every x time and mail in case of trouble.
     
  4. Offline

    SteveMcGrath

  5. Offline

    Bertware

    That script could be extended by a function to save warnings. A user form (user reporting problems), or an automated Cron job could save a warning when something goes wrong. This could be mailed to a central mail address and the message could be shown on the status page (Viewing those messages and logs could be limited to admins etc. )

    Just some ideas, as it's more practical then ssh'ing into the server every time, or check every server manually.
     
  6. Offline

    SteveMcGrath

    Oh I agree. It's definitely on my list of things todo. I have been working on documenting how everything works together as a first step. This should help people understand how all of the components work together as well as see how everything lays out on my boxes. Brings the ramp-up time for any potential volunteers down significantly. Below is the current design doc based on where I'm at with it now.

    https://github.com/BukGet/bukget/blob/master/docs/design.md
     
  7. Offline

    user_43347

    Bertware Why not just use jQuery so the page doesn't take a while to load if the server is down? Also, slim down the font color statements to a basic inline if statement like:
    PHP:
    <p style="color: <?php echo($available 'green' 'red'); ?>">Server is <?php echo($available 'online' 'offline'); ?></p>
    Also, you can just return the socket and not assign it to a variable.
     
  8. Offline

    SteveMcGrath

    ...or you could just look at the JQuery-based stats page we released a week or two ago.

    http://bukget.org/pages/stats.html
     
  9. Offline

    user_43347

    Well, I guess I haven't been paying attention. Well then.
     
  10. Offline

    SteveMcGrath

    :-p

    most of the day-to-day dev activity happens in the IRC channel, and I post updates to the blog. This forum thread really doesnt get the love is deserves TBH, but I wanted to do something like that stats page for a while. It just so happened that @Bertware's PHP code gave me the kick in the pants to actually hack enough javascript together to make it work.

    Currently a lot of work is being done to support multiple servers, which is requiring unexpected code changes to support slave databases and for a complete rewrite of the log parser to get things like popularity working properly across multi-server.

    Speaking of popularity. It has been slightly on the fritz for the past few weeks, mostly after the server switch. This is more due to the fact that cronjobs weren't running as I expected them to, which ment that things were getting rolled up weekly instead of daily. the correction has already been made and the numbers should slowly float down to normal.

    Lastly, I'm hoping to start addressing the last support staff. BukGet has a new volunteer Admin thats been slowly ramping up [TwixtedChaox in IRC] and I'm hoping to have him ramped up with everything within a month and be able to act on my behalf to the odd issue that occurs.

    bump.
     
  11. Offline

    Puseidr

    a lot of plugins aren't updating on bukget :(
     
  12. Offline

    SteveMcGrath

    I am aware of this, and am running a generation as we speak to correct. I'm wondering if the BukkitDev site format has changed (again) and that is causing the breaks.

    I just found the issue. It looks like BukkitDev changed all of their URLs to /bukkit-mods/ from /server-mods/ and /client-mods/. This is causing the break. I'm working on adjusting this now.

    Also, people need to tell me when they think things are breaking. post here, send a message on IRC, or post an issue ticket on github.

    Updates are working!

    [​IMG]

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  13. Offline

    merryxmaschaz

    Yay, look forward to checking it out.
     
Thread Status:
Not open for further replies.

Share This Page