{"id":154293,"date":"2012-10-18T12:35:05","date_gmt":"2012-10-18T08:35:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=154293"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=154293","title":{"rendered":"<span class=\"post_title\">Cackle \u2014 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0414\u0430\u043d\u043d\u044b\u0439 \u0442\u043e\u043f\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0432\u0441\u0435\u043c \u0442\u0435\u043c, \u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u0438\u0434\u0436\u0435\u0442 <a href=\"http:\/\/cackle.me\">Cackle <\/a> \u0438 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u0430\u0445. \u0412\u0441\u0435 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0438\u0436\u0435, \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435 \u0434\u043b\u044f WordPress \u0432\u0435\u0440\u0441\u0438\u0438 2.0 \u0438 \u0432\u044b\u0448\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0434\u0430\u043d\u043d\u0443\u044e CMS, \u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043d\u0430 php.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0414\u043b\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u0438, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0432\u0430\u0448\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 html \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0430\u0439\u0442\u0430, \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u0430 Cackle. \u0412 \u043e\u0431\u0449\u0435\u043c \u0432\u0438\u0434\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:  <\/p>\n<ul>\n<li>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u043b \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/li>\n<li>\u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 div<\/li>\n<\/ul>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/h4>\n<p>  \u0422\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0430 \u0431\u044b \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u043d\u0430\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b(\u043f\u0440\u0438\u043c\u0435\u0440 mysql):  <\/p>\n<pre><code class=\"sql\">CREATE TABLE `comment` ( \t`comment_id` BIGINT(20) NOT NULL AUTO_INCREMENT, \t`post_id` BIGINT(20) NULL DEFAULT NULL, \t`url` VARCHAR(2000) NULL DEFAULT NULL, \t`parent` VARCHAR(20) NULL DEFAULT NULL, \t`message` TEXT NULL, \t`media` VARCHAR(1000) NULL DEFAULT NULL, \t`status` VARCHAR(11) NULL DEFAULT NULL, \t`rating` INT(11) NULL DEFAULT NULL, \t`user_agent` VARCHAR(1000) NULL DEFAULT NULL, \t`ip` VARCHAR(39) NULL DEFAULT NULL, \t`author_name` VARCHAR(60) NULL DEFAULT NULL, \t`author_email` VARCHAR(100) NULL DEFAULT NULL, \t`author_www` VARCHAR(200) NULL DEFAULT NULL, \t`author_avatar` VARCHAR(200) NULL DEFAULT NULL, \t`author_provider` VARCHAR(32) NULL DEFAULT NULL, \t`anonym_name` VARCHAR(60) NULL DEFAULT NULL, \t`anonym_email` VARCHAR(100) NULL DEFAULT NULL, \t`created` DATETIME NULL DEFAULT NULL, \tPRIMARY KEY (`comment_id`) ); CREATE TABLE `common` ( \t`common_name` VARCHAR(50) NULL DEFAULT NULL, \t`common_value` VARCHAR(50) NULL DEFAULT NULL ) <\/code><\/pre>\n<p>  \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0440\u0435\u043c\u0430\u0440\u043a\u0438:  <\/p>\n<ul>\n<li>post_id \u2014 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u0441\u0442\u0430, \u0432 \u0441\u0430\u043c\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 url \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<\/li>\n<li>media \u2014 \u043c\u0435\u0434\u0438\u0430 \u043a\u043e\u043d\u0442\u0435\u043d\u0442, \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f (png, jpg, gif), \u0432\u0438\u0434\u0435\u043e (youtube, vimeo, \u0432\u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0435, rutube), \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438 (google, slideshare)<\/li>\n<li>status \u2014 0 \u043d\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0438, 1 \u043e\u0434\u043e\u0431\u0440\u0435\u043d\u043e, 2 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u043e, 3 \u0441\u043f\u0430\u043c, 4 \u0443\u0434\u0430\u043b\u0435\u043d\u043e<\/li>\n<li>author_provider \u2014 \u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0435\u0442\u044c (facebook, twitter, linkedin, ..)<\/li>\n<li>created \u2014 \u0434\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f<\/li>\n<li>common \u2014 \u00ab\u0443\u0442\u0438\u043b\u044c\u043d\u0430\u044f\u00bb \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/li>\n<\/ul>\n<p>  PS: \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0430 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u2014 post, author, anonym, \u0445\u043e\u0442\u044f \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435 \u043f\u043b\u043e\u0445\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<h4>\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432<\/h4>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c Cackle \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 RESTful API \u0441\u0435\u0440\u0432\u0438\u0441\u0443:  <\/p>\n<pre><code class=\"bash\">http:\/\/cackle.me\/api\/comment\/list?siteApiKey={siteApiKey}&accountApiKey={accountApiKey}&id={id} <\/code><\/pre>\n<p>  \u0413\u0434\u0435 <b>siteApiKey <\/b>(Site API Key) \u0438 <b>accountApiKey <\/b>(Account API Key) \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043f\u0430\u043d\u0435\u043b\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u00ab\u0412\u0438\u0434\u0436\u0435\u0442\u00bb, \u0441\u043d\u0438\u0437\u0443 \u0432\u044b\u0431\u0440\u0430\u0432 WordPress, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0430\u0445 \u043d\u0438\u0436\u0435:<br \/>  <img decoding=\"async\" src=\"http:\/\/ru.cackle.me\/static\/img\/comment-sync1.png\" alt=\"image\"\/><br \/>  <img decoding=\"async\" src=\"http:\/\/ru.cackle.me\/static\/img\/comment-sync2.png\" alt=\"image\"\/><br \/>  \u041d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <b>id <\/b>\u0441\u043b\u0443\u0436\u0438\u0442 \u043a\u0443\u0440\u0441\u043e\u0440\u043e\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u0435\u0440\u043d\u0435\u0442 \u0432\u0441\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 id, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c <b>id <\/b>\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435. \u0415\u0441\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <b>id <\/b>\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442, \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u043f\u0435\u0440\u0432\u044b\u0435 100 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432.<\/p>\n<p>  \u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e \u0441\u0445\u0435\u043c\u0435:  <\/p>\n<ul>\n<li>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043f\u0440\u043e\u0448\u043b\u043e \u043b\u0438 5 \u043c\u0438\u043d\u0443\u0442 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 API, \u0435\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u0438\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435<\/li>\n<li>\u0411\u0435\u0440\u0435\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 Cackle ID \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 0, \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043d\u0435\u0442<\/li>\n<li>\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c API \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c Cackle ID<\/li>\n<li>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438<\/li>\n<li>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0435\u0433\u043e \u043a\u0430\u043a \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 API<\/li>\n<\/ul>\n<p>  \u0418\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u043c\u0435\u0436\u0434\u0443 \u0432\u044b\u0437\u043e\u0432\u0430\u043c\u0438 API \u043d\u0443\u0436\u0435\u043d \u0438\u0437-\u0437\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043b\u0438\u043c\u0438\u0442\u0430 (1000 \u0440\u0430\u0437 \u0432 \u0447\u0430\u0441, \u043d\u0430 \u0432\u044b\u0437\u043e\u0432 \u043b\u044e\u0431\u043e\u0433\u043e API \u0437\u0430\u043f\u0440\u043e\u0441\u0430).<br \/>  \u041a\u043e\u0434 \u043d\u0430 php:<br \/>  \u0412\u043e \u2014 \u043f\u0435\u0440\u0432\u044b\u0445 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u044b: \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0411\u0414, \u0432\u0440\u0435\u043c\u044f \u043a\u0440\u043e\u043d\u0430, \u043a\u043b\u044e\u0447\u0438 \u043a api Cackle   <\/p>\n<pre><code class=\"php\">\/\/Define db connection settings define('CACKLE_DB_LOCALHOST', &quot;localhost&quot;); define('CACKLE_DB_USER',  &quot;root&quot;); define('CACKLE_DB_PASSWORD', &quot;&quot;); define('CACKLE_DB_NAME', &quot;cackle-php&quot; ); \/\/Define timer define('CACKLE_TIMER', 60); \/\/Define Cackle API define('ACCOUNT_API_KEY',  &quot;&quot;); define('SITE_API_KEY', &quot;&quot;); <\/code><\/pre>\n<p>  \u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u043a\u0440\u043e\u043d\u0430:  <\/p>\n<pre><code class=\"php\">function time_is_over($cron_time){         $sql=&quot;select common_value from common where `common_name` = 'last_time'&quot;;         $get_last_time = $this-&gt;db_connect($sql, &quot;common_value&quot;);         $now=time();         $establish_time_sql=&quot;insert into `common` (`common_name`,`common_value`) values ('last_time',$now)&quot;;         $delete_time_sql=&quot;delete from `common` where `common_name` = 'last_time' and `common_value` &gt; 0;&quot;;         if ($get_last_time==null){             $this-&gt;db_connect($establish_time_sql);             return time();         }         else{             if($get_last_time + $cron_time &gt; $now){                 return false;             }             if($get_last_time + $cron_time &lt; $now){                 $this-&gt;db_connect($delete_time_sql);                 $this-&gt;db_connect($establish_time_sql);                 return $cron_time;             }         }     } <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f comment_sync \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0430\u043f\u0438, \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0432 \u0431\u0434.  <\/p>\n<pre><code class=\"php\">function comment_sync($accountApiKey,$siteApiKey,$cackle_last_comment=0){         $params = &quot;accountApiKey=$accountApiKey&siteApiKey=$siteApiKey&id=$cackle_last_comment&quot;;         $host=&quot;cackle.me\/api\/comment\/list?$params&quot;;         $response = curl($host);         $response = $this-&gt;cackle_json_decodes($response);         $this-&gt;push_comments($response); \/\/\u0432\u044b\u0437\u043e\u0432 for \u0446\u0438\u043a\u043b\u0430 \u043f\u0440\u043e\u0431\u0435\u0433\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u043e \u0432\u0441\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 insert_comment() } <\/code><\/pre>\n<p>  \u0421\u0430\u043c\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f insert_comment() \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0430\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432  <\/p>\n<pre><code class=\"php\">function insert_comm($comment){ ...     if ($comment['parentId']) {              $comment_parent_id = $comment['parentId'];             $sql = &quot;select comment_id from comment where user_agent='Cackle:$comment_parent_id';&quot;;             $get_parent_local_id = $this-&gt;db_connect($sql, &quot;comment_id&quot;); \/\/\u0435\u0441\u043b\u0438 \u0443 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430 \u0435\u0441\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c,\u0442\u043e \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0411\u0414 \u043f\u0438\u0448\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 comment_id \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u043e user_agent         }     $commentdata = array(                 'url' =&gt; $url,                 'author_name' =&gt;  $author_name,                 'author_email' =&gt;  $author_email,                 'author_www' =&gt;  $author_www,                 'author_avatar' =&gt;  $author_avatar,                 'author_provider' =&gt;  $author_provider,                 'anonym_name' =&gt;  $author_anonym_name,                 'anonym_email' =&gt;  $anonym_email,                 'rating' =&gt; $comment['rating'],                 'created' =&gt; strftime(&quot;%Y-%m-%d %H:%M:%S&quot;, $comment['created']\/1000),                 'ip' =&gt; $comment['ip'],                 'message' =&gt;$comment['message'],                 'status' =&gt; $status,                 'user_agent' =&gt; 'Cackle:' . $comment['id'],                 'parent' =&gt; $get_parent_local_id                          );         \/\/ \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 $commentdata \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c 'post_id' = &gt; $post_id, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430 \u043f\u043e url \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438         $this-&gt;db_connect($this-&gt;insCreate(&quot;comment&quot;,$commentdata)); \/\/\u0437\u0430\u043f\u0438\u0441\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430 \u0432 \u0411\u0414 } <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043a\u043e\u0434 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d <a href=\"https:\/\/github.com\/bisanalytic\/php-cackle-sync\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h4>\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043d\u0430 html<\/h4>\n<p>  \u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u2014 \u043e\u0442\u0440\u0438\u0441\u0443\u0439\u0442\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043d\u0430 \u0432\u0430\u0448\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0432\u0438\u0434\u0435:  <\/p>\n<pre><code class=\"html\">&lt;div id=&quot;mc-container&quot;&gt;     [... \u0442\u0443\u0442 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 ...] &lt;\/div&gt; &lt;script&gt;     [... \u043a\u043e\u0434 \u0432\u0438\u0434\u0436\u0435\u0442\u0430 Cackle ...] &lt;\/script&gt; <\/code><\/pre>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/cackle\/blog\/154293\/\"> http:\/\/habrahabr.ru\/company\/cackle\/blog\/154293\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0414\u0430\u043d\u043d\u044b\u0439 \u0442\u043e\u043f\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0432\u0441\u0435\u043c \u0442\u0435\u043c, \u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u0438\u0434\u0436\u0435\u0442 <a href=\"http:\/\/cackle.me\">Cackle <\/a> \u0438 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u0430\u0445. \u0412\u0441\u0435 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0438\u0436\u0435, \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435 \u0434\u043b\u044f WordPress \u0432\u0435\u0440\u0441\u0438\u0438 2.0 \u0438 \u0432\u044b\u0448\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0434\u0430\u043d\u043d\u0443\u044e CMS, \u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043d\u0430 php.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-154293","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/154293","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=154293"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/154293\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=154293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=154293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=154293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}