Через год надо что-то поправить, внести изменения и долго времени уходит на "вспомнить как оно работает".
и как ему это поможет в описываемой ситуации?
ытался поглазеть как ВК голосовые записывает на сайтеэто через апи делается - https://vk.com/dev/board.createComment
Хостинг очень строг к конструкциям типа exec и тд.тогда проще не webm конвертировать, а в ff сохранять запись в webm.
<?php
class Timetable
{
const RFN_URL = 'http://support.rfn.ru/';
const CONTENT_REGEX = '/<div align="left">(.+?)<\/div>/us';
protected $curlHandler;
public function __construct()
{
$this->curlHandler = curl_init();
curl_setopt_array(
$this->curlHandler,
array(
CURLOPT_HEADER => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_COOKIEFILE => 'cookie.txt',
)
);
}
public function get(array $postfields)
{
// логинимся
curl_setopt_array(
$this->curlHandler,
array(
CURLOPT_URL => self::RFN_URL.'userreg.php',
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $postfields
)
);
curl_exec($this->curlHandler);
// обходим чудо защиту местных гениев :)
curl_setopt_array(
$this->curlHandler,
array(
CURLOPT_URL => self::RFN_URL.'userreg.php?myreg',
CURLOPT_HTTPGET => true,
)
);
curl_exec($this->curlHandler);
$date = strtotime('+1 month');
$date = '?month='.date('n', $date).'&year='.date('Y', $date);
// загружаем график
curl_setopt(
$this->curlHandler,
CURLOPT_URL,
self::RFN_URL.'team6.php'.$date
);
$response = curl_exec($this->curlHandler);
$response = mb_convert_encoding($response, 'UTF-8', 'windows-1251');
preg_match(self::CONTENT_REGEX, $response, $matches);
return $matches[1];
}
public function send($url, $timetable)
{
curl_setopt_array(
$this->curlHandler,
array(
CURLOPT_URL => $url,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => array('timetable' => $timetable)
)
);
curl_exec($this->curlHandler);
}
public function __destruct()
{
curl_close($this->curlHandler);
}
}
mb_internal_encoding('UTF-8');
header('Content-Type: text/html; charset=utf-8');
$timetable = new Timetable;
$response = $timetable->get(array(
'name4' => 'af',
'pass4' => '1q2w3e4r',
'register' => ''
));