Skip to content

Instantly share code, notes, and snippets.

<?php
function mcapi($address, $port)
{
$data = json_decode(file_get_contents("https://mcapi.ca/query/$address:$port/mcpe"), true);
if ($data["status"] === true) {
return $data;
} else {
return false;
}
}
<?php
function tweet($tweet)
{
define("CONSUMER_KEY", "apps.twitter.com");
define("CONSUMER_SECRET", "apps.twitter.com");
define("ACCESS_TOKEN", "apps.twitter.com");
define("ACCESS_SECRET", "apps.twitter.com");
require_once("codebird.php");
\Codebird\Codebird::setConsumerKey(CONSUMER_KEY, CONSUMER_SECRET);
$cb = \Codebird\Codebird::getInstance();
<?php
require_once("wp-load.php");
header("Content-type:application/json;charset=utf-8");
$token = $_POST["token"];
$action = strtolower($_POST["action"]);
if ($token === "SUPER_SECRET_TOKEN") {
if ($action === "login") {
$username = sanitize_user($_POST["username"]);
$password = trim($_POST["password"]);
if (empty($username)) {
<?php
$server_properties = parse_ini_file("server.properties");
echo $server_properties["motd"];
?>
<?php
function gamertag_exists($gamertag)
{
$first_step = explode("<div id=\"Gamerscore\">", file_get_contents("https://gamercard.xbox.com/en-US/$gamertag.card"));
$second_step = explode("</div>", $first_step[1]);
$gamerscore = $second_step[0];
if ($gamerscore != "--") {
return true;
} else {
return false;
<?php
header("Content-type:application/json;charset=utf-8");
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
$token = $_POST["token"];
$action = strtolower($_POST["action"]);
if ($token === "SUPER_SECRET_TOKEN") {
if ($action === "register") {
$username = strtolower($_POST["username"]);