{"id":872,"date":"2014-02-19T18:45:17","date_gmt":"2014-02-19T10:45:17","guid":{"rendered":"http:\/\/www.yeetrack.com\/?p=872"},"modified":"2014-02-19T18:45:17","modified_gmt":"2014-02-19T10:45:17","slug":"php%e4%bd%bf%e7%94%a8comet%e5%ae%9e%e7%8e%b0%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%90%91%e6%b5%8f%e8%a7%88%e5%99%a8%e6%8e%a8%e9%80%81%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/www.yeetrack.com\/?p=872","title":{"rendered":"php\u4f7f\u7528COMET\u5b9e\u73b0\u670d\u52a1\u5668\u5411\u6d4f\u89c8\u5668\u63a8\u9001\u6570\u636e"},"content":{"rendered":"<p>Comet\u6280\u672f\u53ef\u4ee5\u8ba9\u540e\u53f0\u670d\u52a1\u5668\u5728\u6d4f\u89c8\u5668\u6ca1\u6709\u53d1\u8d77\u8bf7\u6c42\u7684\u60c5\u51b5\u4e0b\uff0c\u5411\u7528\u6237\u6d4f\u89c8\u5668\u63a8\u9001\u6570\u636e\u3002\u8fd9\u79cd\u6280\u672f\u6bd4\u4f20\u7edf\u7684ajax\u6280\u672f\u66f4\u5177\u6709\u65f6\u6548\u6027\u3002\u4f20\u7edf\u7684ajax\u4e2d\uff0c\u670d\u52a1\u5668\u5728\u6570\u636e\u53d1\u751f\u53d8\u52a8\u65f6\u4e0d\u80fd\u5373\u65f6\u901a\u77e5\u6d4f\u89c8\u5668\u3002\u7528\u6237\u7684\u6d4f\u89c8\u5668\u5fc5\u987b\u5411\u540e\u53f0\u53d1\u51fa\u8bf7\u6c42\uff08\u5982\u70b9\u51fb\u4e00\u4e2a\u94fe\u63a5\u6216\u8005\u4f7f\u7528\u6301\u4e45\u7684ajax\uff09\uff0c\u624d\u80fd\u83b7\u5f97\u6700\u65b0\u7684\u6570\u636e\u3002\u82f1\u6587\u5730\u5740\uff1ahttp:\/\/www.zeitoun.net\/articles\/comet_and_php\/start<!--more--><\/p>\n<p>\u4e0b\u9762\u89e3\u91ca\u4f7f\u7528php\u5b9e\u73b0comet\u6280\u672f\u3002\u4e0b\u9762\u662f\u4e24\u79cd\u4e0d\u540c\u7684\u65b9\u5f0f\u5b9e\u73b0comet\uff1a\u7b2c\u4e00\u79cd\u57fa\u4e8ehidden<code>&lt;iframe&gt;<\/code>\uff0c\u53e6\u4e00\u79cd\u57fa\u4e8e\u4f20\u7edf\u7684ajax non-returning\u8bf7\u6c42\u3002\u7b2c\u4e00\u4e2a\u4f8b\u5b50\u7b80\u5355\u5730\u5b9e\u73b0\u4e86\u5728\u6d4f\u89c8\u5668\u4e0a\u4e0d\u65ad\u5730\u8f93\u51fa\u65f6\u95f4\u6233\uff0c\u7b2c\u4e8c\u4e2a\u4f8b\u5b50\u7b80\u5355\u5b9e\u73b0\u4e86\u5728\u7ebf\u804a\u5929\u529f\u80fd\u3002<\/p>\n<h2>iframe\u6280\u672f\u5b9e\u73b0comet:\u65f6\u95f4\u6233demo<\/h2>\n<p>\u6211\u4eec\u9700\u8981\uff1a<\/p>\n<ul>\n<li>\u4e00\u4e2aphp\u811a\u672c\u6765\u5904\u7406\u6301\u4e45\u5316\u7684http\u8bf7\u6c42\uff08backend.php\uff09<\/li>\n<li>\u4e00\u4e2ahtml\u6587\u4ef6\u6765\u52a0\u8f7d\u76f8\u5173\u7684javascript\u4ee3\u7801\uff0c\u6765\u5c55\u793a\u670d\u52a1\u5668\u8fd4\u56de\u7684\u6570\u636e\uff08index.html\uff09<\/li>\n<li><a href=\"http:\/\/www.prototypejs.org\/\">prototype<\/a>\u8fd9\u4e2a\u5e93\u6587\u4ef6\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5199\u4e00\u4e9b\u7b80\u5355\u7684js\u4ee3\u7801<\/li>\n<\/ul>\n<p>\u4e0b\u9762\u662f\u8fd9\u4e2ademo\u7684\u6d41\u7a0b:<\/p>\n<h3>\u540e\u53f0\u7684php\u811a\u672c<\/h3>\n<p>\u8fd9\u4e2a\u811a\u672c\u4f1a\u8fdb\u5165\u4e00\u4e2a\u6b7b\u5faa\u73af\uff0c\u5728\u5ba2\u6237\u7aef\u8fde\u63a5\u65f6\uff0c\u4e0d\u65ad\u5411\u5ba2\u6237\u7aef\u8f93\u51fa\u65f6\u95f4\u6233\u4fe1\u606f\u3002\u4e0b\u9762\u662f<code>backend.php<\/code>\u7684\u4ee3\u7801\uff1a<\/p>\n<pre><code>&lt;?php\n\n    header(\"Cache-Control: no-cache, must-revalidate\");\n    header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n    flush();\n\n?&gt;\n&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.1\/\/EN\" \"http:\/\/www.w3.org\/TR\/xhtml11\/DTD\/xhtml11.dtd\"&gt;\n&lt;html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"&gt;\n&lt;head&gt;\n\n        &lt;title&gt;Comet php backend&lt;\/title&gt;\n        &lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\" \/&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n\n&lt;script type=\"text\/javascript\"&gt;\n        \/\/ KHTML browser don't share javascripts between iframes\n        var is_khtml = navigator.appName.match(\"Konqueror\") || navigator.appVersion.match(\"KHTML\");\n        if (is_khtml)\n        {\n            var prototypejs = document.createElement('script');\n            prototypejs.setAttribute('type','text\/javascript');\n            prototypejs.setAttribute('src','prototype.js');\n            var head = document.getElementsByTagName('head');\n            head[0].appendChild(prototypejs);\n        }\n        \/\/ load the comet object\n        var comet = window.parent.comet;\n\n&lt;\/script&gt;\n\n&lt;?php\n\n    while(1) \n    {\n            echo '&lt;script type=\"text\/javascript\"&gt;';\n            echo 'comet.printServerTime('.time().');';\n            echo '&lt;\/script&gt;';\n            ob_flush();\/\/\u539f\u6587\u4ee3\u7801\u6ca1\u6709\u8fd9\u4e00\u884c\n            flush(); \/\/ used to send the echoed data to the client\n            sleep(1); \/\/ a little break to unload the server CPU\n    }\n\n?&gt;\n<\/code><\/pre>\n<h3>\u5ba2\u6237\u7aefhtml\u811a\u672c<\/h3>\n<p>\u5ba2\u6237\u7aef\u7684html\u6587\u4ef6\u4e2d\uff0c\u9996\u5148\u4f1a\u5728<code>&lt;head&gt;<\/code>\u6807\u7b7e\u4e2d\u52a0\u8f7dprototype\u5e93\u6587\u4ef6\uff0c\u63a5\u7740\u521b\u5efa\u7528\u6765\u5c55\u793a\u65f6\u95f4\u6233\u4fe1\u606f\u7684div\u6807\u7b7e<code>&lt;div id=\"content\"&gt;&lt;\/div&gt;<\/code>\uff0c\u6700\u540e\u521b\u5efa\u4e86\u4e00\u4e2a<code>comet<\/code>\u5bf9\u8c61\uff0c\u901a\u8fc7\u5b83\u8fde\u63a5\u5230\u540e\u53f0\u811a\u672c\u3002<\/p>\n<p>comet\u5bf9\u8c61\u4f1a\u521b\u5efa\u4e00\u4e9b\u4e0d\u53ef\u89c1\u7684iframe\u6807\u7b7e\uff0c\u8fd9\u4e9biframe\u662f\u4e3a\u4e86\u521b\u5efa\u6301\u7eed\u7684\u8fde\u63a5\u5230\u540e\u53f0\u811a\u672c\u7684http\u8fde\u63a5\u3002Notice\uff1a\u8fd9\u4e2a\u811a\u672c\u4e0d\u4f1a\u5904\u7406client\u745cserver\u4e4b\u95f4\u7684\u8fde\u63a5\u95ee\u9898\u3002<\/p>\n<pre><code>    &lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.1\/\/EN\" \"http:\/\/www.w3.org\/TR\/xhtml11\/DTD\/xhtml11.dtd\"&gt;\n    &lt;html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"&gt;\n        &lt;head&gt;\n            &lt;title&gt;Comet demo&lt;\/title&gt;\n            &lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\" \/&gt;\n            &lt;script type=\"text\/javascript\" src=\"prototype.js\"&gt;&lt;\/script&gt;\n\n        &lt;\/head&gt;\n        &lt;body&gt;\n        &lt;div id=\"content\"&gt;The server time will be shown here&lt;\/div&gt;\n\n        &lt;script type=\"text\/javascript\"&gt;\n            var comet = {\n            connection   : false,\n            iframediv    : false,\n\n            initialize: function() {\n                if (navigator.appVersion.indexOf(\"MSIE\") != -1) {\n\n                    \/\/ For IE browsers\n                    comet.connection = new ActiveXObject(\"htmlfile\");\n                    comet.connection.open();\n                    comet.connection.write(\"&lt;html&gt;\");\n                    comet.connection.write(\"&lt;script&gt;document.domain = '\"+document.domain+\"'\");\n                    comet.connection.write(\"&lt;\/html&gt;\");\n                    comet.connection.close();\n                    comet.iframediv = comet.connection.createElement(\"div\");\n                    comet.connection.appendChild(comet.iframediv);\n                    comet.connection.parentWindow.comet = comet;\n                    comet.iframediv.innerHTML = \"&lt;iframe id='comet_iframe' src='.\/backend.php'&gt;&lt;\/iframe&gt;\";\n\n                } else if (navigator.appVersion.indexOf(\"KHTML\") != -1) {\n\n                    \/\/ for KHTML browsers\n                    comet.connection = document.createElement('iframe');\n                    comet.connection.setAttribute('id',     'comet_iframe');\n                    comet.connection.setAttribute('src',    '.\/backend.php');\n                    with (comet.connection.style) {\n                        position   = \"absolute\";\n                        left       = top   = \"-100px\";\n                        height     = width = \"1px\";\n                        visibility = \"hidden\";\n                    }\n                    document.body.appendChild(comet.connection);\n\n                    } else {\n\n                        \/\/ For other browser (Firefox...)\n                        comet.connection = document.createElement('iframe');\n                        comet.connection.setAttribute('id',     'comet_iframe');\n                        with (comet.connection.style) {\n                            left       = top   = \"-100px\";\n                            height     = width = \"1px\";\n                            visibility = \"hidden\";\n                            display    = 'none';\n                        }\n                        comet.iframediv = document.createElement('iframe');\n                        comet.iframediv.setAttribute('src', '.\/backend.php');\n                        comet.connection.appendChild(comet.iframediv);\n                        document.body.appendChild(comet.connection);\n\n                    }\n                },\n\n                \/\/ this function will be called from backend.php  \n                printServerTime: function (time) {\n                    $('content').innerHTML = time;\n                },\n\n                onUnload: function() {\n                if (comet.connection) {\n                    comet.connection = false; \/\/ release the iframe to prevent problems with IE when reloading the page\n                }\n            }\n        }\n        Event.observe(window, \"load\",   comet.initialize);\n        Event.observe(window, \"unload\", comet.onUnload);\n\n    &lt;\/script&gt;\n\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n<h3>\u4e0b\u8f7d\u6e90\u7801<\/h3>\n<p>\u70b9\u51fb<a href=\"http:\/\/www.zeitoun.net\/_media\/articles\/comet_and_php\/comet-iframe.tar.gz\">tar.gz<\/a>\u4e0b\u8f7d\u6b64demo\u3002<\/p>\n<h2>\u4f20\u7edfajax\u5b9e\u73b0comet\uff1a\u5c0f\u578b\u5728\u7ebf\u804a\u5929demo<\/h2>\n<p>\u5b9e\u73b0\u8fd9\u4e2ademo\uff0c\u6211\u4eec\u9700\u8981\uff1a<\/p>\n<ul>\n<li>\u4e00\u4e2a\u7528\u6765\u5b58\u50a8\u3001\u4ea4\u6362\u6570\u636e\u7684\u6587\u4ef6(data.txt)<\/li>\n<li>\u4e00\u4e2aphp\u811a\u672c\uff0c\u7528\u6765\u5904\u7406\u6301\u7eed\u5316\u7684http\u8bf7\u6c42\uff08backend.php)<\/li>\n<li>\u4e00\u4e2ahtml\u6587\u4ef6\uff0c\u7528\u6765\u52a0\u8f7djavascript\u4ee3\u7801\uff0c\u5c55\u793a\u670d\u52a1\u5668\u53d1\u9001\u8fc7\u6765\u7684\u6570\u636e<\/li>\n<li><a href=\"http:\/\/www.prototypejs.org\/\">prototype<\/a>\u8fd9\u4e2a\u5e93\u6587\u4ef6\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5199\u4e00\u4e9b\u7b80\u5355\u7684js\u4ee3\u7801<\/li>\n<\/ul>\n<h3>\u540e\u53f0\u7684php\u811a\u672c<\/h3>\n<p>\u540e\u53f0\u7684\u811a\u672c\u5b8c\u6210\u4e24\u4e2a\u529f\u80fd\uff1a<\/p>\n<ul>\n<li>\u63a5\u6536\u7528\u6237\u7684\u8f93\u5165\uff0c\u5c06\u65b0\u6d88\u606f\u4fdd\u5b58\u5230data.txt\u4e2d<\/li>\n<li>\u6267\u884c\u6b7b\u5faa\u73af\uff0c\u76d1\u6d4bdata.txt\u662f\u5426\u53d1\u751f\u53d8\u5316<\/li>\n<\/ul>\n<p>\u4e0b\u9762\u662f\u4ee3\u7801\uff1a<\/p>\n<pre><code>&lt;?php\n\n    $filename  = dirname(__FILE__).'\/data.txt';\n\n    \/\/ \u5c06\u65b0\u6d88\u606f\u5199\u5165\u6587\u4ef6\n    $msg = isset($_GET['msg']) ? $_GET['msg'] : '';\n    if ($msg != '')\n    {\n        file_put_contents($filename,$msg);\n        die();\n    }\n\n    \/\/ infinite loop until the data file is not modified\n    $lastmodif    = isset($_GET['timestamp']) ? $_GET['timestamp'] : 0;\n    $currentmodif = filemtime($filename);\n    while ($currentmodif &lt;= $lastmodif) \/\/ check if the data file has been modified\n    {\n        usleep(10000); \/\/ sleep 10ms to unload the CPU\n        clearstatcache();\n        $currentmodif = filemtime($filename);\n    }\n\n    \/\/ return a json array\n    $response = array();\n    $response['msg']       = file_get_contents($filename);\n    $response['timestamp'] = $currentmodif;\n    echo json_encode($response);\n    flush();\n\n?&gt;\n<\/code><\/pre>\n<h3>\u5ba2\u6237\u7aef\u7684html\u6587\u4ef6<\/h3>\n<p>\u5ba2\u6237\u7aef\u7684html\u6587\u4ef6\uff0c\u9996\u5148\u5728<code>head<\/code>\u6807\u7b7e\u4e2d\u52a0\u8f7d\u4e86protytype\u5e93\u6587\u4ef6\uff0c\u7136\u540e\u521b\u5efa\u4e86`<\/p>\n<div id=\"content\"><\/div>\n<p>\uff0c\u7528\u6765\u5c55\u793a\u6d88\u606f\u5217\u8868\uff0c\u6700\u540e\u521b\u5efa\u4e86object\u5bf9\u8c61\uff0c\u8c03\u7528\u540e\u53f0php\u811a\u672c\u6765\u76d1\u6d4b\u65b0\u6d88\u606f\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u6bcf\u63a5\u6536\u4e00\u6761\u65b0\u6d88\u606f\u6216\u8005\u53d1\u9001\u4e00\u6761\u6d88\u606f\uff0ccomet\u5bf9\u8c61\u90fd\u4f1a\u53d1\u9001\u4e00\u4e2aajax\u8bf7\u6c42\u3002\u8fd9\u79cd\u6301\u4e45\u7684http\u8bf7\u6c42\u4ec5\u7528\u6765\u68c0\u6d4b\u65b0\u6d88\u606f\u3002url\u4e2d\u643a\u5e26\u7684\u65f6\u95f4\u6233\u53c2\u6570\u6807\u660e\u4e86\u6700\u540e\u4e00\u6761\u6d88\u606f\uff0c\u670d\u52a1\u5668\u4e4b\u540e\u8fd4\u56de\u8be5\u65f6\u95f4\u6233\u4e4b\u540e\u7684\u6d88\u606f\uff08\u5373\u65b0\u6d88\u606f\uff09\u3002<\/p>\n<pre><code>&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.1\/\/EN\" \"http:\/\/www.w3.org\/TR\/xhtml11\/DTD\/xhtml11.dtd\"&gt;\n&lt;html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"&gt;\n    &lt;head&gt;\n        &lt;title&gt;Comet demo&lt;\/title&gt;\n\n        &lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\" \/&gt;\n        &lt;script type=\"text\/javascript\" src=\"prototype.js\"&gt;&lt;\/script&gt;\n    &lt;\/head&gt;\n    &lt;body&gt;\n\n        &lt;div id=\"content\"&gt;\n        &lt;\/div&gt;\n\n        &lt;p&gt;\n            &lt;form action=\"\" method=\"get\" onsubmit=\"comet.doRequest($('word').value);$('word').value='';return false;\"&gt;\n            &lt;input type=\"text\" name=\"word\" id=\"word\" value=\"\" \/&gt;\n            &lt;input type=\"submit\" name=\"submit\" value=\"Send\" \/&gt;\n            &lt;\/form&gt;\n        &lt;\/p&gt;\n\n        &lt;script type=\"text\/javascript\"&gt;\n        var Comet = Class.create();\n        Comet.prototype = {\n\n                timestamp: 0,\n                url: '.\/backend.php',\n                noerror: true,\n\n                initialize: function() { },\n\n                connect: function()\n                {\n                    this.ajax = new Ajax.Request(this.url, {\n                        method: 'get',\n                        parameters: { 'timestamp' : this.timestamp },\n                        onSuccess: function(transport) {\n                        \/\/ handle the server response\n                        var response = transport.responseText.evalJSON();\n                        this.comet.timestamp = response['timestamp'];\n                        this.comet.handleResponse(response);\n                        this.comet.noerror = true;\n                        },\n                    onComplete: function(transport) {\n                    \/\/ send a new ajax request when this request is finished\n                    if (!this.comet.noerror)\n                    \/\/ if a connection problem occurs, try to reconnect each 5 seconds\n                        setTimeout(function(){ comet.connect() }, 5000); \n                    else\n                         this.comet.connect();\n                    this.comet.noerror = false;\n                }\n            });\n                this.ajax.comet = this;\n            },\n\n            disconnect: function()\n            {\n            },\n\n            handleResponse: function(response)\n            {\n                $('content').innerHTML += '&lt;div&gt;' + response['msg'] + '&lt;\/div&gt;';\n            },\n\n            doRequest: function(request)\n            {\n                new Ajax.Request(this.url, {\n                    method: 'get',\n                    parameters: { 'msg' : request \n                });\n                }\n            }\n            var comet = new Comet();\n        comet.connect();\n    &lt;\/script&gt;\n\n    &lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n<h3>\u4e0b\u8f7d\u6e90\u7801<\/h3>\n<p>\u70b9\u51fb<a href=\"http:\/\/www.zeitoun.net\/_media\/articles\/comet_and_php\/comet-ajax.tar.gz\">tar.gz<\/a>\u4e0b\u8f7d<\/p>\n<h2>\u4e2a\u4eba\u7406\u89e3<\/h2>\n<p>\u6240\u8c13\u7684comet\u6280\u672f\uff0c\u672c\u8d28\u4e0a\u8fd8\u662f\u4f7f\u7528\u7684\u6d4f\u89c8\u5668\u8f6e\u8be2\u65b9\u6cd5\uff0c\u548c\u4f20\u7edf\u7684\u8f6e\u8be2\u4e0d\u540c\u7684\u662f\uff1acomet\u53d1\u51fa\u4e00\u4e2aajax\u8bf7\u6c42\uff0c\u5982\u679c\u540e\u53f0\u6ca1\u6709\u9700\u8981\u63a8\u9001\u7684\u6570\u636e\uff0c\u90a3\u4e48\u670d\u52a1\u5668\u5c31\u4f1a\u6267\u884csleep\uff0c\u8ba9\u6d4f\u89c8\u5668\u7b49\u5f85\uff0c\u76f4\u5230\u670d\u52a1\u5668\u4ea7\u751f\u4e86\u9700\u8981\u63a8\u9001\u7684\u6570\u636e\u6216\u8005\u6267\u884c\u8d85\u65f6\uff08php\u9ed8\u8ba4\u5e94\u8be5\u662f30\u79d2\u8d85\u65f6\uff09\uff0c\u8fd9\u65f6\u5019\u6d4f\u89c8\u5668\u53d1\u73b0\u8fde\u63a5\u975e\u6b63\u5e38\u65ad\u5f00\uff0cok\uff0c\u7ee7\u7eed\u53d1\u8d77ajax\u8bf7\u6c42\uff0c\u91cd\u590d\u4e0a\u9762\u7684\u8fc7\u7a0b\u3002\u6240\u4ee5comet\u4f1a\u5728\u6d4f\u89c8\u5668\u548c\u540e\u53f0\u670d\u52a1\u5668\u95f4\u4e00\u76f4\u7ef4\u6301\u7740\u8fde\u63a5\uff0c\u6240\u4ee5\u670d\u52a1\u5668\u7aef\u7684\u538b\u529b\u6bd4\u8f83\u5927\uff0c\u591a\u5c11\u4e2a\u7528\u6237\u5c31\u5f97\u5360\u7528\u591a\u5c11\u4e2a\u8fde\u63a5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Comet\u6280\u672f\u53ef\u4ee5\u8ba9\u540e\u53f0\u670d\u52a1\u5668\u5728\u6d4f\u89c8\u5668\u6ca1\u6709\u53d1\u8d77\u8bf7\u6c42\u7684\u60c5\u51b5\u4e0b\uff0c\u5411\u7528\u6237\u6d4f\u89c8\u5668\u63a8\u9001\u6570\u636e\u3002\u8fd9\u79cd\u6280\u672f\u6bd4\u4f20\u7edf\u7684ajax\u6280\u672f\u66f4\u5177\u6709\u65f6\u6548\u6027\u3002\u4f20\u7edf\u7684ajax\u4e2d\uff0c\u670d\u52a1\u5668\u5728\u6570\u636e\u53d1\u751f\u53d8\u52a8\u65f6\u4e0d\u80fd\u5373\u65f6\u901a\u77e5\u6d4f\u89c8\u5668\u3002\u7528\u6237\u7684\u6d4f\u89c8\u5668\u5fc5\u987b&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[33],"tags":[9,15,7,5,22],"class_list":["post-872","post","type-post","status-publish","format-standard","hentry","category-coding","tag-javascript","tag-15","tag-7","tag-5","tag-22"],"views":13961,"_links":{"self":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts\/872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=872"}],"version-history":[{"count":1,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts\/872\/revisions"}],"predecessor-version":[{"id":873,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts\/872\/revisions\/873"}],"wp:attachment":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}