{"id":278746,"date":"2016-04-21T12:20:03","date_gmt":"2016-04-21T08:20:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=278746"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=278746","title":{"rendered":"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0447\u0430\u0442-\u0431\u043e\u0442\u0430 \u0434\u043b\u044f \u0411\u0438\u0442\u0440\u0438\u043a\u044124"},"content":{"rendered":"<p>       \u041c\u043e\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f <a href=\"https:\/\/habrahabr.ru\/post\/281559\/\">\u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0447\u0430\u0442-\u0431\u043e\u0442\u0430 \u0434\u043b\u044f Facebook Messenger<\/a> \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u0447\u0442\u043e \u0442\u0435\u043c\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u043e\u0431\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c \u0425\u0430\u0431\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e. <br \/>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0431\u043e\u0442\u0430 \u0434\u043b\u044f \u0411\u0438\u0442\u0440\u0438\u043a\u044124 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u0430. \u042f\u0437\u044b\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u043e\u0442 \u0436\u0435 \u2014 PHP.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u041e\u0431\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f<\/h2>\n<p>  \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f \u0447\u0430\u0442-\u0431\u043e\u0442\u043e\u0432 \u0411\u0438\u0442\u0440\u043a\u0438\u044124 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432 \u043a\u043e\u043d\u0446\u0435 \u043c\u0430\u0440\u0442\u0430 \u044d\u0442\u043e\u0433\u043e \u0433\u043e\u0434\u0430.<br \/>  \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0431\u043e\u0442\u0430, \u0432 GitHub \u043d\u0435 \u0431\u044b\u043b\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 PHP, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u0432\u043e\u044e \u2014 <a href=\"https:\/\/github.com\/pimax\/bitrix24-bot-php\">github.com\/pimax\/bitrix24-bot-php<\/a><\/p>\n<h2>\u041f\u0438\u0448\u0435\u043c \u043a\u043e\u0434<\/h2>\n<p>  \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f <a href=\"https:\/\/github.com\/pimax\/bitrix24-bot-php-example\">github.com\/pimax\/bitrix24-bot-php-example<\/a><\/p>\n<pre><code class=\"bash\">git clone https:\/\/github.com\/pimax\/bitrix24-bot-php-example.git . composer install cp config_example.php config.php <\/code><\/pre>\n<p>  \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c config.php \u043d\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u0432\u043e\u0435\u043c \u0431\u043e\u0442\u0435.<br \/>  \u041d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0443\u0442, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0440\u0430\u0437\u0434\u0443\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e, \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0441\u043d\u0430\u0431\u0436\u0435\u043d \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u043c.<\/p>\n<p>  \u041f\u043e\u044f\u0441\u043d\u044e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0434\u0435\u043c\u043e-\u0431\u043e\u0442\u0430.<br \/>  \u0412\u0441\u0435\u0433\u043e, \u0411\u0438\u0442\u0440\u0438\u043a\u044124 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 4 \u0442\u0438\u043f\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043d\u0430 webhook:<\/p>\n<h3>ONAPPINSTALL \u2014 \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u043e\u0442\u0430 \u043d\u0430 \u043f\u043e\u0440\u0442\u0430\u043b<\/h3>\n<p>  <\/p>\n<pre><code class=\"php\">$bot-&gt;install(new Bot(     $config['alias'],     $config['type'],     $config['url_message_add'],     $config['url_welcome_message'],     $config['url_bot_delete'],     $config['data'] )); <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e \u2014 \u0431\u0435\u0440\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u0431\u043e\u0442\u0430 \u043d\u0430 \u043f\u043e\u0440\u0442\u0430\u043b\u0435.<br \/>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432\u0440\u044f\u0434 \u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0443 \u0432\u0430\u0441.<\/p>\n<h3>ONIMBOTDELETE \u2014 \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0431\u043e\u0442\u0430<\/h3>\n<p>  <\/p>\n<pre><code class=\"php\">$bot-&gt;uninstall(); <\/code><\/pre>\n<p>  \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0431\u043e\u0442\u0430 \u0441 \u043f\u043e\u0440\u0442\u0430\u043b\u0430. <br \/>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443, \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u0440\u044f\u0434 \u043b\u0438 \u0431\u0443\u0434\u0435\u0442.<\/p>\n<h3>ONIMBOTJOINCHAT \u2014 \u041f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u0431\u043e\u0442\u0430 \u0432 \u0447\u0430\u0442<\/h3>\n<p>  <\/p>\n<pre><code class=\"php\">$bot-&gt;send(new Message(&quot;Hello&quot;, $_REQUEST['data']['PARAMS']['DIALOG_ID'], [     new Message('[send=\/command1]Command 1[\/send]'),     new Message('[send=\/command2]Command 2[\/send]'),     new Message('[send=\/command3]Command 3[\/send]'), ])); <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u0443\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b. \u0425\u043e\u0440\u043e\u0448\u0438\u043c \u0442\u043e\u043d\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u0431\u043e\u0442 \u0441\u043e\u043e\u0431\u0449\u0438\u0442 \u0441\u0432\u043e\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0432\u0432\u043e\u0434\u0438\u043b \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0432 \u0411\u0438\u0442\u0440\u0438\u043a\u044124 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043a\u043e\u0434 [send], \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0431\u043e\u0442\u0443 \u043f\u0440\u0438 \u043a\u043b\u0438\u043a\u0435 \u043d\u0430 \u0441\u0441\u044b\u043b\u043a\u0443.<\/p>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/23e\/db5\/db7\/23edb5db744f4b9aabc9290f860d91d7.png\"\/><\/p>\n<h3>ONIMBOTMESSAGEADD \u2014 \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/h3>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0442\u0438\u043f \u0434\u043b\u044f \u043d\u0430\u0441.<br \/>  \u0412 \u043d\u0435\u043c \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u0442 \u0431\u043e\u0442\u0430, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442, \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e.<\/p>\n<pre><code class=\"php\">switch ($_REQUEST['data']['PARAMS']['MESSAGE']) {     case '\/command1':         $bot-&gt;send(new Message(&quot;Command 1 response&quot;, $_REQUEST['data']['PARAMS']['DIALOG_ID']));     break;     case '\/command2':         $bot-&gt;send(new Message(&quot;Command 2 response&quot;, $_REQUEST['data']['PARAMS']['DIALOG_ID']));     break;     case '\/command3':         $bot-&gt;send(new Message(&quot;Command 3 response&quot;, $_REQUEST['data']['PARAMS']['DIALOG_ID']));     break;     default:         $bot-&gt;send(new Message(&quot;Hello&quot;, $_REQUEST['data']['PARAMS']['DIALOG_ID'], [             new Message('[send=\/command1]Command 1[\/send]'),             new Message('[send=\/command2]Command 2[\/send]'),             new Message('[send=\/command3]Command 3[\/send]'),         ])); } <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0447\u0442\u043e-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0435, \u0441\u043d\u043e\u0432\u0430 \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434.<\/p>\n<h2>\u0420\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f &gt; \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u043e\u0440\u0442\u0430\u043b\u0430.<\/p>\n<p>  \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u043c \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u00ab\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e API\u00bb.<br \/>  \u0412 \u043f\u0440\u0430\u0432\u0430\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u043c \u00ab\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0427\u0430\u0442-\u0431\u043e\u0442\u0430\u043c\u0438\u00bb.<br \/>  \u0412 \u043f\u043e\u043b\u044f \u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0441\u0441\u044b\u043b\u043a\u0443 \u0438 \u0443\u043a\u0430\u0436\u0438\u0442\u0435 callback-\u0441\u0441\u044b\u043b\u043a\u0443 \u0434\u043b\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: <a href=\"https:\/\/example.com\/apps\/bitrix24\/\">example.com\/apps\/bitrix24<\/a><br \/>  \u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c.<\/p>\n<h2>\u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0411\u043e\u0442\u0430 \u0434\u043b\u044f \u0444\u0440\u0438\u043b\u0430\u043d\u0441-\u0431\u0438\u0440\u0436\u0438 Job4Joy<\/h2>\n<p>  \u0414\u043b\u044f \u0447\u0438\u0441\u0442\u043e\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430, \u043c\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0442\u0443 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0443, \u0447\u0442\u043e \u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u043e Facebook Messenger \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0447\u0430\u0442-\u0431\u043e\u0442\u0430 \u0434\u043b\u044f \u0444\u0440\u0438\u043b\u0430\u043d\u0441-\u0431\u0438\u0440\u0436\u0438 Job4Joy.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u043d\u0430\u0448\u0435\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438.<br \/>  \u0414\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043f\u043e RSS, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f picoFeed \u2014 <a href=\"https:\/\/github.com\/fguillot\/picoFeed\">github.com\/fguillot\/picoFeed<\/a><br \/>  \u0418 <a href=\"https:\/\/github.com\/SebastianM\/GooglShortener\">github.com\/SebastianM\/GooglShortener<\/a> \u0434\u043b\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0441\u0441\u044b\u043b\u043e\u043a.<\/p>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c<\/p>\n<pre><code class=\"bash\">git clone https:\/\/github.com\/pimax\/bitrix24-bot-php-example.git . composer install cp config_example.php config.php <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435, \u043f\u0440\u0430\u0432\u0438\u043c config.php \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0438\u0434\u043e\u0432 \u0438 \u0442\u043e\u043a\u0435\u043d \u0434\u043b\u044f goo.gl:<\/p>\n<pre><code class=\"php\">'google_token' =&gt; '',  'feeds' =&gt; [     '\/all' =&gt; [         'Title' =&gt; 'All jobs',         'Feed' =&gt; 'https:\/\/job4joy.com\/marketplace\/rss\/'     ],     '\/webdev' =&gt; [         'Title' =&gt; 'Web Development',         'Feed' =&gt; 'https:\/\/job4joy.com\/marketplace\/rss\/?id=3'     ],     '\/software' =&gt; [         'Title' =&gt; 'Software Development & IT',         'Feed' =&gt; 'https:\/\/job4joy.com\/marketplace\/rss\/?id=5'     ],     '\/design' =&gt; [         'Title' =&gt; 'Design & Multimedia',         'Feed' =&gt; 'https:\/\/job4joy.com\/marketplace\/rss\/?id=2'     ],     '\/mobile' =&gt; [         'Title' =&gt; 'Mobile Application',         'Feed' =&gt; 'https:\/\/job4joy.com\/marketplace\/rss\/?id=7'     ],     '\/server' =&gt; [         'Title' =&gt; 'Host & Server Management',         'Feed' =&gt; 'https:\/\/job4joy.com\/marketplace\/rss\/?id=6'     ],     '\/writing' =&gt; [         'Title' =&gt; 'Writing',         'Feed' =&gt; 'https:\/\/job4joy.com\/marketplace\/rss\/?id=8'     ],     '\/customer' =&gt; [         'Title' =&gt; 'Customer Service',         'Feed' =&gt; 'https:\/\/job4joy.com\/marketplace\/rss\/?id=10'     ],     '\/marketing' =&gt; [         'Title' =&gt; 'Marketing',         'Feed' =&gt; 'https:\/\/job4joy.com\/marketplace\/rss\/?id=11'     ],     '\/business' =&gt; [         'Title' =&gt; 'Business Services',         'Feed' =&gt; 'https:\/\/job4joy.com\/marketplace\/rss\/?id=12'     ],     '\/translations' =&gt; [         'Title' =&gt; 'Translation & Languages',         'Feed' =&gt; 'https:\/\/job4joy.com\/marketplace\/rss\/?id=14'     ] ] <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b messages\/ru.php, \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<pre><code class=\"php\">&lt;?php return [     'Hello! I can help you with IT projects.' =&gt; '\u041f\u0440\u0438\u0432\u0435\u0442! \u042f \u043f\u043e\u043c\u043e\u0433\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438 \u0432 \u0441\u0444\u0435\u0440\u0435 \u0418\u0422.',     'find work & hire freelancers' =&gt; '\u0420\u0430\u0431\u043e\u0442\u0430 \u0432 \u0441\u0444\u0435\u0440\u0435 \u0418\u0422',     'All jobs' =&gt; '\u0412\u0441\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b',     'Web Development' =&gt; '\u0412\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430',     'Software Development & IT' =&gt; '\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u041f\u041e',     'Design & Multimedia' =&gt; '\u0414\u0438\u0437\u0430\u0439\u043d \u0438 \u043c\u0443\u043b\u044c\u0442\u0438\u043c\u0435\u0434\u0438\u0430',     'Mobile Application' =&gt; '\u041c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f',     'Host & Server Management' =&gt; '\u0425\u043e\u0441\u0442\u0438\u043d\u0433 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430',     'Writing' =&gt; '\u0422\u0435\u043a\u0441\u0442\u044b',     'Customer Service' =&gt; '\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432',     'Marketing' =&gt; '\u041c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433',     'Business Services' =&gt; '\u0411\u0438\u0437\u043d\u0435\u0441 \u0443\u0441\u043b\u0443\u0433\u0438',     'Translation & Languages' =&gt; '\u041f\u0435\u0440\u0435\u0432\u043e\u0434\u044b',     'New projects not a found!' =&gt; '\u041d\u043e\u0432\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b!' ]; <\/code><\/pre>\n<p>  \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u044f\u0437\u044b\u043a \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430 \u2014 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439, \u043d\u043e \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u043c\u044b \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c.<\/p>\n<p>  \u0412 index.php \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 GoogleShortener:<\/p>\n<pre><code class=\"php\">require_once (dirname(__FILE__) .'\/GooglShortener.php'); $googl = new GooglShortener($config['google_token']); <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0431\u043e\u0442\u0430:<\/p>\n<pre><code class=\"php\">\/**  * Send Help Message  *  * @param $bot Bot instance  * @return bool  *\/ function sendHelpMessage($bot) {     global $config;     $attach = [];     foreach ($config['feeds'] as $com =&gt; $feed)     {         $attach[] = new Message('[send='.$com.']'.$bot-&gt;t($feed['Title']).'[\/send]');     }     $bot-&gt;send(new Message($bot-&gt;t('Hello! I can help you with IT projects.'), $_REQUEST['data']['PARAMS']['DIALOG_ID'], $attach));     return true; } <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435, \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043f\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0444\u0438\u0434\u0443 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e:<\/p>\n<pre><code class=\"php\">\/**  * Get Feed Data  *  * @param $feed Feed data  * @param $bot Bot instance  * @return bool  *\/ function getFeed($feed, $bot) {     global $googl;     try {         $reader = new Reader;         $resource = $reader-&gt;download($feed['Feed']);         $parser = $reader-&gt;getParser(             $resource-&gt;getUrl(),             $resource-&gt;getContent(),             $resource-&gt;getEncoding()         );         $feed = $parser-&gt;execute();         $items = array_reverse($feed-&gt;getItems());         if (count($items)) {             foreach ($items as $itm)             {                 $url = $googl-&gt;shorten($itm-&gt;getUrl());                 $message = substr(strip_tags($itm-&gt;getContent()), 0, 150);                 $bot-&gt;send(new Message(&quot;[B]&quot;.$itm-&gt;getTitle() . &quot;[\/B]\\n&quot; . $message . &quot;\\n&quot;, $_REQUEST['data']['PARAMS']['DIALOG_ID']), [                     new Link($url-&gt;id, $url-&gt;id)                 ]);             }         } else {             $bot-&gt;send(new Message($bot-&gt;t('New projects not a found!'), $_REQUEST['data']['PARAMS']['DIALOG_ID']));         }     }     catch (Exception $e) {}     return true; } <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435. \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u044b\u043b\u043e\u0436\u0435\u043d \u043d\u0430 GitHub \u2014 <a href=\"https:\/\/github.com\/pimax\/job4joy_bitrix24bot\">github.com\/pimax\/job4joy_bitrix24bot<\/a><\/p>\n<h2>\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445<\/h2>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u0440\u0442\u0430\u043b\u0430.<br \/>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0442\u0430\u0442\u044c \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u043e\u043c 1\u0421-\u0411\u0438\u0442\u0440\u0438\u043a\u0441.<br \/>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0437\u0434\u0435\u0441\u044c \u2014 <a href=\"https:\/\/www.bitrix24.ru\/apps\/dev.php\">www.bitrix24.ru\/apps\/dev.php<\/a><\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0412 \u0446\u0435\u043b\u043e\u043c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0435 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u044f, \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0441\u0432\u043e\u0439 \u043c\u043e\u043b\u043e\u0434\u043e\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442.<br \/>  \u0421\u0430\u043c\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043c\u0438\u043d\u0443\u0441 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u2014 \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043c\u043e\u0434\u0435\u0440\u0430\u0446\u0438\u0438. \u0421\u0447\u0451\u0442 \u043c\u043e\u0436\u0435\u0442 \u0438\u0434\u0442\u0438 \u043d\u0430 \u043d\u0435\u0434\u0435\u043b\u0438 \u0431\u0435\u0437 \u043f\u0440\u0435\u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u0438\u0437-\u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u043c\u043e\u0434\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u043e\u043d\u0438 \u043d\u0435 \u0443\u0441\u043f\u0435\u0432\u0430\u044e\u0442. \u041d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u0430 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u043e\u0432.<\/p>\n<h2>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>  <\/p>\n<ol>\n<li>\u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 1\u0421-\u0411\u0438\u0442\u0440\u0438\u043a\u0441 \u043f\u0440\u043e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u0443 \u0434\u043b\u044f \u0447\u0430\u0442-\u0431\u043e\u0442\u043e\u0432 \u2014 <a href=\"http:\/\/dev.1c-bitrix.ru\/community\/blogs\/marketplace_apps24\/we-present-a-platform-for-chatbots-for-bitrix24.php\">dev.1c-bitrix.ru\/community\/blogs\/marketplace_apps24\/we-present-a-platform-for-chatbots-for-bitrix24.php<\/a><\/li>\n<li>Bitrix24 Bot PHP SDK \u2014 <a href=\"https:\/\/github.com\/pimax\/bitrix24-bot-php\">github.com\/pimax\/bitrix24-bot-php<\/a><\/li>\n<li>Bitrix24 Bot PHP SDK Example \u2014 <a href=\"https:\/\/github.com\/pimax\/bitrix24-bot-php-example\">github.com\/pimax\/bitrix24-bot-php-example<\/a><\/li>\n<li>Job4Joy Bot PHP Sources \u2014 <a href=\"https:\/\/github.com\/pimax\/job4joy_bitrix24bot\">github.com\/pimax\/job4joy_bitrix24bot<\/a><\/li>\n<\/ol>\n<div class=\"clear\"><\/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=\"https:\/\/habrahabr.ru\/post\/282077\/\"> https:\/\/habrahabr.ru\/post\/282077\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041c\u043e\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f <a href=\"https:\/\/habrahabr.ru\/post\/281559\/\">\u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0447\u0430\u0442-\u0431\u043e\u0442\u0430 \u0434\u043b\u044f Facebook Messenger<\/a> \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u0447\u0442\u043e \u0442\u0435\u043c\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u043e\u0431\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c \u0425\u0430\u0431\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e. <br \/>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0431\u043e\u0442\u0430 \u0434\u043b\u044f \u0411\u0438\u0442\u0440\u0438\u043a\u044124 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u0430. \u042f\u0437\u044b\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u043e\u0442 \u0436\u0435 \u2014 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-278746","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278746","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=278746"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278746\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=278746"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=278746"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=278746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}