Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Latest commit

 

History

History
46 lines (32 loc) · 1.21 KB

README.md

File metadata and controls

46 lines (32 loc) · 1.21 KB

SensioLabsInsight #Socialite

Socialite is a social media component which allows posting to popular social media platforms either independently or in bulk.

Single Post Use

###Posting to facebook

    $facebook = Socialite\Service\ServiceFactory::facebook($appId, $appSecret);

    $message = new Socialite\Message();
    $message->setBody("Test Post");

    $facebook->post($message);

###Posting to Twitter

    $twitter = ServiceFactory::twitter($consumerKey, $consumerSecret, $token, $tokenSecret);

    $message = new Socialite\Message();
    $message->setBody("Test Post");

    $twitter->post($message);

Bulk Post

    $twitter    = \Socialite\Service\ServiceFactory::twitter($consumerKey, $consumerSecret, $token, $tokenSecret);
    $facebook   = \Socialite\Service\ServiceFactory::facebook($appId, $appSecret);
    $post       = new \Socialite\Message();

    $post->setBody("test");

    $bulk = new \Socialite\Post\Bulk;

    $bulk
        ->addPost($twitter)
        ->addPost($facebook)
        ->send($post)
    ;