Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Wall Poster Bundle Laravel Package

dario_swain/wall-poster-bundle

View on GitHub
Deep Wiki
Context7

WallPosterBundle

The WallPosterBundle bundle allows you to post your site news in your social groups, pages or timelines.

Installation

Add this bundle to your composer.json file:

{
    "require": {
        "dario_swain/wall-poster-bundle": "dev-master"
    }
}

You should browse dario_swain/wall-poster-bundle page to choose a stable version to use, avoid the @stable meta constraint.

Register the bundle in app/AppKernel.php:

// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new new WallPosterBundle\WallPosterBundle(),
    );
}

Import the routing definition in routing.yml:

# app/config/routing.yml
WallPosterBundle:
    resource: "@WallPosterBundle/Resources/routing/routing.yml"

This route (/wall-poster/captcha) used for enter captcha value if vk.com block your api requests

Enable the bundle's configuration in app/config/config.yml:

# app/config/config.yml
wall_poster:
    vk:
        access_token: VK_STANDALONE_APPLICATION_ACCESS_TOKEN
        group_id: VK_GROUP_ID
    facebook:
        access_token: FACEBOOK_ACCESS_TOKEN
        app_id: FACEBOOK_APPLICATION_ID
        app_secret: FACEBOOK_APPLICATION_SECRET
        page: FACEBOOK_PAGE_ID
    twitter:
        api_key: TWITTER_APP_KEY
        api_secret: TWITTER_APP_SECRET
        access_token: TWITTER_ACCESS_TOKEN
        access_secret:  TWITTER_ACCESS_TOKEN_SECRET

Usage

You can publish your posts in social networks, for use this you can use special wall-poster services.

Post

Create WallPosterBundle\Post\Post for publisher

<?php

namespace Your\Namespace;

use WallPosterBundle\Post\Post;

class YourController extends Controller
{
    public function updateAction()
    {
        /** Create you Post instance **/
        $post = new Post();
        /** Add image to post, you can provide absolute path for your local file and browser url to file **/
        $post->createImage('/var/www/images/test.jpg','http://your_site.com/images/test.jpg')
        /** Add link to post **/
            ->createLink('http://your_site.com/about')
        /** Add social tags **/
            ->addTag('about')
            ->addTag('your_site')
            ->addTag('follow_me')
        /** Add message to your post **/
            ->setMessage('Hello world!');
    }
}

After creation Post instance you can publish it with social network providers.

Social network providers

The bundle provide an wall_poster.vk, wall_poster.facebook and wall_poster.twitter services, after Post creation:

<?php

namespace Your\Namespace;

use WallPosterBundle\Post\Post;

class YourController extends Controller
{
    public function updateAction()
    {
        /** Create you Post instance **/
        $post = new Post();

        /** ... **/

        $provider = $this->get('wall_poster.vk');

        try
        {
            $post = $provider->publish($post);
        }
        catch(Exception $ex)
        {
            //Handle errors
        }

    }
}
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours