{"id":851,"date":"2023-12-21T17:41:58","date_gmt":"2023-12-21T17:41:58","guid":{"rendered":"https:\/\/prins-pictures.nl\/?page_id=851"},"modified":"2025-04-26T13:10:33","modified_gmt":"2025-04-26T11:10:33","slug":"vogels-in-de-tuin","status":"publish","type":"page","link":"https:\/\/prins-pictures.nl\/index.php\/vogels-in-de-tuin\/","title":{"rendered":"Vogels in de tuin"},"content":{"rendered":"\n<h2 style=\"text-align:center; color:#f4c805; margin-bottom:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:calc(2vw + 1em);\">\n    Vogels in de tuin\n<\/h2>\n<h2 style=\"text-align:center; color:#f4c805; margin-bottom:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:calc(2vw + 1em);\">\n    Live\n<\/h2>\n<div id=\"recent-observation\" style=\"text-align:center; margin-bottom:10px; padding:20px;\">\n    <!-- De meest recente waarneming wordt hier geladen -->\n<\/div>\n\n<div id=\"observations\" style=\"display:flex; flex-wrap:nowrap; overflow-x:auto; justify-content:flex-start; gap:10px; margin:auto; padding:10px;\">\n    <!-- De overige waarnemingen worden hier geladen -->\n<\/div>\n\n<h2 style=\"text-align:center; color:#f4c805; margin-top:20px; margin-bottom:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:calc(2vw + 1em);\">\n    Top 10 van Vandaag\n<\/h2>\n<ul id=\"top-10-list\" style=\"list-style:none; padding:0; margin:auto; max-width:600px;\">\n    <!-- De top 10 wordt hier weergegeven -->\n<\/ul>\n\n<h2 style=\"text-align:center; color:#f4c805; margin-top:40px;\">Deze maand<\/h2>\n<ul id=\"month-list\" style=\"list-style:none; padding:0; margin:auto; max-width:600px;\">\n    <!-- Alle waarnemingen van deze maand worden hier weergegeven -->\n<\/ul>\n\n<script>\n    const birdNameTranslations = {\n        \"Turdus merula\": \"Merel\",\n        \"Turdus philomelos\": \"Zanglijster\",\n        \"Turdus iliacus\": \"Koperwiek\",\n        \"Turdus pilaris\": \"Kramsvogel\",\n        \"Cyanistes caeruleus\": \"Pimpelmees\",\n        \"Aegithalos caudatus\": \"Staartmees\",\n        \"Parus major\": \"Koolmees\",\n        \"Troglodytes troglodytes\": \"Winterkoning\",\n        \"Erithacus rubecula\": \"Roodborst\",\n        \"Luscinia megarhynchos\": \"Nachtegaal\",\n        \"Phylloscopus collybita\": \"Tjiftjaf\",\n        \"Phylloscopus trochilus\": \"Fitis\",\n        \"Regulus regulus\": \"Goudhaan\",\n        \"Regulus ignicapilla\": \"Vuurgoudhaan\",\n        \"Fringilla coelebs\": \"Vink\",\n        \"Fringilla montifringilla\": \"Keep\",\n        \"Sturnus vulgaris\": \"Spreeuw\",\n        \"Psittacula krameri\": \"Halsbandparkiet\",\n        \"Prunella modularis\": \"Heggenmus\",\n        \"Sylvia atricapilla\": \"Zwartkop\",\n        \"Sylvia borin\": \"Tuinfluiter\",\n        \"Curruca communis\": \"Grasmus\",\n        \"Curruca curruca\": \"Braamsluiper\",\n        \"Phoenicurus ochruros\": \"Zwarte Roodstaart\",\n        \"Hippolais icterina\": \"Spotvogel\",\n        \"Apus apus\": \"Gierzwaluw\",\n        \"Hirundo rustica\": \"Boerenzwaluw\",\n        \"Delichon urbicum\": \"Huiszwaluw\",\n        \"Riparia riparia\": \"Oeverzwaluw\",\n        \"Columba palumbus\": \"Houtduif\",\n        \"Streptopelia decaocto\": \"Turkse Tortel\",\n        \"Columba oenas\": \"Holenduif\",\n        \"Corvus corone\": \"Zwarte Kraai\",\n        \"Coloeus monedula\": \"Kauw\",\n        \"Corvus corax\": \"Raaf\",\n        \"Garrulus glandarius\": \"Gaai\",\n        \"Pica pica\": \"Ekster\",\n        \"Buteo buteo\": \"Buizerd\",\n        \"Falco peregrinus\": \"Slechtvalk\",\n        \"Accipiter nisus\": \"Sperwer\",\n        \"Falco tinnunculus\": \"Torenvalk\",\n        \"Calidris alpina\": \"Bonte Strandloper\",\n        \"Motacilla alba\": \"Witte Kwikstaart\",\n        \"Ardea cinerea\": \"Blauwe Reiger\",\n        \"Dryobates minor\": \"Kleine Bonte Specht\",\n        \"Dendrocopos major\": \"Grote Bonte Specht\",\n        \"Dendrocoptes medius\": \"Middelste Bonte Specht\",\n        \"Dryocopus martius\": \"Zwarte Specht\",\n        \"Picus viridis\": \"Groene Specht\",\n        \"Sitta europaea\": \"Boomklever\",\n        \"Certhia brachydactyla\": \"Boomkruiper\",\n        \"Carduelis carduelis\": \"Putter\",\n        \"Chloris chloris\": \"Groenling\",\n        \"Linaria cannabina\": \"Kneu\",\n        \"Spinus spinus\": \"Sijs\",\n        \"Acanthis flammea\": \"Grote Barmsijs\",\n        \"Passer domesticus\": \"Huismus\",\n        \"Passer montanus\": \"Ringmus\",\n        \"Cygnus olor\": \"Knobbelzwaan\",\n        \"Anser anser\": \"Grauwe Gans\",\n        \"Branta leucopsis\": \"Brandgans\",\n        \"Anser albifrons\": \"Kolgans\",\n        \"Alopochen aegyptiaca\": \"Nijlgans\",\n        \"Branta canadensis\": \"Grote Canadese Gans\",\n        \"Anas platyrhynchos\": \"Wilde Eend\",\n        \"Mareca strepera\": \"Krakeend\",\n        \"Fulica atra\": \"Meerkoet\",\n        \"Gallinula chloropus\": \"Waterhoen\",\n        \"Rallus aquaticus\": \"Waterral\",\n        \"Vanellus vanellus\": \"Kievit\",\n        \"Alauda arvensis\": \"Veldleeuwerik\",\n        \"Anthus pratensis\": \"Graspieper\",\n        \"Anthus trivialis\": \"Boompieper\",\n        \"Emberiza schoeniclus\": \"Rietgors\",\n        \"Cuculus canorus\": \"Koekoek\",\n        \"Haematopus ostralegus\": \"Scholekster\",\n        \"Alcedo atthis\": \"IJsvogel\",\n        \"Grus grus\": \"Kraanvogel\",\n        \"Acrocephalus scirpaceus\": \"Kleine Karekiet\",\n        \"Cettia cetti\": \"Cetti's Zanger\",\n        \"Ciconia ciconia\": \"Ooievaar\",\n        \"Tyto alba\": \"Kerkuil\",\n        \"Strix aluco\": \"Bosuil\",\n        \"Athene noctua\": \"Steenuil\",\n        \"Asio otus\": \"Ransuil\",\n        \"Chroicocephalus ridibundus\": \"Kokmeeuw\",\n        \"Larus canus\": \"Stormmeeuw\",\n        \"Larus argentatus\": \"Zilvermeeuw\",\n        \"Larus fuscus\": \"Kleine Mantelmeeuw\",\n        \"Sterna hirundo\": \"Visdief\",\n        \"Phylloscopus inornatus\": \"Bladkoning\",\n        \"Coccothraustes coccothraustes\": \"Appelvink\",\n        \"Numenius arquata\": \"Wulp\",\n        \"Tringa nebularia\": \"Groenpootruiter\",\n        \"Tringa totanus\": \"Tureluur\",\n        \"Botaurus stellaris\": \"Roerdomp\",\n        \"Ardea purpurea\": \"Purperreiger\",\n        \"Ardea alba\": \"Grote Zilverreiger\",\n        \"Anser serrirostris\": \"Toendrarietgans\",\n        \"Pyrrhula pyrrhula\": \"Goudvink\",\n        \"Poecile palustris\": \"Glanskop\",\n        \"Turdus viscivorus\": \"Grote Lijster\",\n        \"Gallinago gallinago\": \"Watersnip\",\n        \"Motacilla flava\": \"Gele Kwikstaart\",\n        \"Numenius phaeopus\": \"Regenwulp\",\n        \"Limosa limosa\": \"Grutto\",\n        \"Phasianus colchicus\": \"Fazant\",\n        \"Tachybaptus ruficollis\": \"Dodaars\",\n        \"Podiceps cristatus\": \"Fuut\",\n        \"Bombycilla garrulus\": \"Pestvogel\",\n        \"Oriolus oriolus\": \"Wielewaal\",\n        \"Motacilla cinerea\": \"Grote Gele Kwikstaart\",\n        \"Scolopax rusticola\": \"Houtsnip\",\n        \"Streptopelia turtur\": \"Zomertortel\",\n        \"Tringa ochropus\": \"Witgat\",\n        \"Corvus monedula\": \"Kauw\",\n        \"Mareca penelope\": \"Smient\",\n\t\"Corvus cornix\": \"Bonte Kraai\",\n        \"Anthus spinoletta\": \"Waterpieper\",\n        \"Anser brachyrhynchus\": \"Kleine rietgans\",\n        \"Pluvialis apricaria\": \"Goudplevier\",\n        \"Anthus rubescens\": \"Pacifische Pieper\",\n        \"Plectrophenax nivalis\": \"Sneeuwgors\",\n        \"Pyrrhocorax pyrrhocorax\": \"Alpenkauw\",\n        \"Emberiza cia\": \"Rotsgors\",\n        \"Emberiza cirlus\": \"Cirlgors\",\n        \"Remiz pendulinus\": \"Buidelmees\",\n        \"Pernis apivorus\": \"Wespendief\",\n        \"Aix galericulata\": \"Mandarijneend\",\n        \"Charadrius hiaticula\": \"Bontbekplevier\",\n        \"Tringa glareola\": \"Bosruiter\",\n        \"Branta bernicla\": \"Rotgans\",\n        \"Hydroprogne caspia\": \"Reuzenstern\",\n        \"Anas carolinensis\": \"Amerikaanse Wintertaling\",\n        \"Larus michahellis\": \"Geelpootmeeuw\",\n        \"Lophophanes cristatus\": \"Kuifmees\",\n        \"Melanitta nigra\": \"Zwarte Zee-eend\",\n        \"Cygnus atratus\": \"Zwarte Zwaan\",\n        \"Bucephala clangula\": \"Brilduiker\",\n        \"Ichthyaetus melanocephalus\": \"Zwartkopmeeuw\",\n\t\"Cygnus cygnus\": \"Wilde Zwaan\",\n        \"Anas acuta\": \"Pijlstaart\",\n        \"Thalasseus sandvicensis\": \"Grote stern\",\n        \"Perdix perdix\": \"Patrijs\",\n        \"Cygnus columbianus\": \"Kleine zwaan\",\n        \"Pyrrhocorax graculus\": \"Alpenkauw\",\n        \"Pluvialis squatarola\": \"Zilverplevier\",\n        \"Saxicola rubicola\": \"Roodborsttapuit\",\n        \"Charadrius dubius\": \"Kleine Plevier\",\n        \"Porzana porzana\": \"Porseleinhoen\",\n        \"Nycticorax nycticorax\": \"Kwak\",\n        \"Actitis hypoleucos\": \"Oeverloper\",\n        \"Lullula arborea\": \"Boomleeuwerik\",\n        \"Rissa tridactyla\": \"Drieteenmeeuw\",\n        \"Anas crecca\": \"Wintertaling\"\n    };\n\t\t\n    async function fetchBirdObservations() {\n        try {\n            const response = await fetch('https:\/\/app.birdweather.com\/api\/v1\/stations\/Pw4wxmsLz1Nkqw5Y8oEA6hGC\/detections?limit=7');\n            const data = await response.json();\n\n            if (data.detections && data.detections.length > 0) {\n                const recentObservationContainer = document.getElementById('recent-observation');\n                const observationsContainer = document.getElementById('observations');\n                recentObservationContainer.innerHTML = ''; \/\/ Clear the recent observation container\n                observationsContainer.innerHTML = ''; \/\/ Clear the other observations container\n\n                \/\/ De recentste waarneming apart tonen\n                const recentDetection = data.detections[0];\n                const utcTime = new Date(recentDetection.timestamp);\n                const options = { timeZone: 'Europe\/Amsterdam', year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' };\n                const formattedTime = utcTime.toLocaleString('nl-NL', options).replace(',', '');\n\n                const species = recentDetection.species || {};\n                const commonName = species.commonName || 'Onbekende soort';\n                const scientificName = species.scientificName || 'Onbekende soort';\n                const thumbnailUrl = species.thumbnailUrl || '';\n\n                const dutchName = birdNameTranslations[scientificName] || birdNameTranslations[commonName] || commonName;\n\n                recentObservationContainer.innerHTML = `\n                    <div style=\"display:flex; flex-direction:column; align-items:center;\">\n                        <img decoding=\"async\" src=\"${thumbnailUrl}\" alt=\"${commonName}\" style=\"width:150px; height:auto; border:none; border-radius:15px;\"\/>\n                        <div style=\"color:#f4c805; font-size:16px; margin-top:10px;\">${formattedTime}<\/div>\n                        <strong style=\"color:#f4c805; font-size:20px;\">${dutchName}<\/strong>\n                    <\/div>\n                `;\n\n                \/\/ De overige waarnemingen tonen\n                data.detections.slice(1).forEach(detection => {\n                    const utcTime = new Date(detection.timestamp);\n                    const formattedTime = utcTime.toLocaleString('nl-NL', options).replace(',', '');\n\n                    const species = detection.species || {};\n                    const commonName = species.commonName || 'Onbekende soort';\n                    const scientificName = species.scientificName || 'Onbekende soort';\n                    const thumbnailUrl = species.thumbnailUrl || '';\n\n                    const dutchName = birdNameTranslations[scientificName] || birdNameTranslations[commonName] || commonName;\n\n                    const observationElement = document.createElement('div');\n                    observationElement.style.cssText = 'text-align:center; margin:10px; display:flex; flex-direction:column; align-items:center; flex:0 0 auto;';\n\n                    observationElement.innerHTML = `\n                        <img decoding=\"async\" src=\"${thumbnailUrl}\" alt=\"${commonName}\" style=\"width:100px; height:auto; border:none; border-radius:15px;\"\/>\n                        <div style=\"color:#f4c805; font-size:14px; margin-top:5px;\">${formattedTime}<\/div>\n                        <strong style=\"color:#f4c805;\">${dutchName}<\/strong>\n                        <em style=\"color:#f4c805; font-size:14px;\"><\/em>\n                    `;\n\n                    observationsContainer.appendChild(observationElement);\n                });\n            } else {\n                document.getElementById('recent-observation').innerText = 'Geen gegevens beschikbaar';\n                document.getElementById('observations').innerText = 'Geen gegevens beschikbaar';\n            }\n        } catch (error) {\n            console.error('Fout bij het ophalen van gegevens:', error);\n            document.getElementById('recent-observation').innerText = 'Gegevens laden mislukt';\n            document.getElementById('observations').innerText = 'Gegevens laden mislukt';\n        }\n    }\n\n    async function fetchTop10Birds() {\n        try {\n            const response = await fetch('https:\/\/app.birdweather.com\/api\/v1\/stations\/Pw4wxmsLz1Nkqw5Y8oEA6hGC\/species?period=day');\n            const data = await response.json();\n\n            if (data.species && data.species.length > 0) {\n                const top10List = document.getElementById('top-10-list');\n                top10List.innerHTML = ''; \/\/ Clear the list\n\n                const top10Birds = data.species.slice(0, 10);\n                top10Birds.forEach(bird => {\n                    const dutchName = birdNameTranslations[bird.scientificName] || birdNameTranslations[bird.commonName] || bird.commonName;\n\n                    const listItem = document.createElement('li');\n                    listItem.style.cssText = 'display:flex; align-items:center; justify-content:space-between; border-bottom:2px solid #f4c805; padding:10px 0;';\n\n                    listItem.innerHTML = `\n                        <div style=\"display:flex; align-items:center;\">\n                            <img decoding=\"async\" src=\"${bird.thumbnailUrl}\" alt=\"${bird.commonName}\" style=\"width:40px; height:40px; border-radius:15px; margin-right:15px;\"\/>\n                            <span style=\"color:#f4c805; font-size:16px;\">${dutchName}<\/span>\n                        <\/div>\n                        <strong style=\"color:#f4c805; font-size:18px;\">${bird.detections.total}<\/strong>\n                    `;\n\n                    top10List.appendChild(listItem);\n                });\n            } else {\n                document.getElementById('top-10-list').innerHTML = '<li style=\"color:#f4c805;\">Geen waarnemingen beschikbaar<\/li>';\n            }\n        } catch (error) {\n            console.error('Fout bij het ophalen van gegevens:', error);\n            document.getElementById('top-10-list').innerHTML = '<li style=\"color:#f4c805;\">Gegevens laden mislukt<\/li>';\n        }\n    }\n\n    async function fetchMonthObservations() {\n        try {\n            const response = await fetch('https:\/\/app.birdweather.com\/api\/v1\/stations\/Pw4wxmsLz1Nkqw5Y8oEA6hGC\/species?period=month');\n            const data = await response.json();\n\n            if (data.species && data.species.length > 0) {\n                const monthList = document.getElementById('month-list');\n                monthList.innerHTML = ''; \/\/ Clear the list\n\n                data.species.forEach(bird => {\n                    const dutchName = birdNameTranslations[bird.scientificName] || birdNameTranslations[bird.commonName] || bird.commonName;\n\n                    const listItem = document.createElement('li');\n                    listItem.style.cssText = 'display:flex; align-items:center; justify-content:space-between; border-bottom:2px solid #f4c805; padding:10px 0;';\n\n                    listItem.innerHTML = `\n                        <div style=\"display:flex; align-items:center;\">\n                            <img decoding=\"async\" src=\"${bird.thumbnailUrl}\" alt=\"${bird.commonName}\" style=\"width:40px; height:40px; border-radius:15px; margin-right:15px;\"\/>\n                            <span style=\"color:#f4c805; font-size:16px;\">${dutchName}<\/span>\n                        <\/div>\n                        <strong style=\"color:#f4c805; font-size:18px;\">${bird.detections.total}<\/strong>\n                    `;\n\n                    monthList.appendChild(listItem);\n                });\n            } else {\n                document.getElementById('month-list').innerHTML = '<li style=\"color:#f4c805;\">Geen waarnemingen beschikbaar<\/li>';\n            }\n        } catch (error) {\n            console.error('Fout bij het ophalen van gegevens:', error);\n            document.getElementById('month-list').innerHTML = '<li style=\"color:#f4c805;\">Gegevens laden mislukt<\/li>';\n        }\n    }\n\n    \/\/ Initial call to fetch data\n    fetchBirdObservations();\n    fetchTop10Birds();\n    fetchMonthObservations();\n\n    \/\/ Refresh every 5 seconds\n    setInterval(() => {\n        fetchBirdObservations();\n        fetchTop10Birds();\n        fetchMonthObservations();\n    }, 5000);\n<\/script>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Vogels in de tuin Live Top 10 van Vandaag Deze maand<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-851","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/prins-pictures.nl\/index.php\/wp-json\/wp\/v2\/pages\/851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prins-pictures.nl\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/prins-pictures.nl\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/prins-pictures.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prins-pictures.nl\/index.php\/wp-json\/wp\/v2\/comments?post=851"}],"version-history":[{"count":152,"href":"https:\/\/prins-pictures.nl\/index.php\/wp-json\/wp\/v2\/pages\/851\/revisions"}],"predecessor-version":[{"id":1480,"href":"https:\/\/prins-pictures.nl\/index.php\/wp-json\/wp\/v2\/pages\/851\/revisions\/1480"}],"wp:attachment":[{"href":"https:\/\/prins-pictures.nl\/index.php\/wp-json\/wp\/v2\/media?parent=851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}