Springe direkt zu Inhalt
Berlin University Alliance
Berlin University Alliance
Service-Navigation
Startseite
Kontakt
Impressum
Datenschutz
Sitemap
DE
DE: Deutsch
EN: English
Suchbegriffe
Menü
News
loading...
Schwerpunkte
loading...
Förderung und Angebote
loading...
Exzellenzstrategie
loading...
Netzwerk
loading...
Über uns
loading...
Medien
loading...
Pfadnavigation
Startseite
test-json
Der eingebettete Frame kann nicht dargestellt werden <h1>Combined Events and People Data</h1> <input type="text" id="search-input" placeholder="Search by title or name"> <div id="data-container"></div> <script> document.addEventListener('DOMContentLoaded', function() { const tuApiUrl = 'https://programm.zewk.tu-berlin.de/api/v1/events?page%5Bsize%5D=9999'; const huApiUrl = 'https://hu.opencampus.com/de/alle-workshops-f-r-export-rest'; const proxyUrl = 'https://cors-anywhere.herokuapp.com/'; let allData = []; async function fetchData() { try { const [tuResponse, huResponse] = await Promise.all([ fetch(proxyUrl + tuApiUrl), fetch(proxyUrl + huApiUrl) ]); if (!tuResponse.ok || !huResponse.ok) { throw new Error('Network response was not ok'); } const tuData = await tuResponse.json(); const huData = await huResponse.json(); const combinedData = [ ...tuData.data.map(tuEvent => ({ type: 'tu', title: tuEvent.attributes.title })), ...huData.map(huEvent => ({ type: 'hu', title: huEvent.title })) ]; allData = combinedData; displayData(allData); } catch (error) { console.error('There has been a problem with your fetch operation:', error); } } function displayData(data) { const dataContainer = document.getElementById('data-container'); dataContainer.innerHTML = ''; // Clear previous data data.forEach(item => { const itemElement = document.createElement('div'); itemElement.textContent = `${item.type === 'tu' ? 'Event Tu: ' : 'Event HU: '}${item.title}`; dataContainer.appendChild(itemElement); }); } function filterData(query) { const filteredData = allData.filter(item => item.title.toLowerCase().includes(query.toLowerCase()) ); displayData(filteredData); } document.getElementById('search-input').addEventListener('input', function() { filterData(this.value); }); fetchData(); }); </script>
swapi
Schutz Ihrer Daten
Erst beim Aktivieren werden Daten übertragen an:
keine externen Domains enthalten
Zur Anzeige dieser Inhalte wird JavaScript benötigt.
Dauerhaft aktivieren
Zurücksetzen
Datenschutzhinweise
Für eine optimale Darstellung dieser Seite aktivieren Sie bitte JavaScript.