Реклама | Adv
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
Сообщения форума
Реклама | Adv
Автор: Я(Edrard)

Сделаем это общедоступным, благо ничего сложного нет.
Все, что нужно сделать это сохранить данный код в файл с расширение php и задать параметр $clan_id(id номер вашего клана)
Пример можете посмотреть тут - https://wot-news.com/1/1.php
 
<?php
$clan_id = '1';
$request = "GET /uc/clans/".$clan_id."/members/?type=table HTTP/1.0\r\n";
$request.= "Accept: text/html, */*\r\n";
$request.= "User-Agent: Mozilla/3.0 (compatible; easyhttp)\r\n";
$request.= "X-Requested-With: XMLHttpRequest\r\n";
$request.= "Host: challenge.worldoftanks.ru\r\n";
$request.= "Connection: Keep-Alive\r\n";
$request.= "\r\n";

$wot_host="challenge.worldoftanks.ru";

$fp = fsockopen("challenge.worldoftanks.ru", 80, $errno, $errstr, 60);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fwrite($fp, $request);
$page = '';
while (!feof($fp)) {
$page .= fgets($fp, 4096);
}
fclose($fp);
}
preg_match_all("/{\"request_data\":(.*?),\"result\":\"success\"}/", $page, $matches);
$new = (json_decode($matches[0][0], true));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Список клана</title>

<link rel="stylesheet" href="http://tablesorter.ru/docs/css/jq.css" type="text/css" media="print, projection, screen" />
<link rel="stylesheet" href="http://tablesorter.ru/themes/blue/style.css" type="text/css" media="print, projection, screen" />
<script type="text/javascript" src="http://tablesorter.ru/jquery-latest.js"></script>
<script type="text/javascript" src="http://tablesorter.ru/jquery.tablesorter.js"></script>
<script type="text/javascript">
$(document).ready(function() {
// теперь по умолчанию у нас всегда будет запускаться виджет зебра
$.tablesorter.defaults.widgets = ['zebra'];
// теперь по умолчанию всегда будем сортировать по первой колонке
$.tablesorter.defaults.sortList = [[0,0]];
// вызов плагина
$("table").tablesorter();
});
</script>
</head>
<body>
<div align="center">
<table class="tablesorter" cellspacing="1" style="width: 800px;">
<thead>
<tr>
<th>Имя</th>
<th>ID</th>
<th>Состоит в клане</th>
<th>Звание</th>
</tr>
</thead>
<tbody>
<?php foreach($new['request_data']['items'] as $val){
$date = explode('.',$val['member_since']);
$new = $date['2'].'.'.$date['1'].'.'.$date['0']
?>
<tr>
<td><?php echo $val['name']; ?></td>
<td><?php echo $val['account_id']; ?></td>
<td><?php echo $new; ?></td>
<td><?php echo $val['role']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</body>
</html>


Обсудить код или задать вопросы можно тут
Реклама | Adv