Update README.md && README_RU.md

This commit is contained in:
eleksir
2022-01-28 17:32:31 +03:00
parent ba14f6e619
commit 6840e6d5d0
2 changed files with 0 additions and 112 deletions

View File

@@ -41,64 +41,8 @@ and all libraries should be downloaded, built, tested and installed.
This bot does not [ultilize][4] webhooks, so in order to run it only well This bot does not [ultilize][4] webhooks, so in order to run it only well
internet connection is required, no public-available ip address is needed. internet connection is required, no public-available ip address is needed.
### Additional Settings to be performed in order to run bot as it designed
There are some "plugins" that requires registration on third party services
and API keys and secrets in order to work.
#### OpenWeatherMap
You should [register][5], [login][6] and [create][7] api key. Free plan have
all required features to run this "plugin".
Once key is created you should put it in **config.json** under openweathermap
section as appid. Thats it.
It is still impossible to disable this plugin, but "I'm working on it".
#### Imgur
This plugin "just exists" and is actually used nowhere around the code.
Anyway, to make use of it besides registering appropriate handler in code, you
should sign in imgur and get access token.
Actually at this time this "plugin" can be stub-ed with default config values.
Anyway, to fetch access token you should [login][8] and perform [registration][9]
of your app. Then you should authorize your app according to [this][10] manual. Or
[this][11] one.
#### Flickr
This "plugin" is really used to implement random picture link retrival plugins.
There is helper script in **bin/flickr_init.pl** that helps to get all required keys
and secrets from flickr api.
Before using it bot must be bootstrapped via **`bootstrap.sh`**.
[Login][11] and create an [app][12] in your flickr account. Then *logout* flickr account.
(It is required in order to properly get "verifier" parameter later).
Put your [app key and secret][13] to **config.json**. Ensure that "verifier" parameter
in Flickr-related part of config either absent or commented out.
Run **bin/flickr_init.pl** first time and follow on screen instructions - copy and
paste given link to browser login to flickr account and you'll be redirected to
example.com. Check address bar in browser to get so-called "verifier", put it in
**config.json**. Then run **bin/flickr_init.pl** again to store API access token in db
under data/image directory (in default config). You're done.
[1]: https://metacpan.org/pod/Telegram::Bot [1]: https://metacpan.org/pod/Telegram::Bot
[2]: https://metacpan.org/pod/Hailo [2]: https://metacpan.org/pod/Hailo
[3]: https://core.telegram.org/bots/api [3]: https://core.telegram.org/bots/api
[4]: https://core.telegram.org/bots/api#getting-updates [4]: https://core.telegram.org/bots/api#getting-updates
[5]: https://home.openweathermap.org/users/sign_up
[6]: https://home.openweathermap.org/users/sign_in
[7]: https://home.openweathermap.org/api_keys
[8]: https://imgur.com/signin
[9]: https://api.imgur.com/oauth2/addclient
[10]: https://apidocs.imgur.com/#authorization-and-oauth
[11]: https://identity.flickr.com/login
[12]: https://www.flickr.com/services/apps/create/apply/
[13]: https://www.flickr.com/services/api/keys/

View File

@@ -41,64 +41,8 @@ bash bootstrap.sh
Бот не использует [вебхуки][4], поэтому ничего дополнительного, кроме хорошего Бот не использует [вебхуки][4], поэтому ничего дополнительного, кроме хорошего
подключения к интернету ему не нужно. подключения к интернету ему не нужно.
### Дополнительные настройки
Некоторые "плагины" требуют регистрации в сторонних сервисах (API keys, secrets
итд), чтобы бот не сыпал ошибками в логи (возможно, в дальнейшем возможно будет
отключить эти плагины).
#### OpenWeatherMap
Для работы погодного плагина, надо [заргистрироваться][5], [залогиниться][6] и
[создать][7] api key. Free plan предлагает всё необхдимое для работы "плагина".
Когда api key будет создан, его нужно вписать в **config.json** "секцию"
openweathermap в качестве appid. На этом всё.
#### Imgur
Этот плагин "просто есть" и его на самом деле ничто и никто не использует. И в
этой связи все настройки плагина можно оставить "как есть" в примере конфига.
Тем не менее, если есть большое желание, то можно [залогиниться][8] и
[зарегистрировать][9] бота как приложение, а потом разрешить приложению
пользоваться API-шкой, как описано в [этом][10] или [этом][11] мануале.
#### Flickr
Этот "плагин" действительно используется для добычи ссылок на картинки в разных
"картиночных" командах бота.
Есть скрипт, который поможет с регистрацией приложения в api Flickr -
**bin/flickr_init.pl**, он достанет все нужные ключи и секреты к ним.
До запуска этого скрипта, бот должен быть забутстраплен через **`bootstrap.sh`**.
[Залогиньтесь][11] и создайте [app][12] in своём Flicker-овском аккаунте. Далее,
*разлогиньтесь*, это нужно, чтобы потом проще было достать параметр verifier.
Запишите [app key и secret][13] в **config.json**. Удостоверьтесь, что параметр
"verifier" в конфиге либо закоменчен, либо отсутствует.
Запустите **bin/flickr_init.pl** и следуте предлагаемым инструкциям - в итоге
будет дана ссылка, которую надо скопипастить в браузер. По ссылке предложат
залогиниться, далее надо будет разрешить приложению просматривать профиль и,
через один-два редиректа, вы попадёте на example.com. Из адресной строки браузера
надо скопировать параметр "verifier" и вписать его в **config.json**.
Чтобы сохранить в бд плагина API access token для нормальной работы "плагина",
второй раз запустите **bin/flickr_init.pl**. На этом всё.
[1]: https://metacpan.org/pod/Telegram::Bot [1]: https://metacpan.org/pod/Telegram::Bot
[2]: https://metacpan.org/pod/Hailo [2]: https://metacpan.org/pod/Hailo
[3]: https://core.telegram.org/bots/api [3]: https://core.telegram.org/bots/api
[4]: https://core.telegram.org/bots/api#getting-updates [4]: https://core.telegram.org/bots/api#getting-updates
[5]: https://home.openweathermap.org/users/sign_up
[6]: https://home.openweathermap.org/users/sign_in
[7]: https://home.openweathermap.org/api_keys
[8]: https://imgur.com/signin
[9]: https://api.imgur.com/oauth2/addclient
[10]: https://apidocs.imgur.com/#authorization-and-oauth
[11]: https://identity.flickr.com/login
[12]: https://www.flickr.com/services/apps/create/apply/
[13]: https://www.flickr.com/services/api/keys/