SimpleHTTPListener: Bridge Votifier and Your Website with Ease
Running a Minecraft server means constantly looking for ways to reward players and grow your community. Voting sites like mcserverstatus or Minestatus help drive new players to your server, but keeping track of who voted and automating rewards can be a headache. That is where SimpleHTTPListener comes in. This lightweight Bukkit plugin acts as a bridge between Votifier and your own PHP-powered API, sending vote data directly to your website so you can build custom leaderboards, reward systems, or analytics dashboards without wrestling with complex integration.
What Is SimpleHTTPListener?
SimpleHTTPListener is a focused, no-frills plugin designed to relay vote notifications from Votifier to a PHP script of your choice via an HTTP POST request. When a player votes on a supported voting site, Votifier captures the event and passes the information to SimpleHTTPListener. The plugin then encodes the vote details into JSON and sends them to the URL you specify in the configuration. It does not replace Votifier; instead, it works alongside it, giving server owners the freedom to process vote data in any way they see fit.
The plugin was originally created to solve a specific problem: the developer needed a simple way to feed vote information from Votifier into a custom website backend. Rather than building an all-in-one solution, SimpleHTTPListener stays lean and lets you handle the heavy lifting on the PHP side. This modular approach means you can run multiple listener plugins simultaneously, each serving a different purpose.
How It Works
Once installed and configured, SimpleHTTPListener listens for vote events from Votifier. When a vote comes in, it constructs a JSON payload containing the following fields:
- username – the name the player entered on the voting website
- service – the name of the voting service (e.g., Minestatus)
- ip – the IP address of the voter
- timestamp – the date and time of the vote, as provided by the voting site
- key – a configurable token for basic authentication
This JSON is sent as a POST variable named request to the API endpoint you set in the config file. A typical payload looks like this:
{"timestamp":"2013-06-21 02:29:12 -0700","username":"Test Notification","service":"Minestatus","key":"pleaseChangeMe","ip":"127.0.0.1"}
Your PHP script can then decode this with a single line: $vote = json_decode($_POST['request'], true); and access each piece of data using standard array syntax, such as $vote['username'].
Installation and Setup
Getting SimpleHTTPListener up and running is straightforward, but there are a few important details to keep in mind:
- Placement: Despite its name, SimpleHTTPListener is a standalone plugin. Place the .jar file inside your server’s
pluginsfolder, not in the Votifier listeners directory. - Dependencies: You must have a CraftBukkit-compatible server and Votifier already installed and configured. Without Votifier, the plugin cannot receive vote notifications.
- Web hosting: You need a web server with PHP support (and optionally MySQL) to host your API endpoint. The plugin sends data to a URL, so a local file path will not work.
After placing the plugin, restart your server to generate the default configuration file. Open plugins/SimpleHTTPListener/config.yml and adjust the settings to match your environment.
Configuration Options
The configuration is minimal but covers the essentials. Under the request section you will find:
- url: The full HTTP path to your PHP API, for example
http://example.com/doVote.php. This is where the JSON payload will be sent. - tokenKey: A password-like string that is included in every request. Change this from the default immediately. While not a complete security solution, it prevents random bots from abusing your endpoint if the URL is discovered.
The config section handles optional in-game announcements:
- broadcast: Set to
trueto broadcast a message to all online players whenever someone votes. - messageBroadcast: The message shown to players. You can use
%nfor the voter’s username and%sfor the service name. For example:&a%n just voted on %s!
Usage Scenarios and API Integration
The real power of SimpleHTTPListener lies in what you do with the data once it reaches your website. Since the plugin simply forwards vote information, you can build virtually any system you imagine. Some popular use cases include:
- Voting highscores: Maintain a leaderboard of top voters over the past week or month, displayed on your server’s website.
- Automatic rewards: Use the PHP script to insert a record into a database, then have a separate plugin or command block system grant in-game items or currency when the player logs in.
- Analytics: Log every vote with timestamps, IP addresses, and service names. Combine this with GeoIP to see where your voters are located, or analyze which voting sites drive the most traffic.
- Custom notifications: Send a Discord webhook, email, or push notification when a vote is cast.
SimpleHTTPListener opens up many possibilities for server owners. While this plugin focuses on vote tracking, if you are also looking to enhance your single-player or multiplayer experience with client-side mods, the foxygame.net launcher makes it easy to browse and install mods right from its menu, offering a modern and flexible way to keep your game fresh.
On the PHP side, parsing the data is trivial. After decoding the JSON, you can insert the information into a MySQL database, update a text file, or trigger any other action. Because the plugin does not enforce a specific database schema, you have complete control over how votes are stored and retrieved.
Security Considerations
While the tokenKey adds a layer of protection, it is transmitted as part of the POST body and should not be considered bulletproof. To improve security, you can:
- Use HTTPS for your API endpoint to encrypt the data in transit.
- Validate the tokenKey on the PHP side and reject any requests with an incorrect key.
- Implement IP whitelisting or rate limiting on your web server to prevent abuse.
- Regularly change the tokenKey and keep your API URL private.
Since the timestamp comes directly from the voting website, be aware that its format may vary. Some sites send a Unix epoch, others a human-readable date. Your PHP script should be flexible enough to handle both, or you can standardize the format before storing it.
Conclusion
SimpleHTTPListener fills a very specific niche in the Minecraft server ecosystem: it seamlessly connects Votifier to a custom PHP backend without adding unnecessary complexity. Whether you want to build a voting hall of fame, automate rewards, or simply gather data about your player base, this plugin provides a clean and reliable data pipeline. Its straightforward configuration, combined with the limitless potential of PHP scripting, makes it an excellent tool for server owners who prefer a hands-on approach to vote management. If you are already running Votifier and have a web server at your disposal, SimpleHTTPListener is a lightweight, no-nonsense addition that can unlock a whole new level of community engagement.