{"id":375432,"date":"2024-05-21T06:24:20","date_gmt":"2024-05-21T06:24:20","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=375432"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T06:24:20","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=375432","title":{"rendered":"<span>\u041a\u0430\u043a \u043e\u0431\u043e\u0439\u0442\u0438 \u043b\u0438\u043c\u0438\u0442 Telegram API \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f \u0441\u0432\u044b\u0448\u0435 10,000 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p> \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435! \u0415\u0441\u043b\u0438 \u0432\u044b \u043a\u043e\u0433\u0434\u0430-\u043b\u0438\u0431\u043e \u043f\u044b\u0442\u0430\u043b\u0438\u0441\u044c \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u0437 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u0433\u0440\u0443\u043f\u043f \u0438 \u043a\u0430\u043d\u0430\u043b\u043e\u0432, \u0432\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0437\u043d\u0430\u0435\u0442\u0435 \u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c. \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 <a href=\"https:\/\/coursefactory.pro\/\" rel=\"noopener noreferrer nofollow\">\u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a> \u2014 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0434\u043b\u044f \u0441\u043f\u0438\u043a\u0435\u0440\u043e\u0432 \u0438 \u043a\u043e\u0443\u0447\u0435\u0439 \u2014 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0440\u043e\u0434\u0432\u0438\u0433\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u043a\u0443\u0440\u0441\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0440\u0435\u043a\u043b\u0430\u043c\u0443 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0433\u0440\u0443\u043f\u043f\u0430\u0445 \u0438 \u043a\u0430\u043d\u0430\u043b\u0430\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0433\u043e\u0442\u043e\u0432 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0432\u043e\u0435\u043c\u0443 \u043a\u0430\u043d\u0430\u043b\u0443 \u0438\u043b\u0438 \u0433\u0440\u0443\u043f\u043f\u0435, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0435 \u0442\u0435\u043c\u044b \u043a\u0443\u0440\u0441\u043e\u0432 \u043f\u0435\u0440\u0435\u043a\u043b\u0438\u043a\u0430\u044e\u0442\u0441\u044f \u0441 \u0438\u0445 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430\u0448\u0430 \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433\u043e\u0432\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u0442\u0440\u0435\u0445\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u0443\u044e \u043f\u0430\u0440\u0442\u043d\u0451\u0440\u0441\u043a\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443. \u0421\u0443\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u044b \u0433\u0440\u0443\u043f\u043f, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u044b\u0435 \u043d\u0430 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u0447\u0435\u0441\u0442\u0432\u043e, \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u041f\u043e\u0434 \u044d\u0442\u0438\u043c ID \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043d\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u043a\u0443\u0440\u0441\u043e\u0432, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442 \u0432\u043e\u0437\u043d\u0430\u0433\u0440\u0430\u0436\u0434\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 \u0433\u0440\u0443\u043f\u043f\u044b.<\/p>\n<p>\u042d\u0442\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u0442\u0438\u0432\u0430 \u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043d\u0430\u043c \u043c\u043d\u043e\u0433\u043e\u043e\u0431\u0435\u0449\u0430\u044e\u0449\u0435\u0439, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u044b\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c. \u041f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u0437 \u0433\u0440\u0443\u043f\u043f\u044b \u043d\u0430 13,000 \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u043c\u043e\u0433\u043b\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 10,000. \u042d\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 API Telegram \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043b\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u043d\u0430, \u0442\u0440\u0435\u0431\u0443\u044f \u043e\u0442 \u043d\u0430\u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439.<\/p>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 API Telegram channels->getParticipants \u043d\u0430\u0448\u0435\u043b\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u043e\u0438\u0441\u043a\u0430 &#8216;filter&#8217; => [&#8216;_&#8217; => &#8216;channelParticipantsSearch&#8217;, &#8216;q&#8217; => &#171;\u041f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432 \u043b\u043e\u0433\u0438\u043d\u0435&#187;]<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 PHP \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 MadelineProto<\/p>\n<pre><code class=\"php\">&lt;?  \/\/..................................... \/\/\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0431\u0430\u0437\u044b  $telegram_group_id = $group['telegram_group_id']; $groupInfo = $MadelineProto->getFullInfo($telegram_group_id); $participantCount = $groupInfo['full']['participants_count'] ?? 0; echo \"\u0412 \u0433\u0440\u0443\u043f\u043f\u0435 $participantCount \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439!&lt;br>\"; $allParticipants = []; $limit = 200;  if ($participantCount > 10000) { $nextchar = $group['nextchar']; if ($nextchar === '00') {     echo \"\u0412\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0431\u044b\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b.&lt;br>\";     echo '&lt;\/body>';     echo '&lt;\/html>';     exit; }  if ($nextchar === '' || is_null($nextchar)) {     $nextchar = 'a'; }  $alphabet = array_merge(range('a', 'z'), range('0', '9')); \/\/\u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0449\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 $currentCharIndex = array_search($nextchar, $alphabet); if ($currentCharIndex === false) {     die(\"\u041d\u0435\u0432\u0435\u0440\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 nextchar.\"); }  $currentChar = $alphabet[$currentCharIndex];      $offset = 0;     do {         $response = $MadelineProto->channels->getParticipants([             'channel' => $telegram_group_id,             'filter' => ['_' => 'channelParticipantsSearch', 'q' => $currentChar],             'offset' => $offset,             'limit' => $limit         ]);         foreach ($response['participants'] as $participant) {             if (!isset($participant['user_id'])) {                 continue; \/\/ \u041f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e, \u0435\u0441\u043b\u0438 \u043a\u043b\u044e\u0447\u0430 \u043d\u0435\u0442             }             $allParticipants[$participant['user_id']] = $participant;         }         $offset += $limit;     } while (count($response['participants']) == $limit);  $nextCharIndex = $currentCharIndex + 1; if ($nextCharIndex >= count($alphabet)) {     $updateNextChar = '00'; \/\/\u043f\u0440\u043e\u0448\u043b\u0438 \u0432\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b } else {     $updateNextChar = $alphabet[$nextCharIndex]; }  \/\/ \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 $updateQuery = \"UPDATE telegram_group SET nextchar = :nextchar WHERE id = :id_telegram_group\"; $updateStmt = $currentDb->prepare($updateQuery); $updateStmt->bindParam(':nextchar', $updateNextChar); $updateStmt->bindParam(':id_telegram_group', $id_telegram_group); $updateStmt->execute();  $linkToAdd = strtolower(\"https:\/\/\u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 cron \u043d\u0430 \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442\");   \/\/\u0442\u0438\u043f\u0430 INSERT INTO crons (links, active, minuts) VALUES (:link, 1, 5)   \/\/\u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0448\u043b\u0438 \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b    \/\/if ($updateNextChar === '00') {     \/\/ \u0415\u0441\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u0430 \u0432 0 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438 \/\/     $query = \" \/\/         UPDATE crons SET active = 0 WHERE links = :link \/\/     \"; \/\/     $statement = $db->prepare($query); \/\/     $statement->bindParam(':link', $linkToAdd); \/\/     $statement->execute(); \/\/ } ?><\/code><\/pre>\n<p>\u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437 \u0432 5 \u043c\u0438\u043d\u0443\u0442, \u043a\u043e\u0434 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u043e\u0448\u0435\u043b \u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/29f\/db8\/9b6\/29fdb89b689a922c87f6f502a369471c.png\" width=\"1177\" height=\"224\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/29f\/db8\/9b6\/29fdb89b689a922c87f6f502a369471c.png\"\/><\/figure>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c API Telegram \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c 10,000 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0434\u043b\u044f \u0412\u0430\u0441. \u042d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430, \u0445\u043e\u0442\u044f \u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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:\/\/habr.com\/ru\/articles\/812329\/\"> https:\/\/habr.com\/ru\/articles\/812329\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p> \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435! \u0415\u0441\u043b\u0438 \u0432\u044b \u043a\u043e\u0433\u0434\u0430-\u043b\u0438\u0431\u043e \u043f\u044b\u0442\u0430\u043b\u0438\u0441\u044c \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u0437 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u0433\u0440\u0443\u043f\u043f \u0438 \u043a\u0430\u043d\u0430\u043b\u043e\u0432, \u0432\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0437\u043d\u0430\u0435\u0442\u0435 \u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c. \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 <a href=\"https:\/\/coursefactory.pro\/\" rel=\"noopener noreferrer nofollow\">\u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a> \u2014 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0434\u043b\u044f \u0441\u043f\u0438\u043a\u0435\u0440\u043e\u0432 \u0438 \u043a\u043e\u0443\u0447\u0435\u0439 \u2014 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0440\u043e\u0434\u0432\u0438\u0433\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u043a\u0443\u0440\u0441\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0440\u0435\u043a\u043b\u0430\u043c\u0443 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0433\u0440\u0443\u043f\u043f\u0430\u0445 \u0438 \u043a\u0430\u043d\u0430\u043b\u0430\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0433\u043e\u0442\u043e\u0432 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0432\u043e\u0435\u043c\u0443 \u043a\u0430\u043d\u0430\u043b\u0443 \u0438\u043b\u0438 \u0433\u0440\u0443\u043f\u043f\u0435, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0435 \u0442\u0435\u043c\u044b \u043a\u0443\u0440\u0441\u043e\u0432 \u043f\u0435\u0440\u0435\u043a\u043b\u0438\u043a\u0430\u044e\u0442\u0441\u044f \u0441 \u0438\u0445 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430\u0448\u0430 \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433\u043e\u0432\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u0442\u0440\u0435\u0445\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u0443\u044e \u043f\u0430\u0440\u0442\u043d\u0451\u0440\u0441\u043a\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443. \u0421\u0443\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u044b \u0433\u0440\u0443\u043f\u043f, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u044b\u0435 \u043d\u0430 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u0447\u0435\u0441\u0442\u0432\u043e, \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u041f\u043e\u0434 \u044d\u0442\u0438\u043c ID \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043d\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u043a\u0443\u0440\u0441\u043e\u0432, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442 \u0432\u043e\u0437\u043d\u0430\u0433\u0440\u0430\u0436\u0434\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 \u0433\u0440\u0443\u043f\u043f\u044b.<\/p>\n<p>\u042d\u0442\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u0442\u0438\u0432\u0430 \u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043d\u0430\u043c \u043c\u043d\u043e\u0433\u043e\u043e\u0431\u0435\u0449\u0430\u044e\u0449\u0435\u0439, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u044b\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c. \u041f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u0437 \u0433\u0440\u0443\u043f\u043f\u044b \u043d\u0430 13,000 \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u043c\u043e\u0433\u043b\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 10,000. \u042d\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 API Telegram \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043b\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u043d\u0430, \u0442\u0440\u0435\u0431\u0443\u044f \u043e\u0442 \u043d\u0430\u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439.<\/p>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 API Telegram channels->getParticipants \u043d\u0430\u0448\u0435\u043b\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u043e\u0438\u0441\u043a\u0430 &#8216;filter&#8217; => [&#8216;_&#8217; => &#8216;channelParticipantsSearch&#8217;, &#8216;q&#8217; => &#171;\u041f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432 \u043b\u043e\u0433\u0438\u043d\u0435&#187;]<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 PHP \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 MadelineProto<\/p>\n<pre><code class=\"php\">&lt;?  \/\/..................................... \/\/\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0431\u0430\u0437\u044b  $telegram_group_id = $group['telegram_group_id']; $groupInfo = $MadelineProto->getFullInfo($telegram_group_id); $participantCount = $groupInfo['full']['participants_count'] ?? 0; echo \"\u0412 \u0433\u0440\u0443\u043f\u043f\u0435 $participantCount \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439!&lt;br>\"; $allParticipants = []; $limit = 200;  if ($participantCount > 10000) { $nextchar = $group['nextchar']; if ($nextchar === '00') {     echo \"\u0412\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0431\u044b\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b.&lt;br>\";     echo '&lt;\/body>';     echo '&lt;\/html>';     exit; }  if ($nextchar === '' || is_null($nextchar)) {     $nextchar = 'a'; }  $alphabet = array_merge(range('a', 'z'), range('0', '9')); \/\/\u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0449\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 $currentCharIndex = array_search($nextchar, $alphabet); if ($currentCharIndex === false) {     die(\"\u041d\u0435\u0432\u0435\u0440\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 nextchar.\"); }  $currentChar = $alphabet[$currentCharIndex];      $offset = 0;     do {         $response = $MadelineProto->channels->getParticipants([             'channel' => $telegram_group_id,             'filter' => ['_' => 'channelParticipantsSearch', 'q' => $currentChar],             'offset' => $offset,             'limit' => $limit         ]);         foreach ($response['participants'] as $participant) {             if (!isset($participant['user_id'])) {                 continue; \/\/ \u041f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e, \u0435\u0441\u043b\u0438 \u043a\u043b\u044e\u0447\u0430 \u043d\u0435\u0442             }             $allParticipants[$participant['user_id']] = $participant;         }         $offset += $limit;     } while (count($response['participants']) == $limit);  $nextCharIndex = $currentCharIndex + 1; if ($nextCharIndex >= count($alphabet)) {     $updateNextChar = '00'; \/\/\u043f\u0440\u043e\u0448\u043b\u0438 \u0432\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b } else {     $updateNextChar = $alphabet[$nextCharIndex]; }  \/\/ \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 $updateQuery = \"UPDATE telegram_group SET nextchar = :nextchar WHERE id = :id_telegram_group\"; $updateStmt = $currentDb->prepare($updateQuery); $updateStmt->bindParam(':nextchar', $updateNextChar); $updateStmt->bindParam(':id_telegram_group', $id_telegram_group); $updateStmt->execute();  $linkToAdd = strtolower(\"https:\/\/\u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 cron \u043d\u0430 \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442\");   \/\/\u0442\u0438\u043f\u0430 INSERT INTO crons (links, active, minuts) VALUES (:link, 1, 5)   \/\/\u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0448\u043b\u0438 \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b    \/\/if ($updateNextChar === '00') {     \/\/ \u0415\u0441\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u0430 \u0432 0 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438 \/\/     $query = \" \/\/         UPDATE crons SET active = 0 WHERE links = :link \/\/     \"; \/\/     $statement = $db->prepare($query); \/\/     $statement->bindParam(':link', $linkToAdd); \/\/     $statement->execute(); \/\/ } ?><\/code><\/pre>\n<p>\u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437 \u0432 5 \u043c\u0438\u043d\u0443\u0442, \u043a\u043e\u0434 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u043e\u0448\u0435\u043b \u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/p>\n<figure class=\"full-width\"><\/figure>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c API Telegram \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c 10,000 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0434\u043b\u044f \u0412\u0430\u0441. \u042d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430, \u0445\u043e\u0442\u044f \u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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:\/\/habr.com\/ru\/articles\/812329\/\"> https:\/\/habr.com\/ru\/articles\/812329\/<\/a><br \/><\/br><\/br><\/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-375432","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/375432","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=375432"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/375432\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=375432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=375432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=375432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}