[INACTIVE][ADMN/WEB] ApiCraft v0.2 - Web API system for CraftBukkit server [531]

Discussion in 'Inactive/Unsupported Plugins' started by KokaKiwi, Mar 16, 2011.

  1. Offline

    KokaKiwi

    ApiCraft - Web API system for CraftBukkit:
    Version: v0.2

    ApiCraft provide a Web API system for CraftBukkit servers, and can be easily extensible for plugins developers!

    The API can be fetched by using URL: http://[server-ip]:6561/[api]

    This plugin provide some basics API, but it can be extended by plugins developers in their plugins.
    You can add an API URL by using ApiListener class like others Listener classes:
    Code:
    public class ApiCraftListener extends ApiListener {
        @Override
        public void onApiEvent(ApiEvent event) {
            if(event.path[0].equalsIgnoreCase("serverinfos"))
            {
                if(event.path.length > 1)
                {
                    if(event.path[1].equalsIgnoreCase("online"))
                    {
                        Player[] online = event.getPlugin().getServer().getOnlinePlayers();
                        event.setResponse(online.length + "");
                        event.setActionTaken(true);
                    }else {
                        event.setResponse("API not found.");
                        event.setActionTaken(true);
                    }
                }else {
                    event.setResponse("APIs available for 'serverinfos' : online, players-online");
                    event.setActionTaken(true);
                }
            }
        }
    
    }
    event.setResponse() is used to set Response to send to client. It accepts String, Map and List values.
    event.setActionTaken() is used to say to webserver that there is a response available.

    API response can be displayed in Plain Text or XML Format, by using "?format=plaintext|xml" in the end of URL.

    Features:
    Download ApiCraft v0.2
    Source Code

    Changelog:
    Version 0.1

    • First version
    Version 0.2
    • Improved Plain Text and XML Formatters
    • Added Json Output
    • Added whois and max-players to basic API
    ToDo:

    • Add some basics informations in base API
    • Add token verification for users
     
    sinkir, zok and SpeedKeks like this.
  2. Offline

    Plague

    Since users report it as working, I'm not gonna move it, but seriously, update your thread!
     
  3. Offline

    tha d0ctor

    lol yea it works on 684 still dunno about 733

    damn godaddy blocks that php command to get the info strings in the example php code above
     
  4. Offline

    Alec Gorge

  5. Offline

    Plague

    @KokaKiwi now seriously can you update the title appropriately or is this inactive?
     
  6. Offline

    KokaKiwi

    The plugin is inactive for the moment, I don't have the time to work on it yet =/
     
  7. Offline

    NateLogan

    Could you add an option to select default formatter?

    Also you should check for NullPointerException at "event.setResponse(null)"
     
  8. Offline

    Quick_Wango

    My Fork of the project is almost done.
    It will include a whole new system to add own APIs.
    A basic API with many new features will by available as well.
     
  9. Offline

    marshall007

    Is your fork still in development?
     
  10. Offline

    firewalled

Share This Page