本文整理汇总了PHP中Lobby::loadURL方法的典型用法代码示例。如果您正苦于以下问题:PHP Lobby::loadURL方法的具体用法?PHP Lobby::loadURL怎么用?PHP Lobby::loadURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lobby
的用法示例。
在下文中一共展示了Lobby::loadURL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check
/**
* Get updates
*/
public static function check()
{
$apps = array_keys(\Lobby\Apps::getApps());
$response = \Lobby::loadURL(L_SERVER . "/updates", array("apps" => implode(",", $apps)), "POST");
if ($response) {
$response = json_decode($response, true);
if (is_array($response)) {
saveOption("lobby_latest_version", $response['version']);
saveOption("lobby_latest_version_release", $response['released']);
if (isset($response['apps']) && count($response['apps']) != 0) {
$AppUpdates = array();
foreach ($response['apps'] as $appID => $version) {
$App = new \Lobby\Apps($appID);
if ($App->info['version'] != $version) {
$AppUpdates[$appID] = $version;
}
}
saveOption("app_updates", json_encode($AppUpdates));
}
}
}
}
示例2: die
<?php
if (isset($_POST['url'])) {
$url = $_POST['url'];
if ($url == "") {
die("0");
} else {
$videoId = \Lobby::loadURL("http://www.youtube-mp3.org/a/pushItem/", array("item" => $url, "el" => "na", "bf" => "false", "r" => time()), "GET");
if (strlen($videoId) > 20) {
die("0");
} else {
$itemInfo = \Lobby::loadURL("http://www.youtube-mp3.org/a/itemInfo/", array("video_id" => $videoId, "ac" => "www", "t" => "grp", "r" => time()), "GET");
$itemInfo = str_replace("info = ", "", $itemInfo);
$itemInfo = str_replace(";", "", $itemInfo);
$itemInfo = json_decode($itemInfo, true);
$newItemInfo = array("id" => $videoId, "h" => $itemInfo['h'], "title" => $itemInfo['title'], "length" => $itemInfo['length'], "image" => $itemInfo['image']);
if ($newItemInfo['id'] == '$$$ERROR$$$') {
die(0);
}
echo json_encode($newItemInfo);
}
}
} else {
die("0");
}