jQuery Teamspeak 3 Status

Things you should never do: Creating a PHP script which connects to a different server, to retrieve some information and display it on your website. And you should most certainly not do this on every single page request, without even caching the results. Recently I have been asked to help my brother with a module he downloaded, which did exactly this. So I created this jQuery Plugin instead.

jQuery Teamspeak 3 Status display a simple widget for your Teamspeak server utilizing the Simple REST API from Planet Teamspeak. It basically just displays the number of slots available and the number of users currently connected. You can install the plugin using bower or download it directly from the repository.

bower install jquery-ts3status --save

All you need to know about your server is its ip address and the relevant port. Then you can call ts3status on any container and the plugin will do the rest.

<div id="ts3status"></div>
$('#ts3status').ts3status({
  host: '82.211.30.15',
  port: '9987'
});

By default the markup looks something like this, but you can overwrite the templates using the configuration options explained in the readme file.

<div id="ts3status" class="ts3-success">
  <div class="ts3-name">Planet TeamSpeak(DE)</div>
  <div class="ts3-slots">Slots: 23/100</div>
  <a href="ts3server://84.200.62.248/?port=9987">Connect</a>
</div>

More information on configuration, callbacks and a demo can be found in the readme file of the Github repository. Please let me know, when you stumble across any bug.