- Added comprehensive AI Assistant system (aiassist/ directory): * Vector search and embedding capabilities * Typebot proxy integration * Elastic search functionality * Message classification and chat history * MCP proxy for external integrations - Implemented Court Status API (GetCourtStatus.php): * Real-time court document status checking * Integration with external court systems * Comprehensive error handling and logging - Enhanced S3 integration: * Improved file backup system with metadata * Batch processing capabilities * Enhanced error logging and recovery * Copy operations with URL fixing - Added Telegram contact creation API - Improved error logging across all modules - Enhanced callback system for AI responses - Extensive backup file storage with timestamps - Updated documentation and README files - File storage improvements: * Thousands of backup files with proper metadata * Fix operations for broken file references * Project-specific backup and recovery systems * Comprehensive file integrity checking Total: 26,461+ files added/modified including AWS SDK, vendor dependencies, and extensive backup system.
51 lines
1.5 KiB
PHP
51 lines
1.5 KiB
PHP
<?php
|
||
|
||
// Функция для получения HTML-кода страницы
|
||
function getCurrencyPage($date) {
|
||
$url = "https://cbr.ru/currency_base/daily/?UniDbQuery.Posted=True&UniDbQuery.To=" . $date;
|
||
|
||
$ch = curl_init();
|
||
curl_setopt($ch, CURLOPT_URL, $url);
|
||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||
$html = curl_exec($ch);
|
||
curl_close($ch);
|
||
|
||
return $html;
|
||
}
|
||
|
||
// Функция для парсинга HTML и извлечения курсов валют
|
||
function parseCurrencies($html) {
|
||
$doc = new DOMDocument();
|
||
@$doc->loadHTML($html);
|
||
$xpath = new DOMXPath($doc);
|
||
|
||
// Находим строки таблицы с курсами валют
|
||
$rows = $xpath->query('//table[contains(@class, "data")]//tr');
|
||
$currencies = [];
|
||
|
||
foreach ($rows as $row) {
|
||
$cols = $row->getElementsByTagName('td');
|
||
if ($cols->length > 0) {
|
||
$code = trim($cols->item(1)->nodeValue);
|
||
$rate = trim($cols->item(4)->nodeValue);
|
||
$currencies[$code] = $rate;
|
||
}
|
||
}
|
||
|
||
return $currencies;
|
||
}
|
||
|
||
// Используем функции
|
||
$date = "01.02.2024"; // Указанная дата
|
||
$html = getCurrencyPage($date);
|
||
$currencies = parseCurrencies($html);
|
||
|
||
// Выводим результат
|
||
echo "Курсы валют на дату $date:\n";
|
||
foreach ($currencies as $code => $rate) {
|
||
echo "$code: $rate\n";
|
||
}
|
||
|
||
?>
|