home
offer
Tool
Form ENG
Register for renting a home
Register to rent out a home
Register to buy a home
Register to sell your home
Subscribe widget
DO YOU WANT TO BUY OR SELL A HOUSE?
06-40611905
Info@dehaas-makelaardij.nl
English
en
Nederlands
nl
PLEASE CONTACT US
English
en
Nederlands
nl
home
offer
Tool
Form ENG
Register for renting a home
Register to rent out a home
Register to buy a home
Register to sell your home
Subscribe widget
Delen:
Description
Toon meer
Kenmerken
Contact opnemen
Succesvol verzonden!
Probeert het opnieuw
Reageer op dit object
555-555-5555
t.anthony@eazlee.com
Naam
E-mail
Telefoonnummer
Bericht
Ik ga akkoord met de
Privacyverklaring
Reageer
Youtube video
Iframe view (Zien24)
Location
Sunny side
2021-01-01
12:00
Recently added
Status
Type
€1234,-
straat 123 A
1234 AB, Plaats
Test website.
© 2025
All rights reserved | Eazlee BV
Share by:
Chat Widget
Chat
Woning Chatbot
Verstuur
// Chatknop en widget const chatButton = document.getElementById('chatButton'); const chatWidget = document.getElementById('chatWidget'); const chatMessages = document.getElementById('chatMessages'); // Toon/verberg de chatwidget chatButton.addEventListener('click', () => { chatWidget.style.display = chatWidget.style.display === 'none' ? 'flex' : 'none'; }); // Functie om berichten naar de chat te sturen function addMessage(message, isUser = false) { const messageElem = document.createElement('div'); messageElem.textContent = message; messageElem.style.marginBottom = '10px'; messageElem.style.padding = '8px'; messageElem.style.borderRadius = '10px'; messageElem.style.backgroundColor = isUser ? '#007bff' : '#eee'; messageElem.style.color = isUser ? '#fff' : '#000'; messageElem.style.alignSelf = isUser ? 'flex-end' : 'flex-start'; chatMessages.appendChild(messageElem); chatMessages.scrollTop = chatMessages.scrollHeight; } // Haal data op van de opgegeven JSON URL async function fetchWoningData() { try { const response = await fetch('https://teodor.nl/test.json'); const data = await response.json(); return data; } catch (error) { console.error('Fout bij het ophalen van woningdata:', error); addMessage('Er is een fout opgetreden bij het ophalen van woningdata.'); } } // Verzend bericht en gebruik GPT om te antwoorden async function sendMessage() { const input = document.getElementById('messageInput'); const userMessage = input.value; if (!userMessage) return; // Voeg gebruikerbericht toe aan de chat addMessage(userMessage, true); input.value = ''; // Haal woningdata op const woningData = await fetchWoningData(); // Stuur bericht naar ChatGPT (voorbeeld met fetch, vervang met jouw GPT-integratie) const gptResponse = await fetch('https://api.openai.com/v1/engines/davinci-codex/completions', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer YOUR_OPENAI_API_KEY` }, body: JSON.stringify({ prompt: `Gegevens: ${JSON.stringify(woningData)}\nVraag: ${userMessage}\nAntwoord:`, max_tokens: 150 }) }); const gptData = await gptResponse.json(); const botMessage = gptData.choices[0].text.trim(); // Voeg het GPT-antwoord toe aan de chat addMessage(botMessage); }