alanmonger/socialite

此包已被 废弃 且不再维护。未建议替代包。

简单的社交媒体包装器

1.0.2 2015-01-12 22:46 UTC

This package is not auto-updated.

Last update: 2022-02-19 03:01:44 UTC


README

SensioLabsInsight #Socialite

Socialite 是一个社交媒体组件,允许独立或批量发布到流行的社交媒体平台。

单次使用

###发布到 Facebook

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

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

    $facebook->post($message);

###发布到 Twitter

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

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

    $twitter->post($message);

批量发布

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