{"id":18,"date":"2024-04-21T18:37:59","date_gmt":"2024-04-21T18:37:59","guid":{"rendered":"https:\/\/demo.adminhq.cf\/blog\/?page_id=18"},"modified":"2024-04-21T18:38:00","modified_gmt":"2024-04-21T18:38:00","slug":"zipcodes-list","status":"publish","type":"page","link":"https:\/\/demo.adminhq.cf\/blog\/zipcodes-list\/","title":{"rendered":""},"content":{"rendered":"\n<h1>List of the zip codes<\/h1>\n<ul><span class=\"all_zip_codes\">Loading&#8230;<\/span><\/ul>\n\n<script>\n    \/* ======================================================================\n          www.erickouassi.com\n        ====================================================================== *\/\n\n        async function getZipCodes() {\n\nlet url = 'https:\/\/opensheet.elk.sh\/1frAS0LwbW82BqidVpndjq4HaGqUQ-neWmRFBZWGLSas\/Sheet1';\ntry {\n    let res = await fetch(url);\n    return await res.json();\n} catch (error) {\n    console.log(error);\n}\n}\nasync function renderZipCode() {\nlet zip_codes_data = await getZipCodes();\n\/\/console.log(zip_codes_data)\n\nlet items = zip_codes_data.reverse() \/\/ Use revese()  to display all the singleItem Last IN First Order (LIFO)\n    let html = '';\n    items.forEach(singleItem => {\n        let htmlSegment = `\n        <li><p>${singleItem.zip_code}<\/p><\/li>\n       <hr> `;\n\n        html += htmlSegment;\n    });\n\n    let container = document.querySelector('.all_zip_codes');\n    container.innerHTML = html;\n}\n\nrenderZipCode();\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>List of the zip codes Loading&#8230;<\/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-18","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/demo.adminhq.cf\/blog\/wp-json\/wp\/v2\/pages\/18","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demo.adminhq.cf\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/demo.adminhq.cf\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/demo.adminhq.cf\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demo.adminhq.cf\/blog\/wp-json\/wp\/v2\/comments?post=18"}],"version-history":[{"count":1,"href":"https:\/\/demo.adminhq.cf\/blog\/wp-json\/wp\/v2\/pages\/18\/revisions"}],"predecessor-version":[{"id":19,"href":"https:\/\/demo.adminhq.cf\/blog\/wp-json\/wp\/v2\/pages\/18\/revisions\/19"}],"wp:attachment":[{"href":"https:\/\/demo.adminhq.cf\/blog\/wp-json\/wp\/v2\/media?parent=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}