2017 © Pedro Peláez
 

yii2-extension yii2-crossposting

Auto publishing module for social services (VK, OK, FB).

image

bemulima/yii2-crossposting

Auto publishing module for social services (VK, OK, FB).

  • Tuesday, July 17, 2018
  • by bemulima
  • Repository
  • 1 Watchers
  • 3 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Yii2-cross-posting

Auto publishing module for social services (VK, OK, FB), (*1)

Installation

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)

Config

'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
facebook https://developers.facebook.com/apps
odnoklassniki https://apiok.ru/dev/app/create

Usage

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();

The Versions

17/07 2018

dev-master

9999999-dev

Auto publishing module for social services (VK, OK, FB).

  Sources   Download

BSD-3-Clause

The Requires

 

by Marat Dolotov

extension yii2 module cross-posting auto-posting