{"id":77,"date":"2020-10-20T18:48:08","date_gmt":"2020-10-20T18:48:08","guid":{"rendered":"https:\/\/bus13.net\/?p=77"},"modified":"2020-10-20T18:48:08","modified_gmt":"2020-10-20T18:48:08","slug":"metropolitan-museum-of-art-api","status":"publish","type":"post","link":"https:\/\/139-144-31-79.ip.linodeusercontent.com\/?p=77","title":{"rendered":"Metropolitan Museum of Art API"},"content":{"rendered":"\n<p>Kin Lane&#8217;s tweet <a href=\"https:\/\/twitter.com\/kinlane\/status\/1176253406303797248\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/twitter.com\/kinlane\/status\/1176253406303797248<\/a> about the Met&#8217;s API inspired me to do a little exploring.  Will post anything interesting that comes of it.<\/p>\n\n\n\n<p><a href=\" https:\/\/metmuseum.github.io\/\"> https:\/\/metmuseum.github.io\/<\/a><\/p>\n\n\n\n<html>\n<body onload=\"artLoad()\">\n<img height=\"200pt\" id=\"demo0\"><\/img>\n<p height=\"200pt\" id=\"demo1\"><\/p>\n\n\n<script>\n   setInterval( function() {\n                artLoad()\n            }, 10000);\nfunction artLoad() {\n    var x, y;\n    var xhttp1 = new XMLHttpRequest();\n    xhttp1.onreadystatechange = function() {\n        x = JSON.parse(this.responseText);\n        y = x[\"total\"]; \n        var objNum = Math.floor((Math.random() * y) + 1);\n        var metCall =\"https:\/\/collectionapi.metmuseum.org\/public\/collection\/v1\/objects\/\" + objNum;\n        var j, k, l;\n        \n        var xhttp2 = new XMLHttpRequest();\n        xhttp2.onreadystatechange = function() {\n            j = JSON.parse(this.responseText);\n            k = j[\"primaryImage\"];\n            l = j[\"title\"]\n            if (this.readyState == 4 && this.status == 200) {\n              document.getElementById(\"demo0\").src = k;\n              document.getElementById(\"demo1\").innerHTML = l;\n            }\n          }\n          xhttp2.open(\"GET\", metCall, true);\n          xhttp2.send();\n    }\n      xhttp1.open(\"GET\", \"https:\/\/collectionapi.metmuseum.org\/public\/collection\/v1\/objects\", true);\n      xhttp1.send();\n    }\n<\/script>\n\n<\/body>\n<\/html>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Kin Lane&#8217;s tweet https:\/\/twitter.com\/kinlane\/status\/1176253406303797248 about the Met&#8217;s API inspired me to do a little exploring. Will post anything interesting that comes of it. https:\/\/metmuseum.github.io\/<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-77","post","type-post","status-publish","format-standard","hentry","category-api-stuff"],"_links":{"self":[{"href":"https:\/\/139-144-31-79.ip.linodeusercontent.com\/index.php?rest_route=\/wp\/v2\/posts\/77","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/139-144-31-79.ip.linodeusercontent.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/139-144-31-79.ip.linodeusercontent.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/139-144-31-79.ip.linodeusercontent.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/139-144-31-79.ip.linodeusercontent.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=77"}],"version-history":[{"count":0,"href":"https:\/\/139-144-31-79.ip.linodeusercontent.com\/index.php?rest_route=\/wp\/v2\/posts\/77\/revisions"}],"wp:attachment":[{"href":"https:\/\/139-144-31-79.ip.linodeusercontent.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=77"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/139-144-31-79.ip.linodeusercontent.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=77"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/139-144-31-79.ip.linodeusercontent.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}