Стоит ли использовать эту систему? Какие отзывы/рекомендации?
Какого его не может получить «fetch»?Через браузер вы обращаетесь от домена эндпоинта, от которого хотите получить информацию.
const proxyUrl = 'https://api.allorigins.win/get?url=';
const targetUrl = 'https://rutube.ru/api/video/37daa4e656174d04db06c5fca7548751';
fetch(proxyUrl + encodeURIComponent(targetUrl))
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.then(data => {
// данные могут быть внутри data.contents
console.log('Data retrieved:', JSON.parse(data.contents));
})
.catch(error => {
console.error('There was a problem with the fetch operation:', error);
});
как без UE и какого-то игрового движка
from django.http import HttpResponse
def hello_world(request):
return HttpResponse("Hello, World!")
from django.urls import path
from myapp.views import hello_world
urlpatterns = [
path('hello/', hello_world),
]
from http.server import BaseHTTPRequestHandler, HTTPServer
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
self.wfile.write(b"Hello, World!")
httpd = HTTPServer(('localhost', 8000), SimpleHTTPRequestHandler)
httpd.serve_forever()
javascript: navigator.clipboard.writeText(location.origin.replace(/\/$/, ''));null;
<?php
$array = [10, 20, 30, 40, 50];
$arrayIterator = new ArrayIterator($array);
foreach ($arrayIterator as $key => $value) {
// Преобразование числового ключа в строку и добавление префикса
$newKey = 'key_' . $key;
// Удаление старого ключа
$arrayIterator->offsetUnset($key);
// Установка нового ключа с тем же значением
$arrayIterator->offsetSet($newKey, $value);
}
// Преобразование итератора обратно в массив
$newArray = iterator_to_array($arrayIterator);
// Вывод нового массива
print_r($newArray);
?>
<?php
function getNestedValue($array, $path) {
foreach ($path as $key) {
if (!isset($array[$key])) {
return null;
}
$array = $array[$key];
}
return $array;
}
$ar = array(
"z" => array(
"x" => array(
"c" => array(
"v" => array(
"a" => 123,
"b" => 321
)
)
)
)
);
$path = array("z", "x", "c");
$result = getNestedValue($ar, $path);
echo $result !== null ? "Значение: " . print_r($result, true) : "Элемент не найден";
?>
SELECT
ch.id_element,
ch.`table`,
ch.param,
GROUP_CONCAT(cu.name) AS value_new
FROM
c_history ch
LEFT JOIN
c_object co ON co.id = ch.id_element
LEFT JOIN
c_user cu ON FIND_IN_SET(cu.id, ch.value_old)
WHERE
ch.`table` = 'c_object'
AND ch.param = 'ids_user_merge'
GROUP BY
ch.id_element, ch.`table`, ch.param;