{"id":4251,"date":"2019-02-14T17:05:17","date_gmt":"2019-02-14T09:05:17","guid":{"rendered":"http:\/\/blog.hoyo.idv.tw\/?p=4251"},"modified":"2019-04-15T10:28:24","modified_gmt":"2019-04-15T02:28:24","slug":"google-%e6%97%a5%e6%9b%86-api","status":"publish","type":"post","link":"https:\/\/blog.hoyo.idv.tw\/?p=4251","title":{"rendered":"Google \u65e5\u66c6 API"},"content":{"rendered":"<ul>\n<li><a href=\"https:\/\/lofairy.blogspot.tw\/2016\/01\/javascript-google-calendar-api-google.html\" target=\"_blank\" rel=\"noopener\">[Javascript] \u5229\u7528Google Calendar api \u5b58\u53d6 Google \u884c\u4e8b\u66c6<\/a><\/li>\n<li><a href=\"https:\/\/developers.google.com\/google-apps\/calendar\/quickstart\/js\">JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/qiita.com\/yusuke-asaoka\/items\/c9eaa86968c4d5034801\" target=\"_blank\" rel=\"noopener\">PHP\u3067Google\u30ab\u30ec\u30f3\u30c0\u30fc\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b<\/a><\/li>\n<\/ul>\n<p>--<\/p>\n<h2>PHP \u7248\u672c\u7a0b\u5f0f\u7bc4\u4f8b<\/h2>\n<ul>\n<li><a href=\"https:\/\/developers.google.com\/google-apps\/calendar\/quickstart\/php\">PHP<\/a><\/li>\n<\/ul>\n<p>\u6ce8\u610f\u4e8b\u9805<\/p>\n<ul>\n<li>\u4e00\u5b9a\u8981 PHP 5.4 \u4ee5\u4e0a\u7248\u672c (\u7a0d\u5fae\u770b\u4e00\u4e0b\u5728 5.3 \u4e0a\u904b\u4f5c\u7684\u932f\u8aa4\u78bc\uff0c\u61c9\u8a72\u6c92\u8fa6\u6cd5\u7528 5.3 \u6539\u5beb)<\/li>\n<li>\u4e0d\u9700\u8981\u00a0Composer \uff0c\u53ea\u8981\u5230 Github \u4e0b\u8f09\u58d3\u7e2e\u6a94\u89e3\u58d3\u7e2e\u5c31\u53ef\u4ee5\u4e86\u00a0<a class=\"d-flex flex-items-center\" href=\"https:\/\/github.com\/googleapis\/google-api-php-client\/releases\/download\/v2.2.2\/google-api-php-client-2.2.2_PHP54.zip\" target=\"_blank\" rel=\"nofollow noopener\"> <strong class=\"pl-1 pr-2 flex-auto min-width-0\">google-api-php-client-2.2.2_PHP54.zip<\/strong><\/a><\/li>\n<li>\u5230\u00a0<a href=\"https:\/\/developers.google.com\/calendar\/quickstart\/php\" target=\"_blank\" rel=\"noopener\">https:\/\/developers.google.com\/calendar\/quickstart\/php<\/a>\u00a0\u9ede\u9078\u00a0<strong>ENABLE THE GOOGLE CALENDAR API<\/strong>\u00a0\u6309\u9215\u4e0b\u8f09\u00a0credentials.json \u6a94\u6848<\/li>\n<li>\u5c07\u00a0credentials.json \u6a94\u6848\u653e\u7f6e\u5230 php \u7a0b\u5f0f\u5167 CLIENT_SECRET_PATH \u5b9a\u7fa9\u8def\u5f91\u4ee5\u53ca\u6a94\u540d\uff0c\u4f8b\u5982\u4ee5\u4e0b\u7a0b\u5f0f\u5c31\u5fc5\u9808\u5c07\u6a94\u540d\u6539\u6210\u00a0client_secret.json<\/li>\n<li>\u5230 CLI \u57f7\u884c\u4e0b\u5217 php \u7a0b\u5f0f<\/li>\n<\/ul>\n<pre class=\"lang:php decode:true\">&lt;?php\r\ndate_default_timezone_set('Asia\/Taipei');\r\n\r\nrequire_once __DIR__ . '\/..\/Component_Back\/google-api-php-client-2.2.2_PHP54\/vendor\/autoload.php';\r\n\r\ndefine('APPLICATION_NAME', 'Google Calendar API PHP Quickstart');\r\ndefine('CREDENTIALS_PATH', '~\/.credentials\/calendar-php-quickstart.json');\r\ndefine('CLIENT_SECRET_PATH', __DIR__ . '\/client_secret.json');\r\n\/\/ If modifying these scopes, delete your previously saved credentials\r\n\/\/ at ~\/.credentials\/calendar-php-quickstart.json\r\ndefine('SCOPES', implode(' ', array(\r\n        Google_Service_Calendar::CALENDAR)\r\n));\r\n\r\nif (php_sapi_name() != 'cli') {\r\n    throw new Exception('This application must be run on the command line.');\r\n}\r\n\r\n\/**\r\n * Returns an authorized API client.\r\n * @return Google_Client the authorized client object\r\n *\/\r\nfunction getClient() {\r\n    $client = new Google_Client();\r\n    $client-&gt;setApplicationName(APPLICATION_NAME);\r\n    $client-&gt;setScopes(SCOPES);\r\n    $client-&gt;setAuthConfig(CLIENT_SECRET_PATH);\r\n    $client-&gt;setAccessType('offline');\r\n\r\n    \/\/ Load previously authorized credentials from a file.\r\n    $credentialsPath = expandHomeDirectory(CREDENTIALS_PATH);\r\n    if (file_exists($credentialsPath)) {\r\n        $accessToken = json_decode(file_get_contents($credentialsPath), true);\r\n    } else {\r\n        \/\/ Request authorization from the user.\r\n        $authUrl = $client-&gt;createAuthUrl();\r\n        printf(\"Open the following link in your browser:\\n%s\\n\", $authUrl);\r\n        print 'Enter verification code: ';\r\n        $authCode = trim(fgets(STDIN));\r\n\r\n        \/\/ Exchange authorization code for an access token.\r\n        $accessToken = $client-&gt;fetchAccessTokenWithAuthCode($authCode);\r\n\r\n        \/\/ Store the credentials to disk.\r\n        if(!file_exists(dirname($credentialsPath))) {\r\n            mkdir(dirname($credentialsPath), 0700, true);\r\n        }\r\n        file_put_contents($credentialsPath, json_encode($accessToken));\r\n        printf(\"Credentials saved to %s\\n\", $credentialsPath);\r\n    }\r\n    $client-&gt;setAccessToken($accessToken);\r\n\r\n    \/\/ Refresh the token if it's expired.\r\n    if ($client-&gt;isAccessTokenExpired()) {\r\n        $client-&gt;fetchAccessTokenWithRefreshToken($client-&gt;getRefreshToken());\r\n        file_put_contents($credentialsPath, json_encode($client-&gt;getAccessToken()));\r\n    }\r\n    return $client;\r\n}\r\n\r\n\/**\r\n * Expands the home directory alias '~' to the full path.\r\n * @param string $path the path to expand.\r\n * @return string the expanded path.\r\n *\/\r\nfunction expandHomeDirectory($path) {\r\n    $homeDirectory = getenv('HOME');\r\n    if (empty($homeDirectory)) {\r\n        $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\r\n    }\r\n    return str_replace('~', realpath($homeDirectory), $path);\r\n}\r\n\r\n\/\/ Get the API client and construct the service object.\r\n$client = getClient();\r\n$service = new Google_Service_Calendar($client);\r\n\r\n\/\/ Print the next 10 events on the user's calendar.\r\n$calendarId = 'primary';\r\n$optParams = array(\r\n    'maxResults' =&gt; 10,\r\n    'orderBy' =&gt; 'startTime',\r\n    'singleEvents' =&gt; TRUE,\r\n    'timeMin' =&gt; date('c'),\r\n);\r\n$results = $service-&gt;events-&gt;listEvents($calendarId, $optParams);\r\n\r\nif (count($results-&gt;getItems()) == 0) {\r\n    print \"No upcoming events found.\\n\";\r\n} else {\r\n    print \"Upcoming events:\\n\";\r\n    foreach ($results-&gt;getItems() as $event) {\r\n        $start = $event-&gt;start-&gt;dateTime;\r\n        if (empty($start)) {\r\n            $start = $event-&gt;start-&gt;date;\r\n        }\r\n        printf(\"%s (%s)\\n\", $event-&gt;getSummary(), $start);\r\n    }\r\n}<\/pre>\n<p>\u74b0\u5883\u8a2d\u7f6e\u6210\u529f\u56de\u51fa\u73fe\u4e0b\u5217\u756b\u9762<\/p>\n<pre class=\"lang:default highlight:0 decode:true\">[root@mail:x] # php m.php \r\nOpen the following link in your browser:\r\nhttps:\/\/accounts.google.com\/o\/oauth2\/auth?response_type=code&access_type=offline&client_id=862255922531-phf02o6e7e11gsoh7mpdh326jucct27o.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&state&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar.readonly&approval_prompt=auto\r\nEnter verification code:<\/pre>\n<p>\u5c07\u986f\u793a\u7db2\u5740\u8cbc\u5230\u700f\u89bd\u5668\u6388\u6b0a\u4f7f\u7528\u4e4b\u5f8c\u5373\u53ef\u51fa\u73fe\u6388\u6b0a\u78bc\uff0c\u8907\u88fd\u8cbc\u4e0a\u5373\u53ef<\/p>\n<p><a href=\"https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2019\/02\/Image-014.png\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" class=\"alignnone wp-image-5585 size-medium\" src=\"https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2019\/02\/Image-014-275x300.png\" alt=\"\" width=\"275\" height=\"300\" srcset=\"https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2019\/02\/Image-014-275x300.png 275w, https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2019\/02\/Image-014.png 627w\" sizes=\"(max-width: 275px) 100vw, 275px\" \/><\/a><\/p>\n<p>\u6388\u6b0a\u5b8c\u6210\uff0caccess_token \u6703\u5132\u5b58\u5728\u00a0<strong>CREDENTIALS_PATH<\/strong> \u5b9a\u7fa9\u8def\u5f91\u5167<\/p>\n<p>--<\/p>\n<h2>\u767c\u51fa\u9080\u8acb\u7d66\u540c G Suite \u7684\u5176\u4ed6\u4eba<\/h2>\n<pre class=\"lang:php decode:true\">&lt;?php\r\ndate_default_timezone_set('Asia\/Taipei');\r\n\r\nrequire_once __DIR__ . '\/..\/Component_Back\/google-api-php-client-2.2.2_PHP54\/vendor\/autoload.php';\r\n\r\ndefine('APPLICATION_NAME', 'Google Calendar API PHP Quickstart');\r\ndefine('CREDENTIALS_PATH', '~\/.credentials\/calendar-php-quickstart.json');\r\ndefine('CLIENT_SECRET_PATH', __DIR__ . '\/client_secret.json');\r\n\/\/ If modifying these scopes, delete your previously saved credentials\r\n\/\/ at ~\/.credentials\/calendar-php-quickstart.json\r\n\/\/ CALENDAR_READONLY\r\ndefine('SCOPES', implode(' ', array(\r\n        Google_Service_Calendar::CALENDAR)\r\n));\r\n\r\nif (php_sapi_name() != 'cli') {\r\n    throw new Exception('This application must be run on the command line.');\r\n}\r\n\r\n\/**\r\n * Returns an authorized API client.\r\n * @return Google_Client the authorized client object\r\n *\/\r\nfunction getClient() {\r\n    $client = new Google_Client();\r\n    $client-&gt;setApplicationName(APPLICATION_NAME);\r\n    $client-&gt;setScopes(SCOPES);\r\n    $client-&gt;setAuthConfig(CLIENT_SECRET_PATH);\r\n    $client-&gt;setAccessType('offline');\r\n\r\n    \/\/ Load previously authorized credentials from a file.\r\n    $credentialsPath = expandHomeDirectory(CREDENTIALS_PATH);\r\n    if (file_exists($credentialsPath)) {\r\n        $accessToken = json_decode(file_get_contents($credentialsPath), true);\r\n    } else {\r\n        \/\/ Request authorization from the user.\r\n        $authUrl = $client-&gt;createAuthUrl();\r\n        printf(\"Open the following link in your browser:\\n%s\\n\", $authUrl);\r\n        print 'Enter verification code: ';\r\n        $authCode = trim(fgets(STDIN));\r\n\r\n        \/\/ Exchange authorization code for an access token.\r\n        $accessToken = $client-&gt;fetchAccessTokenWithAuthCode($authCode);\r\n\r\n        \/\/ Store the credentials to disk.\r\n        if(!file_exists(dirname($credentialsPath))) {\r\n            mkdir(dirname($credentialsPath), 0700, true);\r\n        }\r\n        file_put_contents($credentialsPath, json_encode($accessToken));\r\n        printf(\"Credentials saved to %s\\n\", $credentialsPath);\r\n    }\r\n    $client-&gt;setAccessToken($accessToken);\r\n\r\n    \/\/ Refresh the token if it's expired.\r\n    if ($client-&gt;isAccessTokenExpired()) {\r\n        $client-&gt;fetchAccessTokenWithRefreshToken($client-&gt;getRefreshToken());\r\n        file_put_contents($credentialsPath, json_encode($client-&gt;getAccessToken()));\r\n    }\r\n    return $client;\r\n}\r\n\r\n\/**\r\n * Expands the home directory alias '~' to the full path.\r\n * @param string $path the path to expand.\r\n * @return string the expanded path.\r\n *\/\r\nfunction expandHomeDirectory($path) {\r\n    $homeDirectory = getenv('HOME');\r\n    if (empty($homeDirectory)) {\r\n        $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH');\r\n    }\r\n    return str_replace('~', realpath($homeDirectory), $path);\r\n}\r\n\r\n\/\/ Get the API client and construct the service object.\r\n$client = getClient();\r\n$service = new Google_Service_Calendar($client);\r\n\r\n$event = new Google_Service_Calendar_Event(array(\r\n    'summary' =&gt; 'OiKID \u65e5\u66c6\u6d3b\u52d5\u6e2c\u8a66',\r\n    'location' =&gt; '800 Howard St., San Francisco, CA 94103',\r\n    'description' =&gt; 'A chance to hear more about Google\\'s developer products.',\r\n    'start' =&gt; array(\r\n        'dateTime' =&gt; '2019-02-20T09:00:00-07:00',\r\n        'timeZone' =&gt; 'America\/Los_Angeles',\r\n    ),\r\n    'end' =&gt; array(\r\n        'dateTime' =&gt; '2019-02-20T17:00:00-07:00',\r\n        'timeZone' =&gt; 'America\/Los_Angeles',\r\n    ),\r\n    \/\/'recurrence' =&gt; array(\r\n    \/\/    'RRULE:FREQ=DAILY;COUNT=2'\r\n    \/\/),\r\n    'attendees' =&gt; array(\r\n        array('email' =&gt; 'fb01@hoyo.idv.tw'),\r\n        array('email' =&gt; 'phenix@sly-ha.com.tw'),\r\n    ),\r\n    'reminders' =&gt; array(\r\n        'useDefault' =&gt; FALSE,\r\n        'overrides' =&gt; array(\r\n            array('method' =&gt; 'email', 'minutes' =&gt; 24 * 60),\r\n            array('method' =&gt; 'popup', 'minutes' =&gt; 10),\r\n        ),\r\n    ),\r\n));\r\n\r\n$calendarId = 'primary';\r\n$event = $service-&gt;events-&gt;insert($calendarId, $event);\r\nprintf('Event created: %s\\n', $event-&gt;htmlLink);<\/pre>\n<p>&nbsp;<\/p>\n<p>--<\/p>\n<h2>\u8e29\u5230\u7684 bug<\/h2>\n<ul>\n<li><a href=\"https:\/\/github.com\/google\/google-api-php-client\/issues\/988\" target=\"_blank\" rel=\"noopener\">google-api-php-client-2.0.0 #988<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/google\/google-api-php-client\/issues\/843\" target=\"_blank\" rel=\"noopener\">cURL error 60 #843<\/a><\/li>\n<\/ul>\n<p>php.ini<\/p>\n<pre class=\"lang:default decode:true \">curl.cainfo = \"c:\\bin\\php56\\cacert.pem\"<\/pre>\n<p>--<\/p>\n<h2>\u6210\u679c<\/h2>\n<pre class=\"lang:default decode:true\">C:\\bin\\php56\\html&gt;..\\php c.php\r\nUpcoming events:\r\naaaa (2018-02-07T11:30:00+08:00)<\/pre>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-4253\" src=\"https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2018\/02\/Image-137.png\" alt=\"\" width=\"539\" height=\"319\" srcset=\"https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2018\/02\/Image-137.png 539w, https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2018\/02\/Image-137-300x178.png 300w, https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2018\/02\/Image-137-500x296.png 500w\" sizes=\"(max-width: 539px) 100vw, 539px\" \/><\/p>\n<p>--<\/p>\n<h2>\u4f7f\u7528\u7db2\u5740\u52a0\u5165\u81ea\u5df1\u7684\u65e5\u66c6<\/h2>\n<ul>\n<li><a href=\"https:\/\/steachs.com\/archives\/3805\" target=\"_blank\" rel=\"noopener\">\u5982\u4f55\u5efa\u7acb Google \u65e5\u66c6\u9023\u7d50\uff0c\u8b93\u4ed6\u4eba\u900f\u904e\u9023\u7d50\u5feb\u901f\u65b0\u589e\u884c\u4e8b\u66c6<\/a><\/li>\n<li><a href=\"http:\/\/blog.xuite.net\/tolarku\/blog\/439457252\" target=\"_blank\" rel=\"noopener\">\u4f7f\u7528\u9023\u7d50 Link \u5c07\u4e8b\u4ef6\u76f4\u63a5\u65b0\u589e\u81f3 Google Calendar - Create an event by Hyperlink<\/a><\/li>\n<\/ul>\n<pre class=\"lang:default decode:true\">https:\/\/www.google.com\/calendar\/render?action=TEMPLATE&amp;trp=true&amp;sf=true&amp;output=xml&amp;dates=20140711T120000Z\/20140711T143000Z&amp;details=\u5c31\u662f\u6559\u4e0d\u843d%0Ahttps:\/\/steachs.com&amp;location=101\u5927\u6a13101F&amp;text=\u52a0\u5165\u5c31\u662f\u6559\u4e0d\u843d\u7c89\u7d72\u5718<\/pre>\n<p>\u9023\u7d50\u5f8c\u78ba\u8a8d\u6309\u4e0b\u5132\u5b58\u5373\u53ef\u52a0\u5165\u81ea\u5df1\u7684\u65e5\u66c6<\/p>\n<p>\u53e6\u4e00\u500b\u7bc4\u4f8b<\/p>\n<pre class=\"lang:default decode:true \">http:\/\/www.google.com\/calendar\/event?action=TEMPLATE&amp;text=2019+4%E6%9C%88%E4%BB%BD+SA%40Taipei+%E5%A4%A7%E6%95%B8%E6%93%9A%E7%9A%84%E5%AF%A6%E8%B8%90%EF%BC%8C%E9%99%A4%E4%BA%86%E6%8A%80%E8%A1%93%EF%BC%8C%E9%82%84%E9%9C%80%E8%A6%81%E4%BB%80%E9%BA%BC%EF%BC%9F&amp;dates=20190420T050000Z\/20190420T070000Z&amp;details=https:\/\/studyarea.kktix.cc\/events\/33b9e0e6-copy-1&amp;location=%E5%8F%B0%E5%8C%97%E5%B8%82%E5%85%A7%E6%B9%96%E5%8D%80%E6%B4%B2%E5%AD%90%E8%A1%97196%E8%99%9F&amp;trp=true&amp;sprop=https:\/\/studyarea.kktix.cc\/events\/33b9e0e6-copy-1&amp;sprop=name:KKTIX<\/pre>\n<p>--<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"4251\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;5,031&nbsp;total views, &nbsp;1&nbsp;views today<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>[Javascript] \u5229\u7528...<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"4251\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;5,031&nbsp;total views, &nbsp;1&nbsp;views today<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[31],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/4251"}],"collection":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4251"}],"version-history":[{"count":18,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/4251\/revisions"}],"predecessor-version":[{"id":5803,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/4251\/revisions\/5803"}],"wp:attachment":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}