Группа одноклассников указывается в настройках

This commit is contained in:
Artur Galyamov 2022-12-31 16:40:44 +05:00
parent 1f4a39e22e
commit 85c97f3dd4
3 changed files with 5 additions and 3 deletions

@ -6,4 +6,5 @@ VK_PASSWORD=123123
VK_OWNER_ID=-2
OK_ACCESS_TOKEN=aatk
OK_APPLICATION_KEY=FFCF
OK_APPLICATION_SECRET_KEY=GGD
OK_APPLICATION_SECRET_KEY=GGD
OK_GROUP_ID=700

@ -63,6 +63,7 @@ class OdnoklassnikiPromoter(Promoter):
ok_access_token = promoter_secrets['OK_ACCESS_TOKEN']
ok_application_key = promoter_secrets['OK_APPLICATION_KEY']
ok_application_secret_key = promoter_secrets['OK_APPLICATION_SECRET_KEY']
ok_group_id = promoter_secrets['OK_GROUP_ID']
session = ok_api.OkApi(access_token=ok_access_token,
application_key=ok_application_key,
@ -82,7 +83,7 @@ class OdnoklassnikiPromoter(Promoter):
encoded_attachments = JSONEncoder().encode(attachments)
try:
session.mediatopic.post(type='GROUP_THEME',
gid='70000001426867',
gid=ok_group_id,
attachment=encoded_attachments)
except ok_api.OkApiException as exc:
raise PromoteError(exc)

@ -42,7 +42,7 @@ dotenv.read_dotenv(env_file)
promoter_env_keys = (
'TELEGRAM_BOT_TOKEN', 'TELEGRAM_CHAT_ID', 'JOOMLA_TOKEN',
'VK_LOGIN', 'VK_PASSWORD', 'VK_OWNER_ID', 'OK_ACCESS_TOKEN', 'OK_APPLICATION_KEY',
'OK_APPLICATION_SECRET_KEY',
'OK_APPLICATION_SECRET_KEY', 'OK_GROUP_ID',
)
promoter_secrets = {}
if ENV_ENCODED: