public static function getStatus($name = "") { echo "Hallo"; if ($name == null or $name . "" == "") { return 0; } $web = WebCache::get("http://mystatus.skype.com/" . $name . ".num", 300); return $web + 0; }
/** * @param string $project * @return array */ public static function getHostsForProject($project) { $json = WebCache::get('wikitech-v1-' . $project, 'https://wikitech.wikimedia.org/w/api.php?format=json&' . http_build_query(array('action' => 'query', 'list' => 'novainstances', 'niregion' => 'eqiad', 'niproject' => $project))); $data = json_decode($json); if (!isset($data->query->novainstances)) { return array(); } $instances = array_map(function ($obj) { return $obj->name; }, $data->query->novainstances); sort($instances); return $instances; }
<?php $db = new SQL(0); $info = $db->cmdrow(0, 'SELECT T1.*,T2.*,T3.right FROM user_list as T1 LEFT JOIN user_action as T2 ON T1.id=T2.user LEFT JOIN user_rights as T3 ON T1.id=T3.user AND T3.right="expert" WHERE T1.id={0} LIMIT 0,1', array($params["user_id"])); $str = WebCache::get("http://www.gravatar.com/" . md5(strtolower(trim($info["email_standard"]))) . ".json", 10000, array("entry", "}")); $gdata = json_decode($str, true); PageEngine::html("html_head", array("title" => _h("{0}'s Karmaprofil", array($info["username"])))); PageEngine::html("header", array("searchquery" => isset($_GET["query"]) ? $_GET["query"] : "")); ?> <div id="Content" class="content-wrapper PageUserprofile"> <article> <h1 class="search-result-summary"><?php echo _e("{0}'s Profil bearbeiten", array(0 => html($info["username"]))); ?> </h1> <?php PageEngine::html("box_userprofile_navi", array("id" => $info["id"], "name" => $info["username"])); ?> <table class="wrapper"><tr style="vertical-align: top;"> <td style="text-align: center;"> <div class="box_gravatar" style="width:140px; height:140px margin-bottom: 10px; position: relative;"> <img class="profile photo" src="http://www.gravatar.com/avatar/<?php echo md5($info["email_standard"]); ?> ?s=140&d=identicon" style="border: #EEE 1px solid; padding: 5px; border-radius: 3px; "> <?php if (isset($info["right"]) and $info["right"] == "expert") { echo '<img src="' . get_path("/skins/default/images/icons/expert.png") . '" TITLE="Experte für dieses Thema" style="position: absolute; width: 70px; height: 70px; bottom: -35px; right: -35px;"/>'; }
private static function renderTweet($matches) { $a = WebCache::get("http://api.twitter.com/1/statuses/oembed.json?align=none&id=" . $matches[1], 86400, array("}")); $b = json_decode($a, true); return $b["html"]; }
<div class="hidden"> <?php $webstr = WebCache::get("http://news.google.de/news?hl=de&ned=de&ie=UTF-8&output=rss&scoring=n&q=" . urlencode($params["query"]), 86400, array("</rss>", "</channel>", "</item>")); $doc = new DomDocument(); if ($webstr . "" != "") { $doc->loadXML($webstr); foreach ($doc->getElementsByTagName('item') as $row) { echo '<p>' . strip_tags($row->getElementsByTagName("description")->item(0)->nodeValue) . '</p>'; } } ?> </div>