1
0
Fork 0
mirror of https://gitlab.com/ifiction/ifhub-telegram.git synced 2024-04-25 05:39:31 +03:00

Do not use article text for description

This commit is contained in:
Alexander Yakovlev 2020-10-01 19:58:17 +07:00
parent 1e9ca1dbd8
commit e23bead9f0
Signed by: oreolek
GPG key ID: 1CDC4B7820C93BD3
3 changed files with 98 additions and 145 deletions

View file

@ -111,10 +111,12 @@ foreach ($articles as $article) {
$long_description = $description; $long_description = $description;
$description = substr( $description, 0, strpos($description, '<a name="cut"')); $description = substr( $description, 0, strpos($description, '<a name="cut"'));
$description = formatdsc($description); $description = formatdsc($description);
/*
if (strlen($description) < 50) { // description is too small if (strlen($description) < 50) { // description is too small
$description = $long_description; $description = $long_description;
$description = formatdsc($description); $description = formatdsc($description);
} }
*/
$limit = 500 - strlen($link) - strlen($title) - 5; $limit = 500 - strlen($link) - strlen($title) - 5;
$description = "$title\n\n".ellipse($description, $limit); $description = "$title\n\n".ellipse($description, $limit);
$description .= "\n$link"; $description .= "\n$link";

View file

@ -1,6 +1,6 @@
{ {
"require": { "require": {
"longman/telegram-bot": "^0.44.1", "longman/telegram-bot": "^0.63.1",
"sabre/xml": "^2.0", "sabre/xml": "^2.0",
"ryakad/pandoc-php": "^1.0", "ryakad/pandoc-php": "^1.0",
"symfony/yaml": "^3.2", "symfony/yaml": "^3.2",

239
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "725c9d0611923400d53ba805e2785e86", "content-hash": "5e1c177f2e6fc662bee639eb8875918c",
"packages": [ "packages": [
{ {
"name": "doctrine/inflector", "name": "doctrine/inflector",
@ -167,23 +167,23 @@
}, },
{ {
"name": "guzzlehttp/promises", "name": "guzzlehttp/promises",
"version": "v1.3.1", "version": "1.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/promises.git", "url": "https://github.com/guzzle/promises.git",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" "reference": "60d379c243457e073cff02bc323a2a86cb355631"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", "url": "https://api.github.com/repos/guzzle/promises/zipball/60d379c243457e073cff02bc323a2a86cb355631",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", "reference": "60d379c243457e073cff02bc323a2a86cb355631",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.5.0" "php": ">=5.5"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^4.0" "symfony/phpunit-bridge": "^4.4 || ^5.1"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -214,20 +214,20 @@
"keywords": [ "keywords": [
"promise" "promise"
], ],
"time": "2016-12-20T10:07:11+00:00" "time": "2020-09-30T07:37:28+00:00"
}, },
{ {
"name": "guzzlehttp/psr7", "name": "guzzlehttp/psr7",
"version": "1.6.1", "version": "1.7.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/psr7.git", "url": "https://github.com/guzzle/psr7.git",
"reference": "239400de7a173fe9901b9ac7c06497751f00727a" "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3",
"reference": "239400de7a173fe9901b9ac7c06497751f00727a", "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -240,15 +240,15 @@
}, },
"require-dev": { "require-dev": {
"ext-zlib": "*", "ext-zlib": "*",
"phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10"
}, },
"suggest": { "suggest": {
"zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.6-dev" "dev-master": "1.7-dev"
} }
}, },
"autoload": { "autoload": {
@ -285,7 +285,7 @@
"uri", "uri",
"url" "url"
], ],
"time": "2019-07-01T23:21:34+00:00" "time": "2020-09-30T07:37:11+00:00"
}, },
{ {
"name": "illuminate/contracts", "name": "illuminate/contracts",
@ -394,29 +394,32 @@
}, },
{ {
"name": "longman/telegram-bot", "name": "longman/telegram-bot",
"version": "0.44.1", "version": "0.63.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-telegram-bot/core.git", "url": "https://github.com/php-telegram-bot/core.git",
"reference": "e522050a5e2ac73a4c0fa47705896da0df37de3a" "reference": "1cf5d1fd38c81df7650358d1ae85a16957db5d22"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-telegram-bot/core/zipball/e522050a5e2ac73a4c0fa47705896da0df37de3a", "url": "https://api.github.com/repos/php-telegram-bot/core/zipball/1cf5d1fd38c81df7650358d1ae85a16957db5d22",
"reference": "e522050a5e2ac73a4c0fa47705896da0df37de3a", "reference": "1cf5d1fd38c81df7650358d1ae85a16957db5d22",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-curl": "*", "ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-pdo": "*", "ext-pdo": "*",
"guzzlehttp/guzzle": "^6.2", "guzzlehttp/guzzle": "^6.3",
"monolog/monolog": "^1.22", "php": "^5.5|^7.0",
"php": "^5.5|^7.0" "psr/log": "^1.1"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^4.8|^5.7|^6.1", "dms/phpunit-arraysubset-asserts": "^0.1.0",
"squizlabs/php_codesniffer": "^2.8" "monolog/monolog": "^2.0",
"phpunit/phpunit": "^8.4",
"squizlabs/php_codesniffer": "^3.4"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -434,103 +437,51 @@
"email": "akalongman@gmail.com", "email": "akalongman@gmail.com",
"homepage": "http://longman.me", "homepage": "http://longman.me",
"role": "Developer" "role": "Developer"
},
{
"name": "PHP Telegram Bot Team",
"homepage": "https://github.com/php-telegram-bot/core/graphs/contributors",
"role": "Developer"
} }
], ],
"description": "PHP telegram bot", "description": "PHP Telegram bot",
"homepage": "https://github.com/php-telegram-bot/core", "homepage": "https://github.com/php-telegram-bot/core",
"keywords": [ "keywords": [
"api", "api",
"bot", "bot",
"telegram" "telegram"
], ],
"time": "2017-04-25T21:28:23+00:00"
},
{
"name": "monolog/monolog",
"version": "1.25.5",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "1817faadd1846cd08be9a49e905dc68823bc38c0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/1817faadd1846cd08be9a49e905dc68823bc38c0",
"reference": "1817faadd1846cd08be9a49e905dc68823bc38c0",
"shasum": ""
},
"require": {
"php": ">=5.3.0",
"psr/log": "~1.0"
},
"provide": {
"psr/log-implementation": "1.0.0"
},
"require-dev": {
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
"doctrine/couchdb": "~1.0@dev",
"graylog2/gelf-php": "~1.0",
"php-amqplib/php-amqplib": "~2.4",
"php-console/php-console": "^3.1.3",
"php-parallel-lint/php-parallel-lint": "^1.0",
"phpunit/phpunit": "~4.5",
"ruflin/elastica": ">=0.90 <3.0",
"sentry/sentry": "^0.13",
"swiftmailer/swiftmailer": "^5.3|^6.0"
},
"suggest": {
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
"doctrine/couchdb": "Allow sending log messages to a CouchDB server",
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
"ext-mongo": "Allow sending log messages to a MongoDB server",
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
"mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver",
"php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
"php-console/php-console": "Allow sending log messages to Google Chrome",
"rollbar/rollbar": "Allow sending log messages to Rollbar",
"ruflin/elastica": "Allow sending log messages to an Elastic Search server",
"sentry/sentry": "Allow sending log messages to a Sentry server"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Monolog\\": "src/Monolog"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "http://seld.be"
}
],
"description": "Sends your logs to files, sockets, inboxes, databases and various web services",
"homepage": "http://github.com/Seldaek/monolog",
"keywords": [
"log",
"logging",
"psr-3"
],
"funding": [ "funding": [
{ {
"url": "https://github.com/Seldaek", "url": "https://github.com/php-telegram-bot/core",
"type": "custom"
},
{
"url": "https://github.com/noplanman",
"type": "github" "type": "github"
}, },
{ {
"url": "https://tidelift.com/funding/github/packagist/monolog/monolog", "url": "https://ko-fi.com/phptelegrambot",
"type": "ko_fi"
},
{
"url": "https://liberapay.com/PHP-Telegram-Bot",
"type": "liberapay"
},
{
"url": "https://opencollective.com/php-telegram-bot",
"type": "open_collective"
},
{
"url": "https://www.patreon.com/phptelegrambot",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/longman/telegram-bot",
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-07-23T08:35:51+00:00" "time": "2020-06-24T12:05:37+00:00"
}, },
{ {
"name": "mremi/url-shortener", "name": "mremi/url-shortener",
@ -588,16 +539,16 @@
}, },
{ {
"name": "nesbot/carbon", "name": "nesbot/carbon",
"version": "2.38.0", "version": "2.40.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/briannesbitt/Carbon.git", "url": "https://github.com/briannesbitt/Carbon.git",
"reference": "d8f6a6a91d1eb9304527b040500f61923e97674b" "reference": "d9a76d8b7eb0f97cf3a82529393245212f40ba3b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d8f6a6a91d1eb9304527b040500f61923e97674b", "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d9a76d8b7eb0f97cf3a82529393245212f40ba3b",
"reference": "d8f6a6a91d1eb9304527b040500f61923e97674b", "reference": "d9a76d8b7eb0f97cf3a82529393245212f40ba3b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -610,7 +561,7 @@
"doctrine/orm": "^2.7", "doctrine/orm": "^2.7",
"friendsofphp/php-cs-fixer": "^2.14 || ^3.0", "friendsofphp/php-cs-fixer": "^2.14 || ^3.0",
"kylekatarnls/multi-tester": "^2.0", "kylekatarnls/multi-tester": "^2.0",
"phpmd/phpmd": "^2.8", "phpmd/phpmd": "^2.9",
"phpstan/extension-installer": "^1.0", "phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12.35", "phpstan/phpstan": "^0.12.35",
"phpunit/phpunit": "^7.5 || ^8.0", "phpunit/phpunit": "^7.5 || ^8.0",
@ -673,7 +624,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-08-04T19:12:46+00:00" "time": "2020-09-23T08:17:37+00:00"
}, },
{ {
"name": "paragonie/random_compat", "name": "paragonie/random_compat",
@ -1155,16 +1106,16 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v5.1.3", "version": "v5.1.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "2226c68009627934b8cfc01260b4d287eab070df" "reference": "04c3a31fe8ea94b42c9e2d1acc93d19782133b00"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/2226c68009627934b8cfc01260b4d287eab070df", "url": "https://api.github.com/repos/symfony/console/zipball/04c3a31fe8ea94b42c9e2d1acc93d19782133b00",
"reference": "2226c68009627934b8cfc01260b4d287eab070df", "reference": "04c3a31fe8ea94b42c9e2d1acc93d19782133b00",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1244,7 +1195,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-07-06T13:23:11+00:00" "time": "2020-09-18T14:27:32+00:00"
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
@ -1951,16 +1902,16 @@
}, },
{ {
"name": "symfony/service-contracts", "name": "symfony/service-contracts",
"version": "v2.1.3", "version": "v2.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/service-contracts.git", "url": "https://github.com/symfony/service-contracts.git",
"reference": "58c7475e5457c5492c26cc740cc0ad7464be9442" "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/58c7475e5457c5492c26cc740cc0ad7464be9442", "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1",
"reference": "58c7475e5457c5492c26cc740cc0ad7464be9442", "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1973,7 +1924,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.1-dev" "dev-master": "2.2-dev"
}, },
"thanks": { "thanks": {
"name": "symfony/contracts", "name": "symfony/contracts",
@ -2023,20 +1974,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-07-06T13:23:11+00:00" "time": "2020-09-07T11:33:47+00:00"
}, },
{ {
"name": "symfony/string", "name": "symfony/string",
"version": "v5.1.3", "version": "v5.1.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/string.git", "url": "https://github.com/symfony/string.git",
"reference": "f629ba9b611c76224feb21fe2bcbf0b6f992300b" "reference": "4a9afe9d07bac506f75bcee8ed3ce76da5a9343e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/f629ba9b611c76224feb21fe2bcbf0b6f992300b", "url": "https://api.github.com/repos/symfony/string/zipball/4a9afe9d07bac506f75bcee8ed3ce76da5a9343e",
"reference": "f629ba9b611c76224feb21fe2bcbf0b6f992300b", "reference": "4a9afe9d07bac506f75bcee8ed3ce76da5a9343e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2108,20 +2059,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-07-08T08:27:49+00:00" "time": "2020-09-15T12:23:47+00:00"
}, },
{ {
"name": "symfony/translation", "name": "symfony/translation",
"version": "v4.4.11", "version": "v4.4.14",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/translation.git", "url": "https://github.com/symfony/translation.git",
"reference": "a8ea9d97353294eb6783f2894ef8cee99a045822" "reference": "0b8c4bb49b05b11d2b9dd1732f26049b08d96884"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/a8ea9d97353294eb6783f2894ef8cee99a045822", "url": "https://api.github.com/repos/symfony/translation/zipball/0b8c4bb49b05b11d2b9dd1732f26049b08d96884",
"reference": "a8ea9d97353294eb6783f2894ef8cee99a045822", "reference": "0b8c4bb49b05b11d2b9dd1732f26049b08d96884",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2198,20 +2149,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-07-23T08:31:43+00:00" "time": "2020-09-24T09:40:01+00:00"
}, },
{ {
"name": "symfony/translation-contracts", "name": "symfony/translation-contracts",
"version": "v2.1.3", "version": "v2.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/translation-contracts.git", "url": "https://github.com/symfony/translation-contracts.git",
"reference": "616a9773c853097607cf9dd6577d5b143ffdcd63" "reference": "77ce1c3627c9f39643acd9af086631f842c50c4d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/translation-contracts/zipball/616a9773c853097607cf9dd6577d5b143ffdcd63", "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/77ce1c3627c9f39643acd9af086631f842c50c4d",
"reference": "616a9773c853097607cf9dd6577d5b143ffdcd63", "reference": "77ce1c3627c9f39643acd9af086631f842c50c4d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2223,7 +2174,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.1-dev" "dev-master": "2.2-dev"
}, },
"thanks": { "thanks": {
"name": "symfony/contracts", "name": "symfony/contracts",
@ -2273,20 +2224,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-07-06T13:23:11+00:00" "time": "2020-09-07T11:33:47+00:00"
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v3.4.43", "version": "v3.4.45",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",
"reference": "e7fa05917ae931332a42d65b577ece4d497aad81" "reference": "ec3c2ac4d881a4684c1f0317d2107f1a4152bad9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/e7fa05917ae931332a42d65b577ece4d497aad81", "url": "https://api.github.com/repos/symfony/yaml/zipball/ec3c2ac4d881a4684c1f0317d2107f1a4152bad9",
"reference": "e7fa05917ae931332a42d65b577ece4d497aad81", "reference": "ec3c2ac4d881a4684c1f0317d2107f1a4152bad9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2346,7 +2297,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-07-23T09:37:51+00:00" "time": "2020-09-18T15:58:55+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],