dev-master
9999999-devAuto publishing module for social services (VK, OK, FB).
BSD-3-Clause
The Requires
by Marat Dolotov
extension yii2 module cross-posting auto-posting
Auto publishing module for social services (VK, OK, FB).
Auto publishing module for social services (VK, OK, FB), (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require bemulima/yii2-cross-posting "*"
or add, (*4)
"bemulima/yii2-cross-posting": "*"
to the require section of your composer.json
file., (*5)
'modules' => [ 'cross_posting' => [ 'class' => 'bemulima\cross-posting\Module', ], ... ], 'components' => [ 'crossPosting' => [ 'class' => 'bemulima\cross-posting\CrossPosting', 'services' => [ 'vk' => [ 'class' => 'bemulima\cross-posting\Vk', 'accessToken' => 'XXX', 'groups' => [ '###', '###', ] ], 'ok' => [ 'class' => 'bemulima\cross-posting\Ok', 'accessToken' => 'XXX', 'privateKey' => 'XXX', 'publicKey' => 'XXX', 'groups' => [ '###', '###', ] ], 'fb' => [ 'class' => 'bemulima\cross-posting\Fb', 'accessToken' => 'XXX', 'privateKey' => 'XXX', 'publicKey' => 'XXX', 'groups' => [ '###', '###', ] ] ] ] ], ... ]
Instead of XXX, you have to use yours values. To receive them, you must create applications on the social networks. Instead of ###, you have to use yours id groups in social networks, (*6)
Client | Registration address |
---|---|
vkontakte | https://vk.com/editapp?act=create |
https://developers.facebook.com/apps | |
odnoklassniki | https://apiok.ru/dev/app/create |
in main layout:, (*7)
use budyaga\users\components\AuthorizationWidget;
$crossPosting = Yii::$app->crossPosting ->text($text) ->images($images) ->url($ad->url); $crossPosting->service('vk')->publish(); $crossPosting->service('ok')->publish(); $crossPosting->service('fb')->publish();
Auto publishing module for social services (VK, OK, FB).
BSD-3-Clause
extension yii2 module cross-posting auto-posting