Example #1
0
function buildFeeds($feed1, $feed2, $feed3, $feed4)
{
    parserFeed($feed1);
    parseJSON($feed2);
    parserFeed($feed3);
    parserFeed($feed4);
    global $feedItems;
    global $itemsByDate;
    krsort($itemsByDate);
    foreach ($itemsByDate as $key => $val) {
        echo $val;
    }
}
Example #2
0
function getData($table)
{
    $filename = './api/items.json';
    $contents = file_get_contents($filename);
    if ($_SERVER['REQUEST_METHOD'] === 'POST') {
        $contentsDecoded = json_decode($contents, true);
        $contentsDecoded = parseJSON($table, $contentsDecoded);
        $contents = json_encode($contentsDecoded, JSON_PRETTY_PRINT);
        file_put_contents($filename, $contents);
    }
    header('Content-Type: application/json');
    header('Cache-Control: no-cache');
    header('Access-Control-Allow-Origin: *');
    echo $contents;
}
Example #3
0
/**
 * 对主页传进来的URL进行解析
 *
 * Date: 2015/12/9
 * Time: 16:55
 */
require_once '../config/Constant.php';
require_once '../database/ProductsDB.php';
require_once '../smarty/config.php';
require_once '../phpqrcode/phpqrcode.php';
//得到URL 传进来的id
$id = $_GET['id'];
if (!$smarty->isCached('item_product.tpl', $id)) {
    $itemProduct = readDatabase($id);
    $screenShotObject = parseJSON($itemProduct);
    generateQRCode($itemProduct);
    $smarty->assign('qrCodeImage', QR_NAME);
    $smarty->assign('itemProduct', $itemProduct);
    $smarty->assign('screenShotArray', $screenShotObject);
}
$smarty->display('item_product.tpl', $id);
/**
 * 生成QRCode
 */
function generateQRCode($itemProduct)
{
    //在这里要确保 products文件夹中apk名字 与 数据库名字一样
    $qrCodeHref = DOMAIN . '/products' . '/' . $itemProduct['download'];
    define('QR_NAME', 'itemQRCode.png');
    QRcode::png($qrCodeHref, QR_NAME, 'L', 5.5);
Example #4
0
function getBugsForTestFailure($fileName)
{
    if ($fileName == '') {
        return array();
    }
    global $bugsCache;
    if (isset($bugsCache[$fileName])) {
        return array();
    }
    if ($fileName == 'automation.py') {
        // This won't generate any useful suggestions, see bug 570174
        return array();
    }
    $bugs_json = file_get_contents("https://api-dev.bugzilla.mozilla.org/latest/bug?whiteboard=orange&summary=" . urlencode($fileName));
    if ($bugs_json !== false) {
        $bugs = parseJSON($bugs_json);
        if (isset($bugs->bugs)) {
            $bugsCache[$fileName] = $bugs->bugs;
            return $bugs->bugs;
        }
    }
    return array();
}
<?php

include 'getData.php';
$move_url = $_GET['move_url'];
$output = getRaw("http://pokeapi.co/" . $move_url);
$move_data_raw = parseJSON($output, '');
$move_name = $move_data_raw['name'];
?>

<!DOCTYPE html> 
<html>
<head>
	<title><?php 
echo ucfirst($move_name) . "Pokemon Database";
?>
></title>
	<link rel="stylesheet" type="text/css" href="style/style.css" />
	<meta charset="UTF-8">
</head>
<body>

	<?php 
include 'navbar.php';
echo "<h1>" . $move_name . "</h1>";
echo $move_data_raw['description'];
echo "<div class='attr_title'>";
echo "<table>";
echo "<tr>";
echo "<th>Power</th>";
echo "<td>" . $move_data_raw['power'] . "</td>";
echo "</tr>";
Example #6
0
                            echo "<span style='color:green;'>SET</span>";
                        } else {
                            echo "<span style='color:red;'>NOT SET</span>";
                        }
                    }
                    echo "<br><br>";
                }
                echo "<br><hr><br>";
            }
        }
    }
}
//New Place
$DLRA = new place("Disneyland Park");
$DCA = new place("Disney California Adventure Park");
//Address
$DLRA->addAddress($address1, $address2, $city, $state, $zip, $country, $latitude, $longitude);
$DCA->addAddress($address1, $address2, $city, $state, $zip, $country, $latitude2, $longitude2);
//Details
$DLRA->addDetails($phone, $type, $drivethru, $wifi, $plus18, $plus21, $alcohol, 1);
$DCA->addDetails($phone, $type, $drivethru, $wifi, $plus18, $plus21, $alcohol2, 7);
//Time Settings
$DLRA->timeSettings($timezone, $dlst);
$DCA->timeSettings($timezone, $dlst);
parseJSON($json);
if (!$DLRA->hoursSet() || !$DCA->hoursSet()) {
    echo "<h2>Loading 2nd</h2>";
    parseJSON($json2);
}
$DLRA->writeDB();
$DCA->writeDB();
<?php

$origin_file = file_get_contents('../../all_phone_codes.json');
$replaced_mask = '+___(__)___-__-__';
$replaced_phone_code = '380';
$replaced_iso_code = 'ua';
$origin_json = json_decode($origin_file);
$new_json = parseJSON($origin_json, $replaced_phone_code, $replaced_phone_code, $replaced_mask);
var_dump($new_json);
file_put_contents('../js/codes/ua/ru.json', print_r($new_json, true));
function parseJSON($origin_json, $replaced_phone_code, $replaced_iso_code, $replaced_mask)
{
    $num_elems = count($origin_json);
    $counter = 1;
    $new = '[';
    foreach ($origin_json as $k => $el) {
        if ($replaced_phone_code == $el->country_code) {
            $mask = parseMask($replaced_phone_code, $el->phone_code, $replaced_mask);
            $operator = '';
            $new .= '{' . "\n";
            $new .= "    \"iso_code\": " . "\"" . $replaced_iso_code . "\"," . "\n";
            $new .= "    \"mask\": " . "\"" . $mask . "\"," . "\n";
            $new .= "    \"region\": " . "\"" . $el->country . "\"," . "\n";
            $new .= "    \"city\": " . "\"" . $el->city . "\"," . "\n";
            $new .= "    \"operator\": " . "\"" . $operator . "\"" . "\n";
            $new .= '}';
            if ($num_elems !== $counter) {
                $new .= ',';
                $counter++;
            }
        }
Example #8
0
				<h1>Welcome to the Fictive Company Website</h1>
				<p>Curabitur ut congue hac, diam turpis maecenas id vestibulum nulla nisl, libero leo, ut scelerisque maecenas id, ornare magna orci. In blandit sed et sagittis non, ullamcorper nec metus felis vel, vestibulum a in sit. Leo non odio fermentum lectus cubilia, mauris aliquam nunc eu neque ac sollicitudin. Tincidunt nisl morbi nulla rutrum, adipisicing tellus integer nunc massa id quis. Cursus sagittis massa ac sociis interdum, sem cursus, enim aptent sit, semper mauris, quam urna sed quis vivamus.</p>
				<p>Tortor et diam, dictumst lacinia sed, non adipiscing pulvinar nunc nec, habitasse nunc urna urna. Sollicitudin auctor, arcu tincidunt ut suspendisse nulla, ipsum vel blandit urna metus pharetra nulla. Ultricies dolor ut, proin dolor leo, non dolor, morbi ipsum tempor rhoncus, pede turpis morbi. Id convallis, per sem ornare magnis, in malesuada ridiculus, quam scelerisque vestibulum arcu magna volutpat arcu.</p>
				<p>Placerat massa etiam laoreet venenatis turpis non. Donec nullam pharetra ut, sed consectetuer, vulputate non nec eu donec consectetuer tempus, commodo fusce morbi tellus orci et officia, at sapien interdum duis sem et aptent. Non sodales. Dolor eros, nec vitae in ligula venenatis lacus, vel fermentum massa. Urna felis ornare metus quis aliquam nec, enim mattis, proin id nec, fringilla eget dapibus, eget suscipit ac dolor in. Nunc dui, libero adipiscing sodales porta, suscipit nulla ornare sed malesuada, interdum nibh eget rutrum rutrum ac. Ut pellentesque. Adipiscing est dis diam vestibulum, irure quis sed.</p>
			</div>
		</div>

		<div id="sidebar">
			<div class="box">
				<h2>News Feed</h2>
				<?php 
parserFeed("http://www.selectb.com/feed/");
?>
				 <h2>Twitter Feed</h2>
				 <?php 
parseJSON("../Bunmun_Foundation/php/TwitterSettings.php");
?>
				 
				 <h2>Tumblr</h2>
				 <?php 
parserFeed("http://bunmblr.selectb.com/rss");
?>
			</div>
	
			<div class="box">
				<h2>Blogroll</h2>
				<ul class="blogroll">
					<li><a href="http://www.onextrapixel.com/">Onextrapixel</a></li>
					<li><a href="http://10steps.sg/">10Steps.SG</a></li>
					<li><a href="http://www.csswebsites.nl/">CSS Websites</a></li>
				</ul>