예제 #1
0
 }
 if (preg_match('/^\\/wreckrules.*/i', $messageItem->message, $matches) != false) {
     $itsON = $enableWrecker ? 'HO, ITS OON!!!' : 'Its definitely not ON.';
     sendNotification($roomId, $yoda, $userName, '<pre>' . $itsON . PHP_EOL . json_encode($wreckRules), "green", false, true);
     exit;
 }
 if (preg_match('/^\\/BIERTIJD.*/', $messageItem->message) != false) {
     sendNotification($roomId, $yoda, $userName, getBiertijd(true), "green");
     exit;
 }
 if (preg_match('/^\\/biertijd.*/i', $messageItem->message) != false) {
     sendNotification($roomId, $yoda, $userName, getBiertijd(), "green");
     exit;
 }
 if (preg_match('/^\\/temp.*/i', $messageItem->message) != false) {
     sendNotification($roomId, $yoda, $userName, 'Current temperature: <b>' . getTemperature() . '</b>', "green");
     exit;
 }
 if (preg_match('/^\\/shoot\\s?(?:\\[([^)]+)\\])?/i', $messageItem->message, $matches) != false) {
     $params = preg_split('/\\s*,\\s*/', $matches[1], 3);
     $angle = $params[0];
     $force = $params[1];
     $data = json_decode(file_get_contents('pixel_cannons_data'), true);
     $animationPath = pixelCannons($force, $angle, $data, $userName);
     file_put_contents('pixel_cannons_data', json_encode($data));
     sendNotification($roomId, $yoda, $userName, '<img width="' . $data['defaults']['maxWidth'] . '" height="' . $data['defaults']['maxHeight'] . '" src="' . $animationPath . '">', "gray", true, true);
     exit;
 }
 if ($enableWrecker && preg_match('/^\\/wreck[\\s|\\n|\\r|:]?((?:.|[\\n|\\r])*)?/i', $messageItem->message, $matches) != false) {
     if (count($matches) > 1) {
         if (strlen($matches[1]) > $wreckRules['maxCharacters']) {
예제 #2
0
파일: testCall.php 프로젝트: TAR-O/TUSK-Web
<?php

//making api request
include 'forecast.io.php';
$api_key = 'f823baf7f2ef7fdf8122040b3f7c8074';
$units = 'auto';
// Can be set to 'us', 'si', 'ca', 'uk' or 'auto' (see forecast.io API); default is auto
$lang = 'en';
// Can be set to 'en', 'de', 'pl', 'es', 'fr', 'it', 'tet' or 'x-pig-latin' (see forecast.io API); default is 'en'
$forecast = new ForecastIO($api_key, $units, $lang);
$arrayData = $forecast->getArray(43.7, 79.40000000000001);
$temperatureNow = $arrayData[0];
$temperatureWeekly = $arrayData[2];
echo $temperatureNow . getTemperature();
foreach ($temperatureWeekly as $temperatureNow) {
    echo $temperatureNow->getTime('Y-m-d') . ': ' . $temperatureNow->getMaxTemperature() . "\n";
}
//echo $temperatureWeekly;
//while ($tempCount < $count)
//{
//getting data array
//$arrayData = $forecast->getArray(43.7, -79.4);
//$temperatureNow = $arrayData[0]->getTemperature();
//echo $temperatureNow;
/*$temperature = $condition->getTemperature();
	$ApparentTemperature = $condition->getApparentTemperature();
	$Summary = $condition->getSummary();
	$Icon = $condition->getIcon();
	$Time = $condition->getTime();
	$ressure = $condition->getPressure();
	$DewPoint = $condition->getDewPoint();